Introduction

The LEADTOOLS Class Library provides C++ classes to let you incorporate image compression, file format support, and image processing into your Windows applications.

The Class Library comes in a WIN32 edition and supports 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 LSegment class. The LSegment class is derived from LBase and provides the ability to work with Mixed Raster Content files. The class enables the user to produce MRC images, save to MRC files, and load from MRC files. Documentation for this Class can be found in the LEADTOOLS MRC Class Library help file, Ltmrclibn.chm in the LEADTOOLS\Help directory.

Getting Started with the LEADTOOLS Class Library

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: | November 2, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

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)

Version 10


Changes from Version 14 to Version 14.5

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

With this mid-release of LEADTOOLS version 14, many new features are being introduced to the annotations. Some of these features alter the way annotations are displayed. Other features change or enhance the user interface. To maintain backward compatibility within version 14, most of these features must be enabled by calling the LAnnotation::SetOptions 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 Text Annotation Options

New XML Format

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

LEADTOOLS now 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 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 for loading 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 new functionality, which handles the TIFF and Exif files, such as compact TIFF files, enumerates all the tags in TIFF and Exif files, and deletes tags 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 a JBIG2 file, you can get or change the current values for the control options used by LEADTOOLS.

LEADTOOLS has added many new image processing functions.

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

LEADTOOLS now supports the following new file formats:

File Formats: ABIC Format (ABIC, ICA)

File Formats: JBIG2 Format (JB2)

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

Annotation

LAnnotation::CalibrateRuler

LAnnotation::GetAutoSnapCursor

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetRotateOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetRotateOptions

LAnnotation::SetTextOptions

LAnnotation::TextEdit

Zoom View

LBitmapWindow::AddZoomView

LBitmapWindow::DestroyZoomView

LBitmapWindow::EnableHiliteZoomView

LBitmapWindow::GetZoomViewsCount

LBitmapWindow::GetZoomViewProps

LBitmapWindow::HasZoomView

LBitmapWindow::IsHiliteZoomViewEnabled

LBitmapWindow::UpdateZoomView

GeoKeys

LFile::SetGeoKey

LFile::GetGeoKey

LFile::WriteGeoKey

LFile::ReadGeoKey

LFile::EnumGeoKeys

LFile::EnumGeoKeysCallBack

LAnnAutomation

LAnnAutomation::SetAutoHilightPen

LBitmap

LBitmap::Perlin

LBitmap::ColoredPencil

Change the image data type (Signed / Unsigned)

LBitmap::ShiftMinimumToZero

LBitmap::ShiftZeroToNegative

Kaufmann region

LBitmap::SetKaufmannRgn

ICC Profile

LFile::FreeICCProfile

LFile::FreeICCProfileExt

LFile::InitICCProfile

LFile::InitICCProfileExt

LFile::LoadICCProfile

LFile::LoadICCProfileExt

LFile::SaveICCProfile

Image Optimization

LOptimize::LOptimize

LOptimize::~LOptimize

LOptimize::GetDefaultOptions

LOptimize::OptimizeBuffer

LOptimize::OptimizeBufferCallBack

LOptimize::OptimizeDir

LOptimize::OptimizeDirCallBack

LImageListControl

LImageListControl::SortExt

LImageListControl::ImportBitmapList

LImageListControl::ExportBitmapList

CMYK TIFF Files

LFile::LoadCMYKArray

LFile::SaveCMYKArray

LPaint::PaintDCCMYKArray

Handling TIFF and Exif Files

LFile::Compact

LFile::EnumTags

LFile::EnumTagsCallBack

LFile::DeleteTag

Reading a comment from a file at a specific location

LFile::ReadCommentOffset

HSV and RGB ranges

LBitmapRgn::SetRgnColorHSVRange

LBitmapRgn::SetRgnColorRGBRange

Loading TXT file Options

LFileSettings::GetTXTOptions

LFileSettings::SetTXTOptions

Saving JBIG2 file Options

LFileSettings::GetJBIG2Options

LFileSettings::SetJBIG2Options

Image Processing Functions

LBitmap::AdjustTint

LBitmap::BricksTexture

LBitmap::Canvas

LBitmap::Clouds

LBitmap::ColoredBalls

LBitmap::ColoredPencil

LBitmap::ColorHalfTone

LBitmap::CorrelationList

LBitmap::DeskewExt

LBitmap::DiffuseGlow

LBitmap::DisplaceMap

LBitmap::Fragment

LBitmap::GammaCorrectExt

LBitmap::HalfTonePattern

LBitmap::HighPassFilter

LBitmap::MaskConvolution

LBitmap::MosaicTiles

LBitmap::Offset

LBitmap::Perlin

LBitmap::Perspective

LBitmap::PlasmaFilter

LBitmap::Pointillist

LBitmap::RomanMosaic

LBitmap::Vignette

LBitmap::ZigZag

Miscellaneous

LBase::EncodeABIC

LBase::DecodeABIC

LBitmapBase::GetLoadStatus

New structures

ANNROTATEOPTIONS

ANNTEXTOPTIONS

ZOOMVIEWPROPS

LILEXPORTBITMAPLIST

LILIMPORTBITMAPLIST

LILSORTOPTIONS

MEMICCPROFILE

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICC_DATE_TIME_NUMBER

ICC_XYZ_NUMBER

ICCCOLORSPACE

ICCPROFILECLASS

ICCPLATFORMSIGNATURE

ICCRENDERINGINTENT

ICCTAGSIGNATURE

OPTIMIZEIMAGEOPTIONS

OPTIMIZEIMAGEDIRINFO

JPEGCOLORSPACE

HSVREF

MOSAICTILESINFO

PLASMAINFO

VIGNETTEINFO

FILEJBIG2OPTIONS

FILETXTOPTIONS


Changes from Version 13 to Version 14

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

LEADTOOLS now supports UNICODE.

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

LEADTOOLS now supports overlay bitmaps 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 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

LEADTOOLS now supports The PLT/RTF Options.

LEADTOOLS now supports AutoCAD Color Scheme.

LEADTOOLS now can 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.

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

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

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

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

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

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

LEADTOOLS now transforms the bitmap into a binary image.

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

LEADTOOLS now smoothes the edges of a bitmap.

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

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

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

LEADTOOLS now can removes holes from a bitmap region.

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

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

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

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

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

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

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

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

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

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

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

Warps the bitmap to a cylindrical shape.

Shears the bitmap by the wave drawn using amplitude values

Distorts the bitmap by the wave drawn using amplitude values

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

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

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

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

Rotates the bitmap pixels around a center point.

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

Warps the image in concentric rings.

Warps the image around a 3D spherical shape.

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

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

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

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

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

Draws a water wave effect

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

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

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

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

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

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

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

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

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

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

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

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

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

Draws a star on the bitmap.

Simulates painting an image with the watercolor dry brush technique.

Wraps the bitmap onto a 3D plane.

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

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

Makes colored edges shine with a neon-like glow.

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

Adds many spots of directed light sources to the bitmap.

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

Reflects the bitmap on an ocean surface.

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

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

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

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

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

Smoothes the rough edges in the bitmap.

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

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

Changed functions

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

LAnnContainer::FileInfo takes 1 new parameter.

LAnnContainer::FileInfoMemory takes 1 new parameter.

LAnnContainer::FileInfoOffset takes 1 new parameter.

LAnnPushPin::GetSecondaryBitmap takes 1 new parameter.

LAnnToolBar::GetToolBarButtons takes 1 new parameter.

LAnnToolBar::GetToolBarInfo takes 1 new parameter.

LBase::LoadLibraries takes 1 new parameter.

LBase::VersionInfo takes 1 new parameter.

LBitmapBase::ConvertToDIB takes 1 new parameter.

LBitmapBase::CreateFadedMask takes 1 new parameter.

LBitmapBase::Resize takes 2 new parameters.

LBaseFile::GetDefaultSaveFileOption takes 1 new parameter.

LBitmapList::GetItem takes 1 new parameter.

LBitmapWindow::GetMagGlassOptions takes 1 new parameter.

LBitmapRgn::SetRgnMagicWand takes 2 new parameters.

LChange::ChangeFromDIB takes 1 new parameter.

LFile::BrowseDir takes 1 new parameter.

LFile::GetInfo takes 1 new parameter.

LFileSettings::GetDefaultJ2KOptions takes 1 new parameter.

LFileSettings::GetJ2KOptions takes 1 new parameter.

LMemoryFile::GetInfo takes 1 new parameter.

LPaintEffect::EffectBlt takes 2 new parameters.

LPaintEffect::PaintBitmap takes 2 new parameters.

LPaintEffect::PaintTransition takes 2 new parameters.

LScreenCapture::CaptureAreaOptionDlg takes 1 new parameter.

LScreenCapture::CaptureFromEXEDlg takes 1 new parameter.

LScreenCapture::CaptureObjectOptionDlg takes 1 new parameter.

LScreenCapture::SetCaptureOptionDlg takes 1 new parameter.

The parameters nThumbWidth, nThumbHeight, nBits, uCRFlags, bMaintainAspect, bForceSize, crBackColor, bLoadStamp, and bResample of LFile::BrowseDir were removed and a pointer to THUMBOPTIONS was added.

The parameters nWidth, nHeight, nZoom, clrPen,hMagCursor, clrBack, bEllipse, nBorderSize, b3D, uPaintFlags, pMask, uMaskCount, nCrosshair, bIgnoreRgn, and bCenter, of LBitmapWindow::GetMagGlassOptions were removed and one new parameter was added.

The following functions have been removed:

The Class LDialog was removed

LAnnotation::GetName

LAnnotation::SetName

LBitmapBase::Add

Changed structures

The BITMAPHANDLE structure has 4 new members.

The BALANCING structure now has 1 new member.

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 THUMBOPTIONS structure has 1 new member.

The SMOOTH structure has 2 new members.

The LINEREMOVE structure has 2 new members.

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 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 ANNTOOL structure has 1 new member.

The ANNTOOLBARINFO structure has 1 new member.

New structures

The following are new structures:

ADDMESGINFO

ANNCHANGEPARAM

ANNCHANGETYPE

ANNENCRYPTOPTIONS

ANNFONT

ANNHANDLE

ANNHANDLEINFO

ANNHILIGHT

ANNHYPERLINK

ANNMOVE

ANNMOVEPOINT

ANNNAMEOPTIONS

ANNPOINTOPTIONS

ANNPROTRACTOR

ANNRESIZEROTATE

ANNRULERUNIT

ANNSMARTDISTANCE

ANNTEXTTOKEN

ANNTEXTTOKENTYPE

ANNXFORM

BALANCEDATA

BUMPDATA

COLORDATA

COLORREPLACE

COMPDATA

FILEDJVOPTIONS

FILEOVERLAYCALLBACKDATA

FILEPLTOPTIONS

FILEPTKOPTIONS

FILERTFOPTIONS

FTARRAY

GRAYCOLOR

HITTESTINFO

HSIDATA

L_COMPLEX

LIGHTINFO

LIGHTPARAMS

LVLCLRINF

LVLCLR

MAGGLASSOPTIONS

OVERLAYATTRIBUTES

SEARCHMARKS

SELCLRINF

SELCLR

STARINFO

STATISTICSINFO

USERFLT

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

LAnnAudioClip

LAnnAudioClip::AddUserHandle

LAnnAudioClip::GetUserHandle

LAnnAudioClip::GetUserHandles

LAnnAudioClip::ChangeUserHandle

LAnnAudioClip::DeleteUserHandle

LAnnAudioClip::EnumerateHandles

LAnnAudioClip::EnumHandleCallBack

LAnnAudioClip::GetRotateAngle

LAnnAudioClip::GetFixed

LAnnAudioClip::SetFixed

LAnnAudioClip::PushFixedState

LAnnAudioClip::PopFixedState

LAnnAudioClip::IsFixedInRect

LAnnAutomation

LAnnAutomation::SetEncryptOptions

LAnnAutomation::GetEncryptOptions

LAnnAutomation::GetPointOptions

LAnnAutomation::SetPointOptions

LAnnAutomation::GetTextAlign

LAnnAutomation::SetTextAlign

LAnnAutomation::SetTextRotate

LAnnAutomation::GetTextRotate

LAnnAutomation::SetTextPointerFixed

LAnnAutomation::GetTextPointerFixed

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::EnumerateTextTokenTable

LAnnAutomation::EnumTextTokenTableCallBack

LAnnAutomation::DeleteTextTokenTable

LAnnAutomation::ClearTextTokenTable

LAnnAutomation::GetTextExpandTokens

LAnnAutomation::SetTextExpandTokens

LAnnAutomation::GetFixed

LAnnAutomation::SetFixed

LAnnAutomation::PushFixedState

LAnnAutomation::PopFixedState

LAnnAutomation::IsFixedInRect

LAnnAutomation::SetAutoCursor

LAnnAutomation::GetAutoCursor

LAnnAutomation::SetTextRTF

LAnnAutomation::GetTextRTF

LAnnAutomation::GetTicMarkLength

LAnnAutomation::SetTicMarkLength

LAnnAutomation::SetAutoDialogFontSize

LAnnAutomation::GetAutoDialogFontSize

LAnnAutomation::SetAutoUndoEnable

LAnnAutomation::GetAutoUndoEnable

LAnnAutomation::AddUndoNode

LAnnButton

LAnnButton::AddUserHandle

LAnnButton::GetUserHandle

LAnnButton::GetUserHandles

LAnnButton::ChangeUserHandle

LAnnButton::DeleteUserHandle

LAnnButton::EnumerateHandles

LAnnButton::EnumHandleCallBack

LAnnButton::GetRotateAngle

LAnnButton::GetFixed

LAnnButton::SetFixed

LAnnButton::PushFixedState

LAnnButton::PopFixedState

LAnnButton::IsFixedInRect

LAnnContainer

LAnnContainer::EncryptApply

LAnnContainer::RestrictCursor

LAnnContainer::HitTestExt

LAnnContainer::Convert

LAnnContainer::SetGrouping

LAnnContainer::GetGrouping

LAnnCrossProduct

LAnnCrossProduct::AddUserHandle

LAnnCrossProduct::GetUserHandle

LAnnCrossProduct::GetUserHandles

LAnnCrossProduct::ChangeUserHandle

LAnnCrossProduct::DeleteUserHandle

LAnnCrossProduct::EnumerateHandles

LAnnCrossProduct::EnumHandleCallBack

LAnnCrossProduct::GetFixed

LAnnCrossProduct::SetFixed

LAnnCrossProduct::PushFixedState

LAnnCrossProduct::PopFixedState

LAnnCrossProduct::IsFixedInRect

LAnnCrossProduct::GetDistance2

LAnnCurveClosed

LAnnCurveClosed::LAnnCurveClosed

LAnnCurveClosed::~LAnnCurveClosed

LAnnCurveClosed::Create

LAnnCurveClosed::AddUserHandle

LAnnCurveClosed::GetUserHandle

LAnnCurveClosed::GetUserHandles

LAnnCurveClosed::ChangeUserHandle

LAnnCurveClosed::DeleteUserHandle

LAnnCurveClosed::EnumerateHandles

LAnnCurveClosed::EnumHandleCallBack

LAnnCurveClosed::GetFixed

LAnnCurveClosed::SetFixed

LAnnCurveClosed::PushFixedState

LAnnCurveClosed::PopFixedState

LAnnCurveClosed::IsFixedInRect

LAnnCurveClosed::GetPointCount

LAnnCurveClosed::GetPoints

LAnnCurveClosed::SetPoints

LAnnCurve

LAnnCurve::LAnnCurve

LAnnCurve::~LAnnCurve

LAnnCurve::Create

LAnnCurve::AddUserHandle

LAnnCurve::GetUserHandle

LAnnCurve::GetUserHandles

LAnnCurve::ChangeUserHandle

LAnnCurve::DeleteUserHandle

LAnnCurve::EnumerateHandlest

LAnnCurve::EnumHandleCallBack

LAnnCurve::GetFixed

LAnnCurve::SetFixed

LAnnCurve::PushFixedState

LAnnCurve::PopFixedState

LAnnCurve::IsFixedInRect

LAnnCurve::GetPointCount

LAnnCurve::GetPoints

LAnnCurve::SetPoints

LAnnEllipse

LAnnEllipse::AddUserHandle

LAnnEllipse::GetUserHandle

LAnnEllipse::GetUserHandles

LAnnEllipse::ChangeUserHandle

LAnnEllipse::DeleteUserHandle

LAnnEllipse::EnumerateHandles

LAnnEllipse::EnumHandleCallBack

LAnnEllipse::GetRotateAngle

LAnnEllipse::GetFixed

LAnnEllipse::SetFixed

LAnnEllipse::PushFixedState

LAnnEllipse::PopFixedState

LAnnEllipse::IsFixedInRect

LAnnEncrypt

LAnnEncrypt::LAnnEncrypt

LAnnEncrypt::~LAnnEncrypt

LAnnEncrypt::Create

LAnnEncrypt::AddUserHandle

LAnnEncrypt::GetUserHandle

LAnnEncrypt::GetUserHandles

LAnnEncrypt::ChangeUserHandle

LAnnEncrypt::DeleteUserHandle

LAnnEncrypt::EnumerateHandles

LAnnEncrypt::EnumHandleCallBack

LAnnEncrypt::SetEncryptOptions

LAnnEncrypt::GetEncryptOptions

LAnnEncrypt::GetSecondaryMetafile

LAnnEncrypt::SetMetafile

LAnnEncrypt::GetMetafile

LAnnEncrypt::GetRotateAngle

LAnnEncrypt::GetLineStyle

LAnnEncrypt::GetLineWidth

LAnnEncrypt::SetLineStyle

LAnnEncrypt::SetLineWidth

LAnnFreehand

LAnnFreehand::AddUserHandle

LAnnFreehand::GetUserHandle

LAnnFreehand::GetUserHandles

LAnnFreehand::ChangeUserHandle

LAnnFreehand::DeleteUserHandle

LAnnFreehand::EnumerateHandles

LAnnFreehand::EnumHandleCallBack

LAnnFreehand::GetFixed

LAnnFreehand::SetFixed

LAnnFreehand::PushFixedState

LAnnFreehand::PopFixedState

LAnnFreehand::IsFixedInRect

LAnnFreehandHotSpot

LAnnFreehandHotSpot::AddUserHandle

LAnnFreehandHotSpot::GetUserHandle

LAnnFreehandHotSpot::GetUserHandles

LAnnFreehandHotSpot::ChangeUserHandle

LAnnFreehandHotSpot::DeleteUserHandle

LAnnFreehandHotSpot::EnumerateHandles

LAnnFreehandHotSpot::EnumHandleCallBack

LAnnFreehandHotSpot::GetFixed

LAnnFreehandHotSpot::SetFixed

LAnnFreehandHotSpot::PushFixedState

LAnnFreehandHotSpot::PopFixedState

LAnnFreehandHotSpot::IsFixedInRect

LAnnHilite

LAnnHilite::AddUserHandle

LAnnHilite::GetUserHandle

LAnnHilite::GetUserHandles

LAnnHilite::ChangeUserHandle

LAnnHilite::DeleteUserHandle

LAnnHilite::EnumerateHandles

LAnnHilite::EnumHandleCallBack

LAnnHilite::GetRotateAngle

LAnnHilite::GetFixed

LAnnHilite::SetFixed

LAnnHilite::PushFixedState

LAnnHilite::PopFixedState

LAnnHilite::IsFixedInRect

LAnnHotSpot

LAnnHotSpot::AddUserHandle

LAnnHotSpot::GetUserHandle

LAnnHotSpot::GetUserHandles

LAnnHotSpot::ChangeUserHandle

LAnnHotSpot::DeleteUserHandle

LAnnHotSpot::EnumerateHandles

LAnnHotSpot::EnumHandleCallBack

LAnnHotSpot::GetRotateAngle

LAnnHotSpot::GetFixed

LAnnHotSpot::SetFixed

LAnnHotSpot::PushFixedState

LAnnHotSpot::PopFixedState

LAnnHotSpot::IsFixedInRect

LAnnLine

LAnnLine::AddUserHandle

LAnnLine::GetUserHandle

LAnnLine::GetUserHandles

LAnnLine::ChangeUserHandle

LAnnLine::DeleteUserHandle

LAnnLine::EnumerateHandles

LAnnLine::EnumHandleCallBack

LAnnLine::GetRotateAngle

LAnnLine::GetFixed

LAnnLine::SetFixed

LAnnLine::PushFixedState

LAnnLine::PopFixedState

LAnnLine::IsFixedInRect

LAnnNote

LAnnNote::AddUserHandle

LAnnNote::GetUserHandle

LAnnNote::GetUserHandles

LAnnNote::ChangeUserHandle

LAnnNote::DeleteUserHandle

LAnnNote::EnumerateHandles

LAnnNote::EnumHandleCallBack

LAnnNote::GetRotateAngle

LAnnNote::GetTextAlign

LAnnNote::SetTextAlign

LAnnNote::SetTextRotate

LAnnNote::GetTextRotate

LAnnNote::GetFixed

LAnnNote::SetFixed

LAnnNote::PushFixedState

LAnnNote::PopFixedState

LAnnNote::IsFixedInRect

LAnnotation

LAnnotation::GetNameOptions

LAnnotation::SetNameOptions

LAnnotation::SetRestrictToContainer

LAnnotation::GetRestrictToContainer

LAnnotation::Define2

LAnnotation::SetUserData

LAnnotation::GetUserData

LAnnotation::GetAutoBackColor

LAnnotation::SetAutoBackColor

LAnnotation::AdjustPoint

LAnnPolygon

LAnnPolygon::AddUserHandle

LAnnPolygon::GetUserHandle

LAnnPolygon::GetUserHandles

LAnnPolygon::ChangeUserHandle

LAnnPolygon::DeleteUserHandle

LAnnPolygon::EnumerateHandles

LAnnPolygon::EnumHandleCallBack

LAnnPolygon::GetFixed

LAnnPolygon::SetFixed

LAnnPolygon::PushFixedState

LAnnPolygon::PopFixedState

LAnnPolygon::IsFixedInRect

LAnnPoint

LAnnPoint::SetPredefinedBitmap

LAnnPoint::GetPredefinedBitmap

LAnnPoint::GetPointOptions

LAnnPoint::SetPointOptions

LAnnPoint::AddUserHandle

LAnnPoint::GetUserHandle

LAnnPoint::GetUserHandles

LAnnPoint::ChangeUserHandle

LAnnPoint::DeleteUserHandle

LAnnPoint::EnumerateHandles

LAnnPoint::EnumHandleCallBack

LAnnPoint::GetFixed

LAnnPoint::SetFixed

LAnnPoint::PushFixedState

LAnnPoint::PopFixedState

LAnnPoint::IsFixedInRect

LAnnPolyline

LAnnPolyline::AddUserHandle

LAnnPolyline::GetUserHandle

LAnnPolyline::GetUserHandles

LAnnPolyline::ChangeUserHandle

LAnnPolyline::DeleteUserHandle

LAnnPolyline::EnumerateHandles

LAnnPolyline::EnumHandleCallBack

LAnnPolyline::GetFixed

LAnnPolyline::SetFixed

LAnnPolyline::PushFixedState

LAnnPolyline::PopFixedState

LAnnPolyline::IsFixedInRect

LAnnPolyRuler

LAnnPolyRuler::LAnnPolyRuler

LAnnPolyRuler::~LAnnPolyRuler

LAnnPolyRuler::Create

LAnnPolyRuler::AddUserHandle

LAnnPolyRuler::GetUserHandle

LAnnPolyRuler::GetUserHandles

LAnnPolyRuler::ChangeUserHandle

LAnnPolyRuler::DeleteUserHandle

LAnnPolyRuler::EnumerateHandles

LAnnPolyRuler::EnumHandleCallBack

LAnnPolyRuler::GetFixed

LAnnPolyRuler::SetFixed

LAnnPolyRuler::PushFixedState

LAnnPolyRuler::PopFixedState

LAnnPolyRuler::IsFixedInRect

LAnnPolyRuler::GetPointCount

LAnnPolyRuler::GetPoints

LAnnPolyRuler::SetPoints

LAnnPolyRuler::GetLineStyle

LAnnPolyRuler::GetLineWidth

LAnnPolyRuler::SetLineStyle

LAnnPolyRuler::SetLineWidth

LAnnPolyRuler::SetNodes

LAnnPolyRuler::GetNodes

LAnnPolyRuler::GetTicMarkLength

LAnnPolyRuler::SetTicMarkLength

LAnnPolyRuler::GetDistance2

LAnnPolyRuler::GetDistance

LAnnPolyRuler::GetUnitLen

LAnnProtractor

LAnnProtractor::AddUserHandle

LAnnProtractor::GetUserHandle

LAnnProtractor::GetUserHandles

LAnnProtractor::ChangeUserHandle

LAnnProtractor::DeleteUserHandle

LAnnProtractor::EnumerateHandles

LAnnProtractor::EnumHandleCallBack

LAnnProtractor::GetFixed

LAnnProtractor::SetFixed

LAnnProtractor::PushFixedState

LAnnProtractor::PopFixedState

LAnnProtractor::IsFixedInRect

LAnnProtractor::GetDistance2

LAnnPointer

LAnnPointer::AddUserHandle

LAnnPointer::GetUserHandle

LAnnPointer::GetUserHandles

LAnnPointer::ChangeUserHandle

LAnnPointer::DeleteUserHandle

LAnnPointer::EnumerateHandles

LAnnPointer::EnumHandleCallBack

LAnnPointer::GetRotateAngle

LAnnPointer::GetFixed

LAnnPointer::SetFixed

LAnnPointer::PushFixedState

LAnnPointer::PopFixedState

LAnnPointer::IsFixedInRect

LAnnPushPin

LAnnPushPin::AddUserHandle

LAnnPushPin::GetUserHandle

LAnnPushPin::GetUserHandles

LAnnPushPin::ChangeUserHandle

LAnnPushPin::DeleteUserHandle

LAnnPushPin::EnumerateHandles

LAnnPushPin::EnumHandleCallBack

LAnnPushPin::GetRotateAngle

LAnnPushPin::GetFixed

LAnnPushPin::SetFixed

LAnnPushPin::PushFixedState

LAnnPushPin::PopFixedState

LAnnPushPin::IsFixedInRect

LAnnRedact

LAnnRedact::AddUserHandle

LAnnRedact::GetUserHandle

LAnnRedact::GetUserHandles

LAnnRedact::ChangeUserHandle

LAnnRedact::DeleteUserHandle

LAnnRedact::EnumerateHandles

LAnnRedact::EnumHandleCallBack

LAnnRedact::GetRotateAngle

LAnnRectangle

LAnnRectangle::AddUserHandle

LAnnRectangle::GetUserHandle

LAnnRectangle::GetUserHandles

LAnnRectangle::ChangeUserHandle

LAnnRectangle::DeleteUserHandle

LAnnRectangle::EnumerateHandles

LAnnRectangle::EnumHandleCallBack

LAnnRectangle::GetRotateAngle

LAnnRectangle::GetFixed

LAnnRectangle::SetFixed

LAnnRectangle::PushFixedState

LAnnRectangle::PopFixedState

LAnnRectangle::IsFixedInRect

LAnnRTF

LAnnRTF::LAnnRTF

LAnnRTF::~LAnnRTF

LAnnRTF::Create

LAnnRTF::AddUserHandle

LAnnRTF::GetUserHandle

LAnnRTF::GetUserHandles

LAnnRTF::ChangeUserHandle

LAnnRTF::DeleteUserHandle

LAnnRTF::EnumerateHandles

LAnnRTF::EnumHandleCallBack

LAnnRTF::GetFixed

LAnnRTF::SetFixed

LAnnRTF::PushFixedState

LAnnRTF::PopFixedState

LAnnRTF::IsFixedInRect

LAnnRTF::SetTextRTF

LAnnRTF::GetTextRTF

LAnnRTF::GetText

LAnnRTF::GetTextLen

LAnnRTF::SetText

LAnnRuler

LAnnRuler::AddUserHandle

LAnnRuler::GetUserHandle

LAnnRuler::GetUserHandles

LAnnRuler::ChangeUserHandle

LAnnRuler::DeleteUserHandle

LAnnRuler::EnumerateHandles

LAnnRuler::EnumHandleCallBack

LAnnRuler::GetRotateAngle

LAnnRuler::GetFixed

LAnnRuler::SetFixed

LAnnRuler::PushFixedState

LAnnRuler::PopFixedState

LAnnRuler::IsFixedInRect

LAnnRuler::GetTicMarkLength

LAnnRuler::SetTicMarkLength

LAnnRuler::GetDistance2

LAnnStamp

LAnnStamp::GetSecondaryMetafile

LAnnStamp::AddUserHandle

LAnnStamp::GetUserHandle

LAnnStamp::GetUserHandles

LAnnStamp::ChangeUserHandle

LAnnStamp::DeleteUserHandle

LAnnStamp::EnumerateHandles

LAnnStamp::EnumHandleCallBack

LAnnStamp::GetRotateAngle

LAnnStamp::GetFixed

LAnnStamp::SetFixed

LAnnStamp::PushFixedState

LAnnStamp::PopFixedState

LAnnStamp::IsFixedInRect

LAnnToolBar

LAnnToolBar::AddUserHandle

LAnnToolBar::GetUserHandle

LAnnToolBar::GetUserHandles

LAnnToolBar::ChangeUserHandle

LAnnToolBar::DeleteUserHandle

LAnnToolBar::EnumerateHandles

LAnnToolBar::EnumHandleCallBack

LAnnText

LAnnText::AddUserHandle

LAnnText::GetUserHandle

LAnnText::GetUserHandles

LAnnText::ChangeUserHandle

LAnnText::DeleteUserHandle

LAnnText::EnumerateHandles

LAnnText::EnumHandleCallBack

LAnnText::GetRotateAngle

LAnnText::GetTextAlign

LAnnText::SetTextAlign

LAnnText::GetFixed

LAnnText::SetFixed

LAnnText::PushFixedState

LAnnText::PopFixedState

LAnnText::IsFixedInRect

LAnnTextPointer

LAnnTextPointer::LAnnTextPointer

LAnnTextPointer::~LAnnTextPointer

LAnnTextPointer::Create

LAnnTextPointer::AddUserHandle

LAnnTextPointer::GetUserHandle

LAnnTextPointer::GetUserHandles

LAnnTextPointer::ChangeUserHandle

LAnnTextPointer::DeleteUserHandle

LAnnTextPointer::EnumerateHandles

LAnnTextPointer::EnumHandleCallBack

LAnnTextPointer::GetFixed

LAnnTextPointer::SetFixed

LAnnTextPointer::PushFixedState

LAnnTextPointer::PopFixedState

LAnnTextPointer::IsFixedInRect

LAnnTextPointer::GetRotateAngle

LAnnTextPointer::GetTextAlign

LAnnTextPointer::SetTextAlign

LAnnTextPointer::SetTextRotate

LAnnTextPointer::GetTextRotate

LAnnTextPointer::SetTextPointerFixed

LAnnTextPointer::GetTextPointerFixed

LAnnVideo

LAnnVideo::AddUserHandle

LAnnVideo::GetUserHandle

LAnnVideo::GetUserHandles

LAnnVideo::ChangeUserHandle

LAnnVideo::DeleteUserHandle

LAnnVideo::EnumerateHandles

LAnnVideo::EnumHandleCallBack

LAnnVideo::GetRotateAngle

LAnnVideo::GetFixed

LAnnVideo::SetFixed

LAnnVideo::PushFixedState

LAnnVideo::PopFixedState

LAnnVideo::IsFixedInRect

LBase

LBase::IsOverlayCallBackEnabled

LBase::EnableOverlayCallBack

LBase::OverlayCallBack

LBitmapBase

LBitmapBase::Underlay

LBitmapBase::FlipViewPerspective

LBitmapBase::ReverseViewPerspective

LBitmapBase::ConvertFromEMF

LBitmapBase::ConvertFromWMF

LBitmapBase::ConvertToEMF

LBitmapBase::ConvertToWMF

LBitmapBase::CombineBitmapWarp

LBitmap

LBitmap::AdaptiveContrast

LBitmap::Aging

LBitmap::ApplyMathLogic

LBitmap::ColorIntensityBalance

LBitmap::ColorizeGray

LBitmap::ContBrightInt

LBitmap::ConvertSignedToUnsigned

LBitmap::ConvertUnsignedToSigned

LBitmap::DiceEffect

LBitmap::DigitalSubtract

LBitmap::DynamicBinary

LBitmap::EdgeDetectEffect

LBitmap::FunctionalLight

LBitmap::MultiScaleEnhancementBitmap

LBitmap::PuzzleEffect

LBitmap::RingEffect

LBitmap::SelectData

LBitmap::ShiftData

LBitmap::TextureAlphaBlend

LBitmap::AddShadow

LBitmap::AllocFTArray

LBitmap::ChangeHueSatIntBitmap

LBitmap::ColorReplace

LBitmap::ColorThreshold

LBitmap::DFT

LBitmap::DirectionEdgeStatistical

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FTDisplay

LBitmap::FrqFilter

LBitmap::FrqFilterMask

LBitmap::GetStatisticsInfo

LBitmap::GetFeretsDiameter

LBitmap::GetObjectInfo

LBitmap::GetRgnContourPoints

LBitmap::GetRgnPerimeterLength

LBitmap::MathFunction

LBitmap::RevEffect

LBitmap::Segment

LBitmap::SubtractBackground

LBitmap::UserFilter

LBitmap::GetLinearVOILUT

LBitmap::CountLUTColors

LBitmap::SetOverlay

LBitmap::GetOverlay

LBitmap::SetOverlayAttributes

LBitmap::GetOverlayAttributes

LBitmap::UpdateOverlayBits

LBitmap::GetOverlayCount

LBitmap::Scramble

LBitmap::ApplyModalityLUT

LBitmap::ApplyLinearModalityLUT

LBitmap::ApplyVOILUT

LBitmap::ApplyLinearVOILUT

LBitmap::RemapHue

LBitmapWindow

LBitmapWindow::MagGlassCallBack

LBitmapWindow::EnableDoubleBuffer

LBitmapWindow::IsDoubleBufferEnabled

LBitmapRgn

LBitmapRgn::HolesRemovalRgn

LBitmapRgn::SetRgnBorder

LChange

LChange::ChangeFromWMF

LChange::ChangeFromEMF

LChange::ChangeToEMF

LChange::ChangeToWMF

LDoubleBuffer

LDoubleBuffer::LDoubleBuffer

LDoubleBuffer::~LDoubleBuffer

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

LDoubleBuffer::IsDoubleBufferEnabled

LFile

LFile::CreateThumbnail

LFile::CreateThumbnailCallBack

LFileSettings

LFileSettings::GetDJVOptions

LFileSettings::SetDJVOptions

LFileSettings::GetPDFOptions

LFileSettings::SetPDFOptions

LFileSettings::GetPLTOptions

LFileSettings::GetPTKOptions

LFileSettings::SetPTKOptions

LFileSettings::SetAutoCADFilesColorScheme

LMemoryFile

LMemoryFile::SetMemoryThresholds

LMemoryFile::GetMemoryThresholds

LMemoryFile::GetBitmapMemoryInfo

LMemoryFile::SetBitmapMemoryInfo

LPaint

LPaint::PaintDCOverlay

LScreenCapture

LScreenCapture::ScreenCaptureHelpCallBack

LScreenCapture::GetCaptureOption

LScreenCapture::SetCaptureOption


Changes from Version 12.1 to Version 13

Please note that Version 13 will be the last full upgrade for LEADTOOLS Class Library.

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

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.

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

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

LAnnotation::GetBoundingRect takes 1 new parameter.

LAnnotation::GetName (takes 2 new parameters) has been removed

LAnnotation::SetName (takes 2 new parameters) has been removed

LAnnotation::GetRect takes 1 new parameter.

LAnnContainer::Save takes 1 new parameter.

LAnnContainer::SaveMemory takes 1 new parameter.

LAnnContainer::SaveOffset takes 1 new parameter.

LBaseFile::GetDefaultLoadFileOption takes 1 new parameter.

LBaseFile::GetDefaultSaveFileOption takes 1 new parameter.

LBitmapBase::Allocate supports a new memory type flag.

LBitmap::GetHistogram takes 1 new parameter and supports 12 and 16-bit grayscale images.

LBitmap::Halftone takes 1 new parameter and supports 12 and 16-bit grayscale images.

LBitmap::HistoEqualize takes 1 new parameter.

LBitmap::MedianFilter supports 12 and 16-bit grayscale images.

LBitmap::MaxFilter supports 12 and 16-bit grayscale images.

LBitmap::MinFilter supports 12 and 16-bit grayscale images.

LBitmap::RemapIntensity takes 1 new parameter.

LFile::LoadFile supports a new flag.

LFile::LoadOffset supports a new flag.

LFile::LoadTile supports a new flag.

The following functions have been removed:

LAnnStamp::GetPredefinedMetafile | This function is now inherited from the parent LAnnotation class. See LAnnotation::GetPredefinedMetafile.
LAnnStamp::SetPredefinedMetafile | This function is now inherited from the parent LAnnotation class. See LAnnotation::SetPredefinedMetafile.

Changed structures

The BITMAPHANDLE structure has changed 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. 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.

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

CURVE

EXTENSION

EXTENSIONLIST

LAYERINFO

LILDRAWITEM

MINSEGMENT (MRC module)

SEGMENTDATA (MRC module)

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

Bitmap Palette

LBitmapBase::DupPalette

LBitmapBase::SetPalette

Annotations (Document/Medical only)

LAnnContainer::DeletePage

LAnnContainer::DeletePageMemory

LAnnContainer::DeletePageOffset

LAnnContainer::FileInfo

LAnnContainer::FileInfoMemory

LAnnContainer::FileInfoOffset

LAnnFreehandHotSpot::GetMetafile

LAnnFreehandHotSpot::SetMetafile

LAnnHotSpot::GetMetafile

LAnnHotSpot::SetMetafile

LAnnotation::GetPredefinedMetafile

LAnnotation::SetPredefinedMetafile

LAnnStamp::GetMetafile

LAnnStamp::SetMetafile

EXIF Extensions

LFile::FreeExtensions

LFile::GetExtensionAudio

LFile::LoadExtensionStamp

LFile::ReadFileExtensions

Image List

LImageListControl::DrawItem

LImageListControl::GetFirstVisible

LImageListControl::GetViewSize

Image Processing

LBitmapBase::Add has been removed

LBitmapBase::AlphaBlend

LBitmapBase::CombineExt

LBitmapBase::ConvertSignedToUnsigned

LBitmapBase::CreateFadedMask

LBitmapBase::FeatherAlphaBlend

LBitmap::AddBorder

LBitmap::AddFrame

LBitmap::AntiAlias

LBitmap::BalanceColors

LBitmap::ConvertToColoredGray

LBitmap::EdgeDetector

LBitmap::GaussianFilter

LBitmap::GetFunctionalLookupTable

LBitmap::GetHistogramGray

LBitmap::GetUserLookupTable

LBitmap::GrayScaleExt

LBitmap::LineProfile

LBitmap::MotionBlur

LBitmap::PicturizeList

LBitmap::PicturizeSingle

LBitmap::RemoveRedeye

LBitmap::SwapColors

LBitmap::UnsharpMask

ISIS

LIsis::GetTagASCII

LIsis::GetTagASCIIChoice

LIsis::GetTagLongChoice

LIsis::GetTagShortChoice

LIsis::SetTagASCII

Magnifying Glass

LBitmapWindow::IsToolTypeMagGlass

Mixed Raster Content Module

LSegment::MrcDeleteSegment

LSegment::MrcEndBitmapSegmentation

LSegment::MrcEnumSegments

LSegment::MrcEnumSegmentsCallBack

LSegment::MrcGetPagesCount

LSegment::MrcLoadBitmap

LSegment::MrcSaveBitmap

LSegment::MrcSaveBitmapT44

LSegment::MrcSegmentBitmap

LSegment::MrcSegmentBitmapCallBack

LSegment::MrcSetNewStripe

LSegment::MrcSetStripeMaxHeight

LSegment::MrcSetStripeSegment

LSegment::MrcStartBitmapSegmentation

LSegment::MrcUpdateSegmentData

PSD Layers

LFile::LoadLayer

LFile::SaveBitmapWithLayers

Saving Buffers

LMemoryFile::SaveBitmapBuffer

LMemoryFile::SaveFileBuffer

LMemoryFile::SaveFileBufferCallBack

LMemoryFile::SaveFileCallBack

LMemoryFile::SaveBitmapBufferCallBack

Super Compression

LBitmapBase::ChangeCompression

LBitmapBase::IsSuperCompressed

Transforming Files

LFile::TransformFile

LEADMARKERCALLBACK

LFile::TransformFileCallBack

Miscellaneous

LBitmapBase::GetPixelData

LBitmapBase::LoadResize

LBitmapBase::PutPixelData

LBitmapRgn::CurveToBezier

LBitmapRgn::GetClipSegments

LBitmapRgn::GetClipSegmentsMax

LBitmapRgn::ResizeRgn

LBitmapRgn::SetRgnCurve

LFile::LoadBitmapResize


Changes from Version 12 to Version 12.1

Version 12.1 of the LEADTOOLS Class Library 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 can now convert from V4 and V5 DIBs.

DICOM now supports Structured IODs.

LEADTOOLS can now convert from JPEG compressed DIBs.

LEADTOOLS can now convert from RLE4 and RLE8 compressed DIBs.

The rest of this topic lists the new functions included in version 12.1, by class:

LFileSettings

LFileSettings::GetDefaultJ2KOptions

LFileSettings::GetJ2KOptions

LFileSettings::SetJ2KOptions


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.

The LEADTOOLS Multimedia toolkits currently include many of the functions documented in the Ltnetlibn.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 Ltnetlibn.chm help file will only be available in the LEADTOOLS Internet Imaging toolkits.

Changed Functions

The following functions have changed since version 11.5:

LAnimationWindow::Load (takes another parameter)

LBitmapBase::Load (takes another parameter)

LBitmapList::Load (takes another parameter)

LBitmapWindow::Load (takes another parameter)

LFile::LoadBitmap (takes another parameter)

LFile::LoadBitmapList (takes another parameter)

LFile::LoadFile (takes another parameter)

LFile::LoadTile (takes another parameter)

LFile::LoadOffset (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 section lists the new functions included in version 12:

LBitmap::BorderRemove

LBitmap::BorderRemoveCallBack

LBitmap::DotRemove

LBitmap::DotRemoveCallBack

LBitmap::HolePunchRemove

LBitmap::HolePunchRemoveCallBack

LBitmap::InvertedText

LBitmap::InvertedTextCallBack

LBitmap::LineRemove

LBitmap::LineRemoveCallBack

LBitmap::Smooth

LBitmap::SmoothCallBack

LPaint::ColorRgn

LBitmapRgn::SetRgnMagicWand

LBitmapWindow::GetMagGlassOptions

LBitmapWindow::SetMagGlassOptions


Changes from Version 10 to Version 11

Changes from Version 10 to Version 11 (11.5)

Version 11.5 of the LEADTOOLS Class Library has changed from version 10 as follows:

The LBitmap::Picturize function now has three new flag values for controlling the behavior of the function. (11.5)

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 Imaging 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 LBitmapBase::Rotate function support interpolation while rotating certain images. (11.5)

New flags for the LBitmapBase::SetDisplayMode function support interpolation while painting. (11.5)

DICOM Network Communication for Message Exchange is now supported. (Medical Imaging 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 Specialty Editions toolkits only)

LEADTOOLS now supports a VectorWindow class that provides a full windowed control, capable of displaying vector images. (11.5) (Selected products only)

LEADTOOLS now supports a Multimedia class (LMultimedia), a Multimedia Internet class (LInet) and a Multimedia Capture class (LMMCapture) that provide support for the LEADTOOLS Multimedia features. (11.5) (Selected products only)

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

(Specialty Editions only) Now supports the following new objects:

ANNOBJECT_CROSSPRODUCT

ANNOBJECT_POINT

ANNOBJECT_PROTRACTOR

ANNOBJECT_VIDEO

ANNOBJECT_PUSHPIN

ANNOBJECT_FREEHANDHOTSPOT

(Specialty Editions only) Annotation Automation menu items are fully customizable.

(Specialty Editions only) Annotation Automation toolbar is fully customizable.

(Specialty Editions 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_INTEGRAPH_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 Class Library now supports MPEG-2.

Changed or removed functions by class

LAnnotation:

The following take one extra parameter:

CopyToClipboard

CutToClipboard

SetVisible

The following were moved from PROTECTED to PUBLIC. Also, these were removed from the LAnnXXX classes:

IsFontBold

IsFontItalic

GetFontName

GetFontNameLen

GetFontSize

IsFontStrikeThrough

IsFontUnderline

SetFontBold

SetFontItalic

SetFontName

SetFontSize

SetFontStrikeThrough

SetFontUnderline

GetForeColor

SetForeColor

GetBackColor

SetBackColor

GetFillMode

SetFillMode

LAnnAutomation

GetDistance (added two arguments)

LAnnContainer

Enumerate (takes one new parameter)

LAnnRuler

GetDistance (takes two new parameters)

LBitmapBase

LBitmapBase::Resample has been removed

LBitmapBase::RotateFine has been removed

LBitmapBase::Rotate takes one new argument

LDialog

The following functions were removed:

GetSaveFormatFlags

SetSaveFormatFlags

DoModalFileSave (takes two new arguments)

DialogHelpCallBack (takes one extra parameter)

LDicom

The following functions now take an extra parameter:

LDicomDS::GetChildElement (refer to Ltdicwrp.chm)

LDicomDS::GetFirstElement (refer to Ltdicwrp.chm)

LDicomDS::GetLastElement (refer to Ltdicwrp.chm)

LDicomDS::GetPrevElement (refer to Ltdicwrp.chm)

LDicomDS::GetNextElement (refer to Ltdicwrp.chm)

LFileSettings

LFileSettings::GetExtFileOption has been removed

LFileSettings::SetExtFileOption has been removed

LSettings

LSettings::SetDimension renamed to SetLoadResolution

LSettings::GetDimension renamed to GetLoadResolution

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, along with L_GetExtFileOption and L_SetExtFileOption, which set global settings for the toolkit. Now, the following functions take an optional LOADFILEOPTION structure:

LAnnContainer::LoadOffset

LBitmapBase::Load

LBitmapWindow::Load

LBitmapList::Load

LFile::ReadLoadResolutions

LFile::ReadFileTransforms

LFile::StartFeedLoad

LFile::GetInfo

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadStamp

LFile::ReadTag

LFile::FileConvert

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadTag

LAnnotationWindow::AnnLoad

LAnnContainer::Load

And the following functions take an optional SAVEFILEOPTION structure:

LBitmapBase::Save

LBitmapList::Save

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LFile::SaveFile

LFile::SaveOffset

LFile::SaveTile

LFile::WriteComment

LFile::WriteStamp

LFile::FileConvert

LMemoryFile::SaveBitmap

LMemoryFile::StartCompressBuffer

LAnimationWindow::Load

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

The TWAINPROPERTIES structure now has four new members:

lSize

nDuplex

nEnableDuplex

dwReserved

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 or 11.5, by class.

LAnnotation

SetAutoMenuItemEnable

GetAutoMenuItemEnable

SetAutoMenuState

GetAutoMenuState

SetUser

Group

Ungroup

GetRgnHandle

GetArea

SetAutoDefaults

SetAutoDefaults

SetName has been removed

GetName has been removed

LAnnAutomation

GetDistance (added two arguments)

SetAutoOptions

GetAutoOptions

GetUndoDepth

SetTransparentColor

GetTransparentColor

LBitmap

LBitmap::ContourFilter

LBitmap::WindowLevelFillLUT

LAnnContainer

SetTransparentColor

GetObjectFromTag

LAnnStamp

SetMetafile

GetMetafile

SetPredefinedMetafile has been removed

GetPredefinedMetafile has been removed

SetTransparentColor

GetTransparentColor

LAnnPolyLine

SetNodes

GetNodes

LAnnPolygon

SetNodes

GetNodes

LAnnRuler

SetShowFlags

GetShowFlags

SetPoints

GetPoints

LAnnToolBar

SetToolBarButtons

GetToolBarButtons

FreeToolBarButtons

GetToolBarInfo

SetToolBarColumns

SetToolBarRows

LAnnPushPin

LAnnPushPin::Create

LAnnPushPin::GetBitmap

LAnnPushPin::GetSecondaryBitmap

LAnnPushPin::SetBitmap

LAnnPushPin::SetSecondaryBitmap

LAnnVideo

LAnnVideo::Create

LAnnVideo::GetText

LAnnVideo::GetTextLen

LAnnVideo::SetText

LAnnProtractor

LAnnProtractor::Create

LAnnProtractor::GetProtractorOptions

LAnnProtractor::SetProtractorOptions

LAnnProtractor::GetAngle

LAnnProtractor::GetDistance

LAnnProtractor::GetPoints

LAnnProtractor::GetPointCount

LAnnProtractor::SetPoints

LAnnCrossProduct

LAnnCrossProduct::Create

LAnnCrossProduct::GetDistance

LAnnCrossProduct::GetLineStyle

LAnnCrossProduct::GetLineWidth

LAnnCrossProduct::GetPointCount

LAnnCrossProduct::GetPoints

LAnnCrossProduct::SetLineStyle

LAnnCrossProduct::SetLineWidth

LAnnCrossProduct::SetPoints

LAnnFreehandHotSpot

LAnnFreehandHotSpot::Create

LAnnPoint

LAnnPoint::Create

LAnnPoint::GetBitmap

LAnnPoint::GetPoints

LAnnPoint::GetTransparent

LAnnPoint::GetTransparentColor

LAnnPoint::SetBitmap

LAnnPoint::SetPoints

LAnnPoint::SetTransparent

LAnnPoint::SetTransparentColor

LBaseFile

LBaseFile::GetDefaultLoadFileOption

LBaseFile::GetDefaultSaveFileOption

LDialog

GetStringLen has been removed

GetString has been removed

SetString has been removed

SetFont has been removed

GetContourParameters has been removed

SetContourParameters has been removed

DoModalGetContourFilter has been removed

LDicomAssociate (11.5)

LDicomAssociate::LDicomAssociate (Refer to Ltdicwrp.chm)

LDicomAssociate::~LDicomAssociate (Refer to Ltdicwrp.chm)

LDicomAssociate::AddPresentation (Refer to Ltdicwrp.chm)

LDicomAssociate::AddTransfer (Refer to Ltdicwrp.chm)

LDicomAssociate::AddUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::Default (Refer to Ltdicwrp.chm)

LDicomAssociate::DelPresentation (Refer to Ltdicwrp.chm)

LDicomAssociate::DelTransfer (Refer to Ltdicwrp.chm)

LDicomAssociate::DelUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::FindAbstract (Refer to Ltdicwrp.chm)

LDicomAssociate::GetAbstract (Refer to Ltdicwrp.chm)

LDicomAssociate::GetApplication (Refer to Ltdicwrp.chm)

LDicomAssociate::GetCalled (Refer to Ltdicwrp.chm)

LDicomAssociate::GetCalling (Refer to Ltdicwrp.chm)

LDicomAssociate::GetDataUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::GetExtended (Refer to Ltdicwrp.chm)

LDicomAssociate::GetImplementClass (Refer to Ltdicwrp.chm)

LDicomAssociate::GetImplementVersion (Refer to Ltdicwrp.chm)

LDicomAssociate::GetInvokedOperations (Refer to Ltdicwrp.chm)

LDicomAssociate::GetLengthExtended (Refer to Ltdicwrp.chm)

LDicomAssociate::GetLengthUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::GetMaxLength (Refer to Ltdicwrp.chm)

LDicomAssociate::GetPerformedOperations (Refer to Ltdicwrp.chm)

LDicomAssociate::GetPresentation (Refer to Ltdicwrp.chm)

LDicomAssociate::GetPresentationCount (Refer to Ltdicwrp.chm)

LDicomAssociate::GetProviderRole (Refer to Ltdicwrp.chm)

LDicomAssociate::GetResult (Refer to Ltdicwrp.chm)

LDicomAssociate::GetTransfer (Refer to Ltdicwrp.chm)

LDicomAssociate::GetTransferCount (Refer to Ltdicwrp.chm)

LDicomAssociate::GetTypeUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::GetUserInfoCount (Refer to Ltdicwrp.chm)

LDicomAssociate::GetUserRole (Refer to Ltdicwrp.chm)

LDicomAssociate::GetVersion (Refer to Ltdicwrp.chm)

LDicomAssociate::IsAsyncOperations (Refer to Ltdicwrp.chm)

LDicomAssociate::IsImplementClass (Refer to Ltdicwrp.chm)

LDicomAssociate::IsImplementVersion (Refer to Ltdicwrp.chm)

LDicomAssociate::IsMaxLength (Refer to Ltdicwrp.chm)

LDicomAssociate::IsRequest (Refer to Ltdicwrp.chm)

LDicomAssociate::IsRoleSelect (Refer to Ltdicwrp.chm)

LDicomAssociate::Reset (Refer to Ltdicwrp.chm)

LDicomAssociate::SetAbstract (Refer to Ltdicwrp.chm)

LDicomAssociate::SetApplication (Refer to Ltdicwrp.chm)

LDicomAssociate::SetAsyncOperations (Refer to Ltdicwrp.chm)

LDicomAssociate::SetCalled (Refer to Ltdicwrp.chm)

LDicomAssociate::SetCalling (Refer to Ltdicwrp.chm)

LDicomAssociate::SetExtended (Refer to Ltdicwrp.chm)

LDicomAssociate::SetImplementClass (Refer to Ltdicwrp.chm)

LDicomAssociate::SetImplementVersion (Refer to Ltdicwrp.chm)

LDicomAssociate::SetMaxLength (Refer to Ltdicwrp.chm)

LDicomAssociate::SetPresentation (Refer to Ltdicwrp.chm)

LDicomAssociate::SetRequest (Refer to Ltdicwrp.chm)

LDicomAssociate::SetResult (Refer to Ltdicwrp.chm)

LDicomAssociate::SetRoleSelect (Refer to Ltdicwrp.chm)

LDicomAssociate::SetTransfer (Refer to Ltdicwrp.chm)

LDicomAssociate::SetUserInfo (Refer to Ltdicwrp.chm)

LDicomAssociate::SetVersion (Refer to Ltdicwrp.chm)

LDicomDS

LDicomDS::DeleteKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::FindFirstKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::FindLastKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::FindNextKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::FindPrevKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetChildKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetFirstKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetLastKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetNextKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetParentKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetPrevKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetRootKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetValueKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::InsertKey (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::CopyDS (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::GetInfoCS (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::InitCS (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::SetDebugDS (Refer to Ltdicwrp.chm) (11.5)

LDicomDS::IsVolatileElement (refer to Ltdicwrp.chm)

LDicomNet (11.5)

LDicomNet::LDicomNet (Refer to Ltdicwrp.chm)

LDicomNet::~LDicomNet (Refer to Ltdicwrp.chm)

LDicomNet::Accept (Refer to Ltdicwrp.chm)

LDicomNet::Close (Refer to Ltdicwrp.chm)

LDicomNet::Connect (Refer to Ltdicwrp.chm)

LDicomNet::GetAssociate (Refer to Ltdicwrp.chm)

LDicomNet::GetClient (Refer to Ltdicwrp.chm)

LDicomNet::GetClientCount (Refer to Ltdicwrp.chm)

LDicomNet::GetHostInfo (Refer to Ltdicwrp.chm)

LDicomNet::GetPeerInfo (Refer to Ltdicwrp.chm)

LDicomNet::GetQueueSend (Refer to Ltdicwrp.chm)

LDicomNet::GetServer (Refer to Ltdicwrp.chm)

LDicomNet::IsActivated (Refer to Ltdicwrp.chm)

LDicomNet::IsAssociated (Refer to Ltdicwrp.chm)

LDicomNet::IsConnected (Refer to Ltdicwrp.chm)

LDicomNet::Listen (Refer to Ltdicwrp.chm)

LDicomNet::SendAbort (Refer to Ltdicwrp.chm)

LDicomNet::SendAssociateAccept (Refer to Ltdicwrp.chm)

LDicomNet::SendAssociateReject (Refer to Ltdicwrp.chm)

LDicomNet::SendAssociateRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCCancelRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCEchoRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCEchoResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendCFindRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCFindResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendCGetRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCGetResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendCMoveRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCMoveResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendCStoreRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendCStoreResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendData (Refer to Ltdicwrp.chm)

LDicomNet::SendNActionRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNActionResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendNCreateRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNCreateResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendNDeleteRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNDeleteResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendNGetRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNGetResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendNReportRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNReportResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendNSetRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendNSetResponse (Refer to Ltdicwrp.chm)

LDicomNet::SendReleaseRequest (Refer to Ltdicwrp.chm)

LDicomNet::SendReleaseResponse (Refer to Ltdicwrp.chm)

LDicomNet::ShutDown (Refer to Ltdicwrp.chm)

LDicomNet::StartUp (Refer to Ltdicwrp.chm)

LFile

LFile::BrowseDir

LFile::BrowseDirCallBack

LFileSettings

LFileSettings::SetViewport2D

LFileSettings::GetViewport2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewMode2D

LImageListControl

LImageListControl::LImageListControl

LImageListControl::~LImageListControl

LImageListControl::Clear

LImageListControl::CreateControl

LImageListControl::EnableKeyboard

LImageListControl::EnsureVisible

LImageListControl::GetBackColor

LImageListControl::GetBorderColor

LImageListControl::GetColumnCount

LImageListControl::GetItem

LImageListControl::GetItemCount

LImageListControl::GetItemOptions

LImageListControl::GetRowCount

LImageListControl::GetScrollStyle

LImageListControl::GetSelectCount

LImageListControl::GetSelectedItems

LImageListControl::GetSelectionOptions

LImageListControl::HitTest

LImageListControl::Insert

LImageListControl::ItemSelected

ImageListControl::m_hWnd

LImageListControl::MsgProcCallBack

LImageListControl::Remove

LImageListControl::ScrollItems

LImageListControl::SelectAll

LImageListControl::SetBackColor

LImageListControl::SetBorderColor

LImageListControl::SetItemOptions

LImageListControl::SetScrollStyle

LImageListControl::SetSelectionOptions

LImageListControl::Sort

LImageListControl::Update

LInet (11.5)

LInet::LInet (Refer to Ltvidwrp.chm)

LInet::~LInet (Refer to Ltvidwrp.chm)

LInet::AcceptConnect (Refer to Ltvidwrp.chm)

LInet::AddWndItem (Refer to Ltvidwrp.chm)

LInet::ClearQueue (Refer to Ltvidwrp.chm)

LInet::Close (Refer to Ltvidwrp.chm)

LInet::CloseAll (Refer to Ltvidwrp.chm)

LInet::Connect (Refer to Ltvidwrp.chm)

LInet::CreateWnd (Refer to Ltvidwrp.chm)

LInet::EnableAutoProcess (Refer to Ltvidwrp.chm)

LInet::EnableAutoWnd (Refer to Ltvidwrp.chm)

LInet::ExistsItem (Refer to Ltvidwrp.chm)

LInet::ExpandWnd (Refer to Ltvidwrp.chm)

LInet::GetFirstItem (Refer to Ltvidwrp.chm)

LInet::GetHandle (Refer to Ltvidwrp.chm)

LInet::GetHostName (Refer to Ltvidwrp.chm)

LInet::GetItem (Refer to Ltvidwrp.chm)

LInet::GetItemsCount (Refer to Ltvidwrp.chm)

LInet::GetLastItem (Refer to Ltvidwrp.chm)

LInet::GetNextItem (Refer to Ltvidwrp.chm)

LInet::GetPrevItem (Refer to Ltvidwrp.chm)

LInet::GetQueueSize (Refer to Ltvidwrp.chm)

LInet::IsAutoProcessEnabled (Refer to Ltvidwrp.chm)

LInet::IsAutoWndEnabled (Refer to Ltvidwrp.chm)

LInet::IsValid (Refer to Ltvidwrp.chm)

LInet::IsWndItem (Refer to Ltvidwrp.chm)

LInet::m_pUserDataEx (Refer to Ltvidwrp.chm)

LInet::OnClose (Refer to Ltvidwrp.chm)

LInet::OnConnect (Refer to Ltvidwrp.chm)

LInet::OnConnectRequest (Refer to Ltvidwrp.chm)

LInet::OnDataReady (Refer to Ltvidwrp.chm)

LInet::OnDataReceiving (Refer to Ltvidwrp.chm)

LInet::OnDataSending (Refer to Ltvidwrp.chm)

LInet::OnDataSent (Refer to Ltvidwrp.chm)

LInet::OnDataStart (Refer to Ltvidwrp.chm)

LInet::OnImageReceived (Refer to Ltvidwrp.chm)

LInet::OnMMediaReceived (Refer to Ltvidwrp.chm)

LInet::OnSoundReceived (Refer to Ltvidwrp.chm)

LInet::OnUser1Received (Refer to Ltvidwrp.chm)

LInet::OnUser2Received (Refer to Ltvidwrp.chm)

LInet::OnUser3Received (Refer to Ltvidwrp.chm)

LInet::OnUser4Received (Refer to Ltvidwrp.chm)

LInet::operator = (Refer to Ltvidwrp.chm)

LInet::ReadData (Refer to Ltvidwrp.chm)

LInet::RemoveAllWndItems (Refer to Ltvidwrp.chm)

LInet::RemoveWndItem (Refer to Ltvidwrp.chm)

LInet::SendBitmap (Refer to Ltvidwrp.chm)

LInet::SendData (Refer to Ltvidwrp.chm)

LInet::SendMMData (Refer to Ltvidwrp.chm)

LInet::SendRawData (Refer to Ltvidwrp.chm)

LInet::SendSound (Refer to Ltvidwrp.chm)

LInet::ServerInit (Refer to Ltvidwrp.chm)

LInet::ServerShutDown (Refer to Ltvidwrp.chm)

LInet::SetImageWindow (Refer to Ltvidwrp.chm)

LInet::ShutDown (Refer to Ltvidwrp.chm)

LInet::StartUp (Refer to Ltvidwrp.chm)

LMMCapture (11.5)

LMMCapture::LMMCapture (Refer to Ltvidwrp.chm)

LMMCapture::~LMMCapture (Refer to Ltvidwrp.chm)

LMMCapture::AudioDataCallBack (Refer to Ltvidwrp.chm)

LMMCapture::ChooseAudFormat (Refer to Ltvidwrp.chm)

LMMCapture::CloseRecord (Refer to Ltvidwrp.chm)

LMMCapture::Connect (Refer to Ltvidwrp.chm)

LMMCapture::CopyFileAs (Refer to Ltvidwrp.chm)

LMMCapture::CopyToClipboard (Refer to Ltvidwrp.chm)

LMMCapture::CreateWin (Refer to Ltvidwrp.chm)

LMMCapture::DestroyWin (Refer to Ltvidwrp.chm)

LMMCapture::Disconnect (Refer to Ltvidwrp.chm)

LMMCapture::DisplayDlg (Refer to Ltvidwrp.chm)

LMMCapture::EnableMMCallbacks (Refer to Ltvidwrp.chm)

LMMCapture::EnableStatusCallback (Refer to Ltvidwrp.chm)

LMMCapture::EnumDriverCallBack (Refer to Ltvidwrp.chm)

LMMCapture::EnumDrivers (Refer to Ltvidwrp.chm)

LMMCapture::EnumMixerCallBack (Refer to Ltvidwrp.chm)

LMMCapture::EnumMixerLines (Refer to Ltvidwrp.chm)

LMMCapture::FeedResetSound (Refer to Ltvidwrp.chm)

LMMCapture::FeedSound (Refer to Ltvidwrp.chm)

LMMCapture::FeedSoundCallBack (Refer to Ltvidwrp.chm)

LMMCapture::GetAudFormat (Refer to Ltvidwrp.chm)

LMMCapture::GetAudFromID (Refer to Ltvidwrp.chm)

LMMCapture::GetAudioPeak (Refer to Ltvidwrp.chm)

LMMCapture::GetDefaultAudFormat (Refer to Ltvidwrp.chm)

LMMCapture::GetFeedSoundHandle (Refer to Ltvidwrp.chm)

LMMCapture::GetFrame (Refer to Ltvidwrp.chm)

LMMCapture::GetHwnd (Refer to Ltvidwrp.chm)

LMMCapture::GetIDFromAud (Refer to Ltvidwrp.chm)

LMMCapture::GetMetrics (Refer to Ltvidwrp.chm)

LMMCapture::GetMute (Refer to Ltvidwrp.chm)

LMMCapture::GetOptions (Refer to Ltvidwrp.chm)

LMMCapture::GetRecordSoundHandle (Refer to Ltvidwrp.chm)

LMMCapture::GetSelect (Refer to Ltvidwrp.chm)

LMMCapture::GetStatus (Refer to Ltvidwrp.chm)

LMMCapture::GetVidFormat (Refer to Ltvidwrp.chm)

LMMCapture::GetVolume (Refer to Ltvidwrp.chm)

LMMCapture::IsOptionAvailable (Refer to Ltvidwrp.chm)

LMMCapture::IsValid (Refer to Ltvidwrp.chm)

LMMCapture::OpenRecord (Refer to Ltvidwrp.chm)

LMMCapture::PauseFeedSound (Refer to Ltvidwrp.chm)

LMMCapture::RecordCallBack (Refer to Ltvidwrp.chm)

LMMCapture::SaveFrame (Refer to Ltvidwrp.chm)

LMMCapture::SetAudFormat (Refer to Ltvidwrp.chm)

LMMCapture::SetMute (Refer to Ltvidwrp.chm)

LMMCapture::SetOptions (Refer to Ltvidwrp.chm)

LMMCapture::SetOverlay (Refer to Ltvidwrp.chm)

LMMCapture::SetPreview (Refer to Ltvidwrp.chm)

LMMCapture::SetSelect (Refer to Ltvidwrp.chm)

LMMCapture::SetVidFormat (Refer to Ltvidwrp.chm)

LMMCapture::SetVidOffset (Refer to Ltvidwrp.chm)

LMMCapture::SetVolume (Refer to Ltvidwrp.chm)

LMMCapture::SetWorkFile (Refer to Ltvidwrp.chm)

LMMCapture::SingleFrame (Refer to Ltvidwrp.chm)

LMMCapture::StartCapture (Refer to Ltvidwrp.chm)

LMMCapture::StartFeedSound (Refer to Ltvidwrp.chm)

LMMCapture::StartRecord (Refer to Ltvidwrp.chm)

LMMCapture::StartSingleFrame (Refer to Ltvidwrp.chm)

LMMCapture::StatusCallBack (Refer to Ltvidwrp.chm)

LMMCapture::StopCapture (Refer to Ltvidwrp.chm)

LMMCapture::StopFeedSound (Refer to Ltvidwrp.chm)

LMMCapture::StopRecord (Refer to Ltvidwrp.chm)

LMMCapture::StopSingleFrame (Refer to Ltvidwrp.chm)

LMMCapture::VideoDataCallBack (Refer to Ltvidwrp.chm)

LMultimedia (11.5)

LMultimedia::LMultimedia (Refer to Ltvidwrp.chm)

LMultimedia::~LMultimedia (Refer to Ltvidwrp.chm)

LMultimedia::AddStream (Refer to Ltvidwrp.chm)

LMultimedia::AdjustWin (Refer to Ltvidwrp.chm)

LMultimedia::ConvertFromBitmapList (Refer to Ltvidwrp.chm)

LMultimedia::ConvertTime (Refer to Ltvidwrp.chm)

LMultimedia::CopyFrames (Refer to Ltvidwrp.chm)

LMultimedia::Create (Refer to Ltvidwrp.chm)

LMultimedia::CreateWin (Refer to Ltvidwrp.chm)

LMultimedia::DeleteFrames (Refer to Ltvidwrp.chm)

LMultimedia::DeleteStream (Refer to Ltvidwrp.chm)

LMultimedia::EnableEventCallback (Refer to Ltvidwrp.chm)

LMultimedia::EnumCompressors (Refer to Ltvidwrp.chm)

LMultimedia::EnumCompressorsCallBack (Refer to Ltvidwrp.chm)

LMultimedia::EventCallBack (Refer to Ltvidwrp.chm)

LMultimedia::Free (Refer to Ltvidwrp.chm)

LMultimedia::GetBalance (Refer to Ltvidwrp.chm)

LMultimedia::GetBitmap (Refer to Ltvidwrp.chm)

LMultimedia::GetCompressionOpts (Refer to Ltvidwrp.chm)

LMultimedia::GetCurrentPos (Refer to Ltvidwrp.chm)

LMultimedia::GetEditInfo (Refer to Ltvidwrp.chm)

LMultimedia::GetHandle (Refer to Ltvidwrp.chm)

LMultimedia::GetHeight (Refer to Ltvidwrp.chm)

LMultimedia::GetLength (Refer to Ltvidwrp.chm)

LMultimedia::GetOpenMode (Refer to Ltvidwrp.chm)

LMultimedia::GetRate (Refer to Ltvidwrp.chm)

LMultimedia::GetStreamType (Refer to Ltvidwrp.chm)

LMultimedia::GetTimeFormat (Refer to Ltvidwrp.chm)

LMultimedia::GetVolume (Refer to Ltvidwrp.chm)

LMultimedia::GetWidth (Refer to Ltvidwrp.chm)

LMultimedia::Init (Refer to Ltvidwrp.chm)

LMultimedia::InsertFrame (Refer to Ltvidwrp.chm)

LMultimedia::IsAllocated (Refer to Ltvidwrp.chm)

LMultimedia::IsClipboardReady (Refer to Ltvidwrp.chm)

LMultimedia::IsPlaying (Refer to Ltvidwrp.chm)

LMultimedia::Load (Refer to Ltvidwrp.chm)

LMultimedia::LoadMemory (Refer to Ltvidwrp.chm)

LMultimedia::MarkClip (Refer to Ltvidwrp.chm)

LMultimedia::PasteFrames (Refer to Ltvidwrp.chm)

LMultimedia::Pause (Refer to Ltvidwrp.chm)

LMultimedia::Play (Refer to Ltvidwrp.chm)

LMultimedia::ReplaceFrame (Refer to Ltvidwrp.chm)

LMultimedia::Resume (Refer to Ltvidwrp.chm)

LMultimedia::SaveFile (Refer to Ltvidwrp.chm)

LMultimedia::SetActive (Refer to Ltvidwrp.chm)

LMultimedia::SetBalance (Refer to Ltvidwrp.chm)

LMultimedia::SetCompressionOpts (Refer to Ltvidwrp.chm)

LMultimedia::SetCurrentPos (Refer to Ltvidwrp.chm)

LMultimedia::SetDstRect (Refer to Ltvidwrp.chm)

LMultimedia::SetMessageWin (Refer to Ltvidwrp.chm)

LMultimedia::SetParentWin (Refer to Ltvidwrp.chm)

LMultimedia::SetPlayExt (Refer to Ltvidwrp.chm)

LMultimedia::SetRate (Refer to Ltvidwrp.chm)

LMultimedia::SetSrcRect (Refer to Ltvidwrp.chm)

LMultimedia::SetTimeFormat (Refer to Ltvidwrp.chm)

LMultimedia::SetVolume (Refer to Ltvidwrp.chm)

LMultimedia::SetWinVisible (Refer to Ltvidwrp.chm)

LMultimedia::StartRecord (Refer to Ltvidwrp.chm)

LMultimedia::Stop (Refer to Ltvidwrp.chm)

LMultimedia::StopRecord (Refer to Ltvidwrp.chm)

LVectorBase

LVectorBase::LVectorBase (refer to Ltvecwrp.chm)

LVectorBase::~LVectorBase (refer to Ltvecwrp.chm)

LVectorBase::ApplyTransformation (refer to Ltvecwrp.chm)

LVectorBase::AttachToWindow (refer to Ltvecwrp.chm)

LVectorBase::ConvertFromEMF (refer to Ltvecwrp.chm)

LVectorBase::ConvertFromWMF (refer to Ltvecwrp.chm)

LVectorBase::ConvertToEMF (refer to Ltvecwrp.chm)

LVectorBase::ConvertToWMF (refer to Ltvecwrp.chm)

LVectorBase::Copy (refer to Ltvecwrp.chm)

LVectorBase::DeleteObjects (refer to Ltvecwrp.chm)

LVectorBase::EnableAlwaysEndNotification (refer to Ltvecwrp.chm)

LVectorBase::EnableChangeNotification (refer to Ltvecwrp.chm)

LVectorBase::EnableFileName (refer to Ltvecwrp.chm)

LVectorBase::EndChanging (refer to ltvecwrp.chm)

LVectorBase::EnumObjects (refer to ltvecwrp.chm)

LVectorBase::EnumObjectsCallBack (refer to ltvecwrp.chm)

LVectorBase::EnumVertices (refer to ltvecwrp.chm)

LVectorBase::EnumVerticesCallBack (refer to ltvecwrp.chm)

LVectorBase::Free (refer to ltvecwrp.chm)

LVectorBase::GetAmbientLight (refer to ltvecwrp.chm)

LVectorBase::GetBackgroundColor (refer to ltvecwrp.chm)

LVectorBase::GetBindVerticesMode (refer to ltvecwrp.chm)

LVectorBase::GetCamera (refer to ltvecwrp.chm)

LVectorBase::GetEngine (refer to ltvecwrp.chm)

LVectorBase::GetFileName (refer to ltvecwrp.chm)

LVectorBase::GetHandle (refer to ltvecwrp.chm)

LVectorBase::GetObjectParallelogram (refer to ltvecwrp.chm)

LVectorBase::GetObjectRect (refer to ltvecwrp.chm)

LVectorBase::GetPalette (refer to ltvecwrp.chm)

LVectorBase::GetPan (refer to ltvecwrp.chm)

LVectorBase::GetPolygonMode (refer to ltvecwrp.chm)

LVectorBase::GetRotation (refer to ltvecwrp.chm)

LVectorBase::GetScale (refer to ltvecwrp.chm)

LVectorBase::GetTranslation (refer to ltvecwrp.chm)

LVectorBase::GetUseLights (refer to ltvecwrp.chm)

LVectorBase::GetViewMode (refer to ltvecwrp.chm)

LVectorBase::GetViewport (refer to ltvecwrp.chm)

LVectorBase::HitTest (refer to ltvecwrp.chm)

LVectorBase::Initialize (refer to ltvecwrp.chm)

LVectorBase::Is3D (refer to ltvecwrp.chm)

LVectorBase::IsAllocated (refer to ltvecwrp.chm)

LVectorBase::IsAlwaysEndNotification (refer to ltvecwrp.chm)

LVectorBase::IsChangeNotificationEnabled (refer to ltvecwrp.chm)

LVectorBase::IsFileNameEnabled (refer to ltvecwrp.chm)

LVectorBase::IsObjectInsideParallelogram (refer to ltvecwrp.chm)

LVectorBase::IsObjectInsideRect (refer to ltvecwrp.chm)

LVectorBase::IsObjectSelected (refer to ltvecwrp.chm)

LVectorBase::Load (refer to ltvecwrp.chm)

LVectorBase::LogicalToPhysical (refer to ltvecwrp.chm)

LVectorBase::Paint (refer to ltvecwrp.chm)

LVectorBase::Realize (refer to ltvecwrp.chm)

LVectorBase::Save (refer to ltvecwrp.chm)

LVectorBase::SelectObject (refer to ltvecwrp.chm)

LVectorBase::SetAmbientLight (refer to ltvecwrp.chm)

LVectorBase::SetBackgroundColor (refer to ltvecwrp.chm)

LVectorBase::SetBindVerticesMode (refer to ltvecwrp.chm)

LVectorBase::SetCamera (refer to ltvecwrp.chm)

LVectorBase::SetEngine (refer to ltvecwrp.chm)

LVectorBase::SetFileName (refer to ltvecwrp.chm)

LVectorBase::SetHandle (refer to ltvecwrp.chm)

LVectorBase::SetPalette (refer to ltvecwrp.chm)

LVectorBase::SetPan (refer to ltvecwrp.chm)

LVectorBase::SetPolygonMode (refer to ltvecwrp.chm)

LVectorBase::SetRotation (refer to ltvecwrp.chm)

LVectorBase::SetScale (refer to ltvecwrp.chm)

LVectorBase::SetTranslation (refer to ltvecwrp.chm)

LVectorBase::SetUseLights (refer to ltvecwrp.chm)

LVectorBase::SetViewMode (refer to ltvecwrp.chm)

LVectorBase::SetViewport (refer to ltvecwrp.chm)

LVectorBase::StartChanging (refer to ltvecwrp.chm)

LVectorFile

LVectorFile::LVectorFile (refer to ltvecwrp.chm)

LVectorFile::~LVectorFile (refer to ltvecwrp.chm)

LVectorFile::FeedLoad (refer to ltvecwrp.chm)

LVectorFile::GetFileName (refer to ltvecwrp.chm)

LVectorFile::IsValid (refer to ltvecwrp.chm)

LVectorFile::LoadFile (refer to ltvecwrp.chm)

LVectorFile::SaveFile (refer to ltvecwrp.chm)

LVectorFile::SetFileName (refer to ltvecwrp.chm)

LVectorFile::SetVector (refer to ltvecwrp.chm)

LVectorFile::StartFeedLoad (refer to ltvecwrp.chm)

LVectorFile::StopFeedLoad (refer to ltvecwrp.chm)

LVectorMemoryFile

LVectorMemoryFile::LVectorMemoryFile (refer to ltvecwrp.chm)

LVectorMemoryFile::~LVectorMemoryFile (refer to ltvecwrp.chm)

LVectorMemoryFile::IsValid (refer to ltvecwrp.chm)

LVectorMemoryFile::LoadMemory (refer to ltvecwrp.chm)

LVectorMemoryFile::SaveMemory (refer to ltvecwrp.chm)

LVectorDialog

LVectorDialog::LVectorDialog (refer to ltvecwrp.chm)

LVectorDialog::~LVectorDialog (refer to ltvecwrp.chm)

LVectorDialog::DoModalVector3DOptions (refer to ltvecwrp.chm)

LVectorDialog::DoModalVectorCamera (refer to ltvecwrp.chm)

LVectorDialog::DoModalVectorRotate (refer to ltvecwrp.chm)

LVectorDialog::DoModalVectorScale (refer to ltvecwrp.chm)

LVectorDialog::DoModalVectorTranslate (refer to ltvecwrp.chm)

LVectorDialog::EnableAutoProcess (refer to ltvecwrp.chm)

LVectorDialog::EnablePreview (refer to ltvecwrp.chm)

LVectorDialog::GetColorAmbient (refer to ltvecwrp.chm)

LVectorDialog::GetCamera (refer to ltvecwrp.chm)

LVectorDialog::GetPolygonMode (refer to ltvecwrp.chm)

LVectorDialog::GetRotation (refer to ltvecwrp.chm)

LVectorDialog::GetScale (refer to ltvecwrp.chm)

LVectorDialog::GetTranslation (refer to ltvecwrp.chm)

LVectorDialog::GetUseLights (refer to ltvecwrp.chm)

LVectorDialog::GetVector (refer to ltvecwrp.chm)

LVectorDialog::IsAutoProcessEnabled (refer to ltvecwrp.chm)

LVectorDialog::IsPreviewEnabled (refer to ltvecwrp.chm)

LVectorDialog::IsValid (refer to ltvecwrp.chm)

LVectorDialog::SetColorAmbient (refer to ltvecwrp.chm)

LVectorDialog::SetCamera (refer to ltvecwrp.chm)

LVectorDialog::SetPolygonMode (refer to ltvecwrp.chm)

LVectorDialog::SetRotation (refer to ltvecwrp.chm)

LVectorDialog::SetScale (refer to ltvecwrp.chm)

LVectorDialog::SetTranslation (refer to ltvecwrp.chm)

LVectorDialog::SetUseLights (refer to ltvecwrp.chm)

LVectorDialog::SetVector (refer to ltvecwrp.chm)

LVectorWindow (11.5)

LVectorWindow::LVectorWindow (Refer to Ltvecwrp.chm)

LVectorWindow::~LVectorWindow (Refer to Ltvecwrp.chm)

LVectorWindow::CreateWnd (Refer to Ltvecwrp.chm)

LVectorWindow::EnableAutoPaint (Refer to Ltvecwrp.chm)

LVectorWindow::EnableAutoScroll (Refer to Ltvecwrp.chm)

LVectorWindow::EnableDragAcceptFiles (Refer to Ltvecwrp.chm)

LVectorWindow::EnableKeyBoard (Refer to Ltvecwrp.chm)

LVectorWindow::EndChanging (Refer to Ltvecwrp.chm)

LVectorWindow::FitToParent (Refer to Ltvecwrp.chm)

LVectorWindow::Free (Refer to Ltvecwrp.chm)

LVectorWindow::GetBackgroundColor (Refer to Ltvecwrp.chm)

LVectorWindow::GetKeyMode (Refer to Ltvecwrp.chm)

LVectorWindow::GetScaleFactor (Refer to Ltvecwrp.chm)

LVectorWindow::GetSelectedOnly (Refer to Ltvecwrp.chm)

LVectorWindow::GetToolType (Refer to Ltvecwrp.chm)

LVectorWindow::GetVectorRect (Refer to Ltvecwrp.chm)

LVectorWindow::GetVectorVisibleRect (Refer to Ltvecwrp.chm)

LVectorWindow::GetVectorWnd (Refer to Ltvecwrp.chm)

LVectorWindow::GetZoomPercent (Refer to Ltvecwrp.chm)

LVectorWindow::IsAutoPaintEnabled (Refer to Ltvecwrp.chm)

LVectorWindow::IsAutoScrollEnabled (Refer to Ltvecwrp.chm)

LVectorWindow::IsControl (Refer to Ltvecwrp.chm)

LVectorWindow::IsDragAcceptFilesEnabled (Refer to Ltvecwrp.chm)

LVectorWindow::IsKeyBoardEnabled (Refer to Ltvecwrp.chm)

LVectorWindow::Load (Refer to Ltvecwrp.chm)

LVectorWindow::Move (Refer to Ltvecwrp.chm)

LVectorWindow::MsgProcCallBack (Refer to Ltvecwrp.chm)

LVectorWindow::OnDraw (Refer to Ltvecwrp.chm)

LVectorWindow::OnFileDropped (Refer to Ltvecwrp.chm)

LVectorWindow::OnScale (Refer to Ltvecwrp.chm)

LVectorWindow::OnZoom (Refer to Ltvecwrp.chm)

LVectorWindow::Repaint (Refer to Ltvecwrp.chm)

LVectorWindow::ScaleIn (Refer to Ltvecwrp.chm)

LVectorWindow::ScaleOut (Refer to Ltvecwrp.chm)

LVectorWindow::ScrollBy (Refer to Ltvecwrp.chm)

LVectorWindow::ScrollTo (Refer to Ltvecwrp.chm)

LVectorWindow::SelectAllObjects (Refer to Ltvecwrp.chm)

LVectorWindow::SetBackgroundColor (Refer to Ltvecwrp.chm)

LVectorWindow::SetEngine (Refer to Ltvecwrp.chm)

LVectorWindow::SetKeyMode (Refer to Ltvecwrp.chm)

LVectorWindow::SetPan (Refer to Ltvecwrp.chm)

LVectorWindow::SetScaleFactor (Refer to Ltvecwrp.chm)

LVectorWindow::SetSelectedOnly (Refer to Ltvecwrp.chm)

LVectorWindow::SetToolType (Refer to Ltvecwrp.chm)

LVectorWindow::SetWndHandle (Refer to Ltvecwrp.chm)

LVectorWindow::SetZoomPercent (Refer to Ltvecwrp.chm)

LVectorWindow::StartChanging (Refer to Ltvecwrp.chm)

LVectorWindow::ZoomIn (Refer to Ltvecwrp.chm)

LVectorWindow::ZoomOut (Refer to Ltvecwrp.chm)


Version 10

The first LEADTOOLS Class Library was based on version 10 of the LEADTOOLS API. Since its release, the following changes have been made:

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

Changed functions

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

LFile::EnumDimensions (supports JBIG files)

LFileSettings::GetDimension (supports JBIG files)

LFileSettings::SetDimension (supports JBIG files)

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 */

The rest of this topic lists the new functions :

JBIG Support

LFileSettings::GetSaveResolution

LFileSettings::SetSaveResolution


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

ISIS Input

Database Interaction

Data Transfer

Animation


Introduction: Animation

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

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

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


Introduction: Bitmaps in Memory and in Files

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

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

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

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

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

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


Introduction: Bits Per Pixel and Related Ideas

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

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

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

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

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

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

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

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

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


Introduction: Color Resolution and Dithering

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

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

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

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

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

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

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

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

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

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

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

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


Introduction: Data Transfer

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

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

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


Introduction: Database Interaction

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

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: ISIS® Input

ISIS [Document/Medical]:

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

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

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


Example Programs

The following example programs are in separate EXAMPLES\CLASSLIB\ subdirectories (such as C:\LEAD12\EXAMPLES\CLASSLIB\DEMO). 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. This program was compiled using a Microsoft compiler.
DEMO | Main Demo is the main example program. It uses pull-down menus to demonstrate most of the LEADTOOLS features in one application. This program was compiled using a Microsoft compiler.
ANNOTATE | Annotations demonstrates the annotation capabilities of the Document/Medical toolkit. This program was compiled using a Borland compiler.
DEMO | Main Demo is the main example program. It uses pull-down menus to demonstrate most of the LEADTOOLS features in one application. This program was compiled using a Borland compiler.
UNDERLAY | Underlay demonstrates the LBitmapBase::Underlay 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 LBitmapBase::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.


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 EADTOOLS Class Library.

Getting Started

Getting Started with the LEADTOOLS Class Library

Considering Development Systems

Using LEADTOOLS with Your C/C++ Compiler

Using Global / Local Settings for Bitmap Objects

Unlocking Special LEAD Features

Unlocking Vector File Format Support

Loading File Filters

Working with Raster Images

Loading and Saving Images

Displaying an Image

Using LBitmapWindow as a Window

Using LBitmapWindow as a Control

Thumbnail Browser

Using the ImageList Control

Using a PanWindow

Accounting for View Perspective

Implementing Animation

Processing an Image

Implementing Transparency

Scanning Images Using ISIS Device

Using Callback Functions

Using DIBs, DDBs, and the Clipboard

Using the Magnifying Glass

Defining and Using a Bitmap Region

Saving a Region

Saving Window-Leveled Bitmaps

Screen Capture

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 ICC Profile Functions

Handling CMYK Files as Separate Bitmaps

Image Optimization

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

Annotation Files

Implementing Custom Annotations

The Annotation Text Token Table

Fixed Annotations

Grouping and Ungrouping Annotation Objects

Using Rulers in Annotation Objects

Using Annotation Bitmap Objects

Displaying and Manipulating Annotation Objects

Flipping, Reversing and Rotating Annotation Objects

Altering Annotation Object Settings

Obtaining Annotation Object Information


Getting Started with the LEADTOOLS Class Library

The LEADTOOLS Class Library is a powerful library that wraps all the LEADTOOLS API functions into small and easy to use C++ classes. The classes are compact and designed in a way that provides maximum flexibility and ease of use in addition to minimizing the load on memory (through controlling the loaded LEAD libraries). This library is designed to help the LEADTOOLS user minimize the time required to develop an image enabled application.

The LEADTOOLS Class Library can be used for high and low level processing of bitmaps in addition to saving/loading and managing image files. The LEADTOOLS Class Library provides all the features and functionality of the LEADTOOLS API wrapped into easy to use C++ classes. The most powerful feature provided by LEADTOOLS Class Library is its control classes. These classes provide "windowed controls" which handle the majority of issues concerning bitmap display automatically. These control classes include a bitmap window, an animation window, and an annotation window. These classes can be used in two ways: as a normal control, like any ordinary Windows control or as a full blown window where the user can specify the handle of the window which will be controlled and managed by the class. Also, the user is able to control the functionality of these classes by deriving his own controls from these classes, and overriding the desired set of overridable functions to enhance or change the manner in which they work.

To use the LEADTOOLS Class Library you have to perform the following steps:

1.

You can load the desired set of LEAD libraries by calling:

LBase::LoadLibraries with flags indicating which libraries your application would like to load. For example, to load the LEAD "ltkrn14n.dll" library:

WinMain()
{
…//Do some init
//Load the required LEAD DLLs
LBase::LoadLibraries(LT_KRN);
…//Other processing
}

For example, the above could be done in your application’s initialization procedure.

2. | After loading the desired LEAD libraries you can start using the class objects or the LEAD API functions directly.
3. | At any time, you can unload any LEAD library by calling LBase::UnloadLibraries and passing the flags indicating the LEAD libraries to unload.
4. | You can also check for currently loaded LEAD libraries by calling: LBase::GetLoadedLibraries.
5. | If you try to call any LEAD API or use a class library function when the required LEAD library is not loaded then an error code will be returned and recorded in the internal error list. This error code will indicate which library was unavailable.
6. | Link your application to the LIB file for the class library, which is "ltwvc_n.lib" for MSVC or "ltwen_bc.lib" for Borland.

Class Hierarchy Chart


Considering Development Systems

The LEADTOOLS Class Library is designed as a set of standard C++ objects. These objects make use of the LEADTOOLS API, which are standard Windows Dynamic Link Libraries. You should be able to use the LEADTOOLS Class Library with any compiler that supports C++ class objects and Windows DLLs. This topic explains some of the options.

The LEADTOOLS Class Library objects can be used as base classes for classes that you wish to derive.

Also, there are some high-level classes that can be used to perform all of the user-interface work for you.

These high-level classes (LBitmapWindow, LAnnotationWindow, and LAnimationWindow) can be used in two different ways. Using the first method, you can use these class objects as windows, which process all of the window messages (such as WM_PAINT, WM_VSCROLL, etc.) for you. The classes contain various overridable functions that you can override to change or supplement the object's behavior. The 2nd method involves using the class object as a child window to another window. This will allow the class object to act like a normal Windows control, sending control notification messages to the parent window, which can handle them as needed.

For more information on using class objects as windows or as controls, refer to Using LBitmapWindow as a Window, Using LBitmapWindow as a Control, and LBitmapWindow:Window vs Control.


Using LEADTOOLS with Your C/C++ Compiler

Using LEADTOOLS with Your C++ Compiler

To use the LEADTOOLS Class Library you have to go through the following steps:

1 | Link your application to the LIB file for the class library which is LTWVC_N.LIB for MSVC compilers and LTWEN_BC.LIB for Borland compilers.
2 | At the start of your application load the desired set of LEAD libraries by calling:

LBase::LoadLibraries(L_UINT32 uLibrary); with flags indicating which libraries to load. For example to load LEAD LTKRN14n.dll library:

WinMain()
{
…

LBase::LoadLibraries(LT_KRN);
…
}

For Microsoft C, you need to include the Class Library .LIB file that LEADTOOLS supplies in order to use the LEADTOOLS Class Library objects. For a summary of the library files, refer to Files To Be Included With Your Application. For the library files required by a particular class, refer to the class description.

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


Unlocking Special LEAD Features

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

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

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

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

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

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

when you have received the instructions and the key(s) call the UnlockSupport 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 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 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 LSettings::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), 8-bit, or 24-bit (uses MCMP compression) only. They require little memory but the read and write operations performed on the bitmap are slower. Also, the 8-bit and 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 LBitmapBase::Create or LBitmapBase::Allocate. You can also instruct LEADTOOLS to react dynamically depending on the bitmap size or the amount of available memory using LMemoryFile::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 LMemoryFile::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 LMemoryFile::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 LMemoryFile::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 LMemoryFile::SetMemoryThresholds, call LMemoryFile::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 LFileSettings::SetTempDirectory. You can get the current location using LFileSettings::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 LMemoryFile::GetBitmapMemoryInfo. You can change the memory allocation parameters using LMemoryFile::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)


Using Callback Functions

In the LEADTOOLS Class Library, the callback functions that are available through the LEADTOOLS API are implemented as overidable virtual functions in the various classes. Using the LEADTOOLS API, a callback function is a function that you write and that LEADTOOLS calls. With the LEADTOOLS Class Library, the class object has a default implementation for the callback function. You can derive your own class from one of the LEADTOOLS base classes, and override the necessary callback function(s) in order to do your own processing. When you do this, 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 LBase::StatusCallBack virtual function enables you to do that with many class functions that do not have an associated virtual function.

In the LEADTOOLS API, many functions let you pass a parameter that specifies a callback function. However, in the LEADTOOLS Class Library, individual classes define virtual functions that you must override in derived classes. In either case, these callback functions are more flexible than LBase::StatusCallBack. 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 Class Library virtual 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 Overridables.


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.

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.


Getting or Setting Bitmap Information

LEADTOOLS provides several functions for getting information on various aspects of bitmaps. The following functions provide information on bitmap characteristics such as dimension, color order, size, resolution, etc.

LBitmapBase::GetBitsPerPixel

LBitmapBase::GetBytesPerLine

LBitmapBase::GetColorCount

LBitmapBase::GetColorOrder

LBitmapBase::GetHeight

LBitmapBase::GetMemSize

LBitmapBase::GetWidth

LBitmapBase::GetXResolution

LBitmapBase::GetYResolution

Information about the memory associated with a bitmap can be obtained using the following functions:

LBitmapBase::GetMemSize

LBitmapBase::Is1BitCompressed

LBitmapBase::IsAllocated

LBitmapBase::IsMemoryLocked

LBitmapBase::IsUsingConventionalMemory

LBitmapBase::IsUsingDiskMemory

To get information about display characteristics of a bitmap, use the following functions:

LBitmapBase::GetDefaultDithering

LBitmapBase::GetDitheringMethod

LBitmapBase::GetPaintContrast

LBitmapBase::GetPaintGamma

LBitmapBase::GetPaintIntensity

The following functions get general information about a bitmap:

LBitmapBase::GetHandle

LBitmapBase::GetViewPerspective

LBitmapBase::HasRgn

LBitmapBase::IsGrayScale

LBitmapBase::IsInterlaced

LBitmapBase::IsPixelsSigned

LBitmapBase::IsTiled

Several of the characteristics mentioned above can also be set for a bitmap using the following functions:

LBitmapBase::Initialize

LBitmapBase::SetHandle

LBitmapBase::SetDitheringMethod

LBitmapBase::SetXResolution

LBitmapBase::SetYResolution


Using Global and Local Settings for bitmap objects

The following functions are used to change and set/get the local settings for bitmap objects:

LBitmapBase::GetDefaultDithering

LBitmapBase::SetDefaultDithering

LBitmapBase::GetDisplayMode

LBitmapBase::SetDisplayMode

The following functions can be used to set/get the global settings for painting bitmaps:

LBitmapSettings::DefaultDithering

LBitmapSettings::GetDisplayMode

LBitmapSettings::SetDisplayMode

And the functions that can be used to enable/disable the local settings for bitmap objects are:

LBitmapBase::EnableLocalSettings

LBitmapBase::IsLocalSettingsEnabled

When declaring or creating a bitmap object, its local settings are enabled by default. The default local settings are filled from the current global settings.

Once an object is created it will take its default values from the global settings.

The user can force a specific object to use global settings by calling (LBitmapBase::EnableLocalSettings(FALSE)) to disable the local settings.

Local settings are only used if they are enabled. Using LPaint or LPaintEffects to paint a bitmap that has its local settings enabled will cause the class object's local settings to be set before executing the paint function and then the global settings will be restored after executing the paint function. This will cause the bitmap to be painted using the object's local settings. On the other hand if local settings are disabled for a specific bitmap object, then the global settings will be used when painting the bitmap.

Example:

LBitmapBase MyBitmap;
LPaint MyPaint;
HDC hDC;

//load a bitmap
MyBitmap.Load(TEXT("image1.cmp"));
//then disable the local settings for the bitmap object
MyBitmap.EnableLocalSettings(FALSE);

//change the local settings for the bitmap object to some values
MyBitmap.SetPaintContrast(50);
MyBitmap.SetPaintGamma(150);
MyBitmap.SetPaintIntensity(-50);

//initialize the paint object with the bitmap and the DC of the desktop window
MyPaint.SetBitmap(&MyBitmap);
hDC=GetDC(0);
MyPaint.SetDC(hDC);

//now paint the bitmap using the global settings
MyPaint.PaintDC();

//now enable the local settings for the bitmap object
MyBitmap.EnableLocalSettings(TRUE);

//then paint the bitmap object using its local settings
MyPaint.PaintDC();
//…..
ReleaseDC(0,hDC);


Wrapper Macros

Description:

The following sections describe the different LEADTOOLS Class Library macros. These macros are used by various LEADTOOLS Class Library classes. In order to create user-defined classes that derive from LEAD classes, you can make use of these macros. Some of these macros are required, while some are optional.

LEAD_DECLAREOBJECT

LEAD_IMPLEMENTOBJECT

LEAD_DECLARE_PLAYBACK_BITMAP

LEAD_INIT_PLAYBACK_BITMAP

LEAD_DECLARE_LIST_BITMAP

LEAD_INIT_LIST_BITMAP

LEAD_DECLAREOBJECT(ClassName):

This macro declares a LEADTOOLS Class Library class. This is a required macro if you wish to derive a class from one of the LEADTOOLS Class Library classes. Use this macro in the header file that contains the derived class declaration:

Example:

This example derives class MyPrint from LPrint

class MyPrint : Public LPrint
{
LEAD_DECLAREOBJECT(MyPrint);

private: /*user private section */
//….
protected: /*user protected section */
//….
public: /*user public section */
//….
};

LEAD_IMPLEMENTOBJECT(ClassName):

This macro declares the implementation of a LEADTOOLS Class Library class. This is a required macro if you wish to derive a class from one of the LEADTOOLS Class Library classes. Use this macro in the class implementation file that contains the derived class implementation:

Example:

This example derives class MyPrint from LPrint

LEAD_IMPLEMENTOBJECT(MyPrint)

MyPrint::MyPrint()
{
//….
}

MyPrint::~MyPrint()
{
//….
}

MyPrint::SomeFunction()
{
//….
}

LEAD_DECLARE_PLAYBACK_BITMAP():

This is an optional macro that you can use to connect a class derived from LBitmapBase or LBitmap to the LPlayBack class.

This macro allows the bitmap class to be used by the playback class as the playback animation bitmap, and must be used in conjunction with the LEAD_INIT_PLAYBACK_BITMAP() macro.

For example in the LEADTOOLS Class Library header for the LPlayBack class, a bitmap object is declared to be used by this class:

class LPlayBack : Public LBase
{
LEAD_DECLARE_PLAYBACK_BITMAP();

private: /*private section */
//….
protected: /*protected section */
//….
public: /*public section */
//….
};

This example allows the derived bitmap class (LUserBitmap) to be used by the playback class.

LUserPlayBack: public LPlayBack
{
LEAD_DECLARE_PLAYBACK_BITMAP();

private: /*user private section */
//….
protected: /*user protected section */
//….
public: /*user public section */
//….
};

LEAD_INIT_PLAYBACK_BITMAP(PlayBackClassName, BitmapClassName):

This macro connects the playback class to a bitmap class that is derived from LBitmapBase or LBitmap. You must use this macro if you want to connect a derived bitmap class to the playback class.

Example:

For example in the LEADTOOLS Class Library implementation for the LPlayBack class, a bitmap object is connected to this class:

LEAD_INIT_PLAYBACK_BITMAP(LPlayBack,
 LBitmapBase)

LPlayBack::LPlayBack()
{
//….
}

This example connects the user-defined LUserBitmap class, which is derived from LBitmap, to the playback class.

LEAD_INIT_PLAYBACK_BITMAP(LUserPlayBack, LUserBitmap)

LUserPlayBack::LUserPlayBack()
{
//….
}

Now, in order to get the playback bitmap, the user can call:

LUserPlayBack UserPlayBack;
LUserBitmap* pLUserBitmap= (LUserBitmap* ) UserPlayBack.GetBitmap();
pLUserBitmap->SomeUserDefinedFunctionInLUserBitmap();

LEAD_DECLARE_LIST_BITMAP():

This is an optional macro that you can use to connect a class derived from LBitmapBase or LBitmap to the LBitmapList class.

This macro allows the bitmap class to be used by the bitmap list class as the bitmap returned when using the [ ] operator of the bitmap list class. This macro must be used in conjunction with the LEAD_INIT_LIST_BITMAP() macro.

Example:

For example in the LEADTOOLS Class Library header for the LBitmapList class, a bitmap object is declared to be used by this class:

class LBitmapList : Public LBase
{
LEAD_DECLARE_LIST_BITMAP();

private: /*private section */
//….
protected: /*protected section */
//….
public: /*public section */
//….
};

This example allows the derived bitmap class (LUserBitmap) to be used by the bitmap list class.

LUserBitmapList: public LBitmapList
{
LEAD_DECLARE_LIST_BITMAP();

private: /*user private section */
//….
protected: /*user protected section */
//….
public: /*user public section */
//….
};

LEAD_INIT_LIST_BITMAP(BitmapListClassName,BitmapClassName):

This macro connects the bitmap list class to a bitmap class that is derived from LBitmapBase or LBitmap. You must use this macro if you want to connect a derived bitmap class to the bitmap list class.

LEAD_INIT_LIST_BITMAP(LBitmapList,
 LBitmapBase)

LBitmapList::LBitmapList()
{
//….
}

This example connects the user-defined LUserBitmap class, which is derived from LBitmap, to the bitmap list class.

LEAD_INIT_LIST_BITMAP(LUserBitmapList, LUserBitmap)

LUserBitmapList::LUserBitmapList()
{
//….
}

Then, when the you use the [ ] operator for enumerating the bitmap list items, you can do the following:

for(int i=0;i<LUserBitmapList.GetCount();i++)
( (LUserBitmap)LUserBitmapList[ i ] ).SomeUserDefinedFunctionInLUserBitmap();


Bitmap Class Map Macros

The bitmap class map macros are provided to assist in connecting the different LEADTOOLS Class Library classes with classes you derive from LBitmap or LBitmapBase. The mapped classes are created "on demand", that is, no class object will be created if you do not request that class object from the bitmap object.

Connecting different LEADTOOLS Class Library classes to the bitmap class object makes it easy to use these classes with the object when programming applications.

Every LEADTOOLS Class Library class you derive from these bitmap classes must declare a class map. This is done through the LEAD_DECLARE_CLASS_MAP() macro in the header file that contains the declaration for the derived class. In the implementation file for that class the user must use the LEAD_START_CLASS_MAP(ClassName,ClassParent) , LEAD_INIT_…(ClassName) and LEAD_END_CLASS_MAP(ClassName,ClassParent) macros respectively.

Class maps completely support inheritance. If a mapped class is not found then the mapped class of the parent class will be used. Any inherited classes will use the newly mapped classes or the parent mapped classes if the child does not have a mapped class of the same type. This gives you flexibility in programming your applications while using different class maps for each derived bitmap class.

LEAD_DECLARE_CLASS_MAP

LEAD_START_CLASS_MAP

LEAD_END_CLASS_MAP

LEAD_INIT_xxxx

START_BITMAP_CHANGING

END_BITMAP_CHANGING

LDictionary_GetBitmapCount

LDictionary_GetBitmap

LDictionary_DisconnectBitmapList

LDictionary_IsBitmap

LEAD_DECLARE_CLASS_MAP():

Use this macro to declare a class map for your derived LEAD bitmap class. This macro will declare different functions that you can use to get the corresponding mapped class object. The functions that this macro declares are:

virtual LDialogBase * | DialogBase(); //for the mapped LDialogBase or derived class
virtual LDialogImage * | DialogImage(); //for the mapped LDialogImage or derived class
virtual LDialogFile * | DialogFile(); //for the mapped LDialogFile or derived class
virtual LDialogImageEffect * | DialogImageEffect(); //for the mapped LDialogImageEffect or derived class
virtual LDialogColor * | DialogColor(); //for the mapped LDialogColor or derived class
virtual LDialogDocument * | DialogDocument(); //for the mapped LDialogDocument or derived class
virtual LDialogWeb * | DialogWeb(); //for the mapped LDialogWeb or derived class
virtual LDialogEffect * | DialogEffect(); //for the mapped LDialogEffect or derived class
virtual LMarker* | Marker(); //for the mapped LMarker or derived class
Virtual LBitmapRgn* | Region(); //for the mapped LBitmapRgn or derived class
virtual LPaint* | Paint(); //for the mapped LPaint or derived class
virtual LPaintEffect* | PaintEffect(); //for the mapped LPaintEffect or derived class
virtual LTwain * | Twain(); //for the mapped LTwain or derived class
virtual LIsis* | Isis(); //for the mapped LIsis or derived class
virtual LMemoryFile* | MemoryFile(); //for the mapped LMemoryFile or derived class
virtual LFile* | File(); //for the mapped LFile or derived class
virtual LPrint* | Print(); //for the mapped LPrint or derived class
virtual LScreenCapture* | ScreenCapture(); //for the mapped LScreenCapture or derived class
virtual LBarCode | BarCode(); //for the mapped LBarCode or derived class.

Example:
For example in the header file of the LBitmapBase LEAD bitmap declaration this macro is used as follows:

class LBitmapBase:
 public LBase
{
LEAD_DECLARE_CLASS_MAP();
//….
//….
//….
}

LEAD_START_CLASS_MAP(ClassName,ClassParent):

Use this macro to start your class map implementation for your derived LEAD bitmap class object. This is done in the implementation file of your bitmap class.

Example:
For example in the LEADTOOLS Class Library class LBitmapBase implementation, this macro is used as follows:

LEAD_START_CLASS_MAP(LBitmapBase,LBase)
…

For the user derived bitmap class (LUserBitmap)

LEAD_START_CLASS_MAP(LUserBitmap,LParentBitmapClassName)
…
LEAD_END_CLASS_MAP(LUserBitmap,LParentBitmapClassName)

LEAD_END_CLASS_MAP(ClassName,ClassParent):

Use this macro to end your class map implementation for your derived LEAD bitmap class object. This is done in the implementation file of your bitmap class.

Example:
For example in the LEADTOOLS Class Library class LBitmapBase implementation, this macro is used as follows:

LEAD_START_CLASS_MAP(LBitmapBase,LBase)
…
LEAD_END_CLASS_MAP(LBitmapBase,LBase)

For the user derived bitmap class (LUserBitmap)

LEAD_START_CLASS_MAP(LUserBitmap,LParentBitmapClassName)
…
LEAD_END_CLASS_MAP(LUserBitmap,LParentBitmapClassName)

LEAD_INIT_xxx (ClassName):

Use these macros in your class map implementation of your derived LEAD bitmap class object to map different classes to your bitmap object. This is done in the implementation file of your bitmap class.

The available LEAD_INIT_xxx macros are:

LEAD_INIT_LFile() | //to map a LFile class
LEAD_INIT_LIsis() | //to map a LIsis class
LEAD_INIT_LTwain() | //to map a LTwain class
LEAD_INIT_LPrint() | //to map a LPrint class
LEAD_INIT_LPaint() | //to map a LPaint class
LEAD_INIT_LDiaolgBase() | //to map a LDialogBase class
LEAD_INIT_LDiaolgImage() | //to map a LDialogImage class
LEAD_INIT_LDiaolgWeb() | //to map a LDialogWeb class
LEAD_INIT_LDiaolgColor() | //to map a LDialogColor class
LEAD_INIT_LDiaolgImageEffect() | //to map a LDialogImageEffect class
LEAD_INIT_LDiaolgDocument() | //to map a LDialogDocument class
LEAD_INIT_LDiaolgEffect() | //to map a LDialogEffect class
LEAD_INIT_LDiaolgFile() | //to map a LDialogFile class
LEAD_INIT_LMarker(LMarker) | //to map a LMarker class.
LEAD_INIT_LDiaolg() | //to map a LDialog class
LEAD_INIT_LBitmapRgn() | //to map a LBitmapRgn class
LEAD_INIT_LMemoryFile() | //to map a LMemoryFile class
LEAD_INIT_LPaintEffect() | //to map a LPaintEffect class
LEAD_INIT_LScreenCapture() | //to map a LScreenCapture class
LEAD_INIT_LBarCode() | //to map a LBarCode class

Example:

For example in the LEADTOOLS Class Library class LBitmapBase implementation, these macros are used as follows:

LEAD_START_CLASS_MAP(LBitmapBase,LBase)

LEAD_INIT_LFile(LFile) | //to map a LFile class to the LBitmapBase class
LEAD_INIT_LIsis(LIsis) | //to map a LIsis class to the LBitmapBase class
LEAD_INIT_LTwain(LTwain) | //to map a LTwain class to the LBitmapBase class
LEAD_INIT_LPrint(LPrint) | //to map a LPrint class to the LBitmapBase class
LEAD_INIT_LPaint(LPaint) | //to map a LPaint class to the LBitmapBase class
LEAD_INIT_LDiaolgBase(LDialogBase ) | //to map a LDialogBase class to the LBitmapBase class
LEAD_INIT_LDiaolgImage(LDialogImage ) | //to map a LDialogImage class to the LBitmapBase class
LEAD_INIT_LDiaolgEffect (LDialogEffect ) | //to map a LDialogEffect class to the LBitmapBase class
LEAD_INIT_LDiaolgWeb(LDialogWeb ) | //to map a LDialogWeb class to the LBitmapBase class
LEAD_INIT_LDiaolgColor(LDialogColor ) | //to map a LDialogColor class to the LBitmapBase class
LEAD_INIT_LDiaolgImageEffect(LDialogImageEffect ) | //to map a LDialogImageEffect class to the LBitmapBase class
LEAD_INIT_LDiaolgFile(LDialogFile ) | //to map a LDialogFile class to the LBitmapBase class
LEAD_INIT_LDiaolgDocument(LDialogDocument ) | //to map a LDialogDocument class to the LBitmapBase class
LEAD_INIT_LMarker(LMarker) | //to map a LMarker class to the LbitmapBase class
LEAD_INIT_LBitmapRgn(LBitmapRgn) | //to map a LBitmapRgn class to the LBitmapBase class
LEAD_INIT_LMemoryFile(LMemoryFile) | //to map a LMemoryFile class to the LBitmapBase class
LEAD_INIT_LPaintEffect(LPaintEffect) | //to map a LPaintEffect class to the LBitmapBase class
LEAD_INIT_LScreenCapture(LScreenCapture) | //to map a LScreenCapture class to the LBitmapBase class
LEAD_INIT_LBarCode(LBarCode) | //to map a LBarCode class to the LBitmapBase class

LEAD_END_CLASS_MAP(LBitmapBase,LBase)

For the user derived bitmap class (LUserBitmap)

LEAD_START_CLASS_MAP(LUserBitmap, LBitmapBase)

LEAD_INIT_LFile(LUserFile) | //to map a LUserFile class to the LBitmapBase class
LEAD_INIT_LIsis(LUserIsis) | //to map a LUserIsis class to the LBitmapBase class
LEAD_INIT_LPrint(LUserPrint) | //to map a LUserPrint class to the LBitmapBase class

LEAD_END_CLASS_MAP(LUserBitmap,LBitmapBase)

Now executing the following:

LUserBitmap UserBitmap;

UserBitmap.File(); | // this returns a pointer to a LFile object
UserBitmap.Paint(); | // this returns a pointer to a LPaint object
UserBitmap.Isis(); | // this returns a pointer to a LIsis object
UserBitmap.Print(); | // this returns a pointer to a LPrint object
UserBitmap.Region(); | // this returns a pointer to a LBitmapRgn object
UserBitmap.PaintEffect(); | // this returns a pointer to a LPaintEffect object
UserBitmap.MemoryFile(); | // this returns a pointer to a LMemoryFile object

START_BITMAP_CHANGING(pLBitmap,nNotifyCode,nNotifyCatigory)

Use this macro to fire a changing notification for the passed bitmap object before executing the function that will change the bitmap. If the StartChanging notification callback returns an error code then this macro will end the calling function and return with the same error code.

END_BITMAP_CHANGING(pLBitmap,nNotifyCode,nNotifyCatigory,nRetCode)

Use this macro to fire a changing notification for the passed bitmap object after executing the function that changed the bitmap. This will notify the bitmap object that the function completed execution.

LDictionary_GetBitmapCount()

Use this macro to get the current number of LEADTOOLS Class Library created bitmap objects.

LDictionary_GetBitmap(nIndex)

Use this macro to get a pointer to a LEADTOOLS Class Library bitmap object. The returned pointer is of type LBitmapBase L_FAR *.

LDictionary_DisconnectBitmapList(pLBitmaplist)

Use this macro to disconnect a LEADTOOLS Class Library bitmap object from the specified bitmap list object.

LDictionary_IsBitmap(pLBitmap)

Use this macro to check for a valid LEADTOOLS Class Library bitmap object. This macro takes a pointer to the bitmap object to be verified.


High Level Window Classes

The LEADTOOLS Class Library supplies high-level classes for dealing with images. These classes provide "windowed controls" which handle the majority of issues concerning bitmap display automatically. These control classes include a bitmap window, an animation window, and an annotation window. These classes can be used in two ways: as a normal control, like any ordinary Windows control or as a full blown window where the user can specify the handle of the window which will be controlled and managed by the class. Also, the user is able to control the functionality of these classes by deriving his own controls from these classes, and overriding the desired set of overridable functions to enhance or change the manner in which they work.

The high-level classes are:

LBitmapWindow | class for displaying images
LAnimationWindow | derived from LBitmapWindow for displaying animations
LAnnotationWindow | derived from LBitmapWindow for displaying images and annotations


LBitmapWindow: Window vs. Control

To be notified of: | LBitmapWindow as Control | LBitmapWindow as Window
MouseDown | LBW_LBUTTONDOWN LBW_RBUTTONDOWN | override MsgProcCallBack
MouseUp | LBW_LBUTTONUP LBW_RBUTTONUP | override MsgProcCallBack
Click | LBW_LBUTTONCLICKED LBW_RBUTTONCLICKED | override MsgProcCallBack
Double Click | LBW_LBUTTONDBLCLK LBW_RBUTTONDBLCLK | override MsgProcCallBack
MouseMove | LBW_MOUSEMOVE | override MsgProcCallBack
GotFocus | LBW_SETFOCUS | override MsgProcCallBack
LostFocus | LBW_KILLFOCUS | override MsgProcCallBack
KeyDown | LBW_KEYDOWN | override MsgProcCallBack
KeyUp | LBW_KEYUP | override MsgProcCallBack
KeyPress | LBW_KEYPRESS | override MsgProcCallBack
Scroll | LBW_SCROLLED | override MsgProcCallBack
File Drag/Drop | LBW_FILEDRAGDROP | overrride OnFileDropped
BitmapChange | LBW_BITMAPCHANGED | override StartChanging override EndChanging
WindowPaint | LBW_PAINTED | override OnDraw
PaintNotification | LBW_PAINTEFFECTS | override PaintNotification
PanWindowEvent | LBW_PANWINDOW | override PanWndCallBack
ZoomInDone | LBW_ZOOM | override OnZoom
Resize | LBW_SIZECHANGED | override MsgProcCallBack
RgnChange | LBW_RGNCHANGED | NA

For more information, refer to LBitmapWindow Control Notification Messages:


Using LBitmapWindow as a Control

To use the LBitmapWindow (or any derived) class as a windowed control in your application, you must create an LBitmapWindow object as a child window of some parent window, such as a dialog box, using LBitmapWindow::CreateWnd. After that, the parent window will receive control notification messages that you can process if you like.

This example was done using MFC, so your code may look different if you use some other foundation class library.

// First, you should create a button control in your dialog box (IDC_BUTTON)
// Do not forget to load the libraries in application's initialization code:
// LBase::LoadLibraries(LT_ALL_LEADLIB);

// In your View class, declare an LBitmapWindow (or derived) class object
LBitmapWindow m_Image;

// Also in your application't initialization code, you can add the following to use
// the LBitmapWindow (or derived) object as a windowed control
CRect rcRect;
COLORREF rgb;
CWnd *pWnd;

// Get the window for the created button
pWnd = GetDlgItem(IDC_BUTTON);

// Get the rectangle of the button
pWnd->GetClientRect(rcRect);

// Create the LBitmapWindow control, make it visible, and make it center the image
m_Image.CreateWnd(pWnd->m_hWnd, 901, WS_VISIBLE|L_BS_CENTER,
rcRect.TopLeft().x, rcRect.TopLeft().y, rcRect.BottomRight().x,
rcRect.BottomRight().y);

// Load the file
m_Image.Load(TEXT("c:\\ltwin14\\images\\sample1.cmp"));

// Get the background of the button
rgb = GetSysColor(COLOR_BTNFACE);

// Set the window background color
m_Image.SetPatternBackColor(rgb);

// Fit the image in the window
m_Image.SetZoomMode(ZOOM_FIT, TRUE);


LBitmapWindow Control Notification Messages

Message | wParam | lParam
LBW_LBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_MOUSEMOVE | ID of bitmap window | LPMOUSEDATA
LBW_KEYDOWN | ID of bitmap window | LPKEYDATA
LBW_KEYUP | ID of bitmap window | LPKEYDATA
LBW_KEYPRESS | ID of bitmap window | LPKEYDATA
LBW_SIZECHANGED | ID of bitmap window | LPSIZEDATA
LBW_FILEDRAGDROP | ID of bitmap window | LPDRAGDROPDATA
LBW_PAINTEFFECTS | ID of bitmap window | LPPAINTEFFECTDATA
LBW_PANWINDOW | ID of bitmap window | LPPANWINDOWDATA
LBW_ZOOM | ID of bitmap window | LPZOOMDATA
LBW_SETFOCUS | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_KILLFOCUS | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_ENABLED | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_DISABLED | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_SCROLLED | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_BITMAPCHANGED | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_PAINTED | ID of bitmap window | (HWND) Handle of the BitmapWindow
LBW_RGNCHANGED | ID of bitmap window | LPREGIONDATA


Using LBitmapWindow as a Window

To use the LBitmapWindow (or any derived) class as a Window in your application, you must create a window, and then assign the newly created window handle to an LBitmapWindow (or derived) object. After that, the class object will do all of the processing required to handle the Window messages that the window will receive, including those relating to displaying images. If you want to process messages yourself, you can override the LBitmapWindow::MsgProcCallBack vitrual function.

The following is a short example of getting started using LBitmapWindow as a Window. This example was done using MFC, so your code may look different if you use some other foundation class library.

// Do not forget to load the libraries in application's initialization code:
// LBase::LoadLibraries(LT_ALL_LEADLIB);

// In your View class, declare an LBitmapWindow (or derived) class object
LBitmapWindow m_Image;

// Now, in the function for processing WM_PAINT messages:
COLORREF rgb;
// Set the window handle
m_Image.SetWndHandle(m_hWnd);
// Load the file
m_Image.Load(TEXT("c:\\ltwin14\\images\\sample1.cmp"));
// Get the background of the window
rgb = GetSysColor(COLOR_WINDOW);
// Set the window background color
m_Image.SetPatternBackColor(rgb);
// Fit the image in the window
m_Image.SetZoomMode(ZOOM_FIT, TRUE);


LBitmapWindow Keys

The following keys are handled by the LBitmapWindow object when the bitmap window control has the focus.

Key | Action
Up Arrow | Scroll down one line step
Down Arrow | Scroll up one line step
Right Arrow | Scroll left one line step
Left Arrow | Scroll right one line step
Page Up | Scroll down one page
Page Down | Scroll up one page
Ctrl + Page Up | Scroll to bitmap top
Ctrl + Page Down | Scroll to bitmap bottom
Ctrl + Home | Scroll left one page
Home | Scroll to bitmap left
End | Scroll to bitmap right
Ctrl + End | Scroll right one page
+ (Plus) | Zoom in
- (Minus) | Zoom out


LAnimationWindow: Window vs. Control

To be notified of: | LAnimationWindow as Control | LAnimationWindow as Window
MouseDown | LBW_LBUTTONDOWN LBW_RBUTTONDOWN | override MsgProcCallBack
MouseUp | LBW_LBUTTONUP LBW_RBUTTONUP | override MsgProcCallBack
Click | LBW_LBUTTONCLICKED LBW_RBUTTONCLICKED | override MsgProcCallBack
Double Click | LBW_LBUTTONDBLCLK LBW_RBUTTONDBLCLK | override MsgProcCallBack
MouseMove | LBW_MOUSEMOVE | override MsgProcCallBack
GotFocus | LBW_SETFOCUS | override MsgProcCallBack
LostFocus | LBW_KILLFOCUS | override MsgProcCallBack
KeyDown | LBW_KEYDOWN | override MsgProcCallBack
KeyUp | LBW_KEYUP | override MsgProcCallBack
KeyPress | LBW_KEYPRESS | override MsgProcCallBack
Scroll | LBW_SCROLLED | override MsgProcCallBack
File Drag/Drop | LBW_FILEDRAGDROP | overrride OnFileDropped
BitmapChange | LBW_BITMAPCHANGED | override StartChanging override EndChanging
WindowPaint | LBW_PAINTED | override OnDraw
PaintNotification | LBW_PAINTEFFECTS | override PaintNotification
PanWindowEvent | LBW_PANWINDOW | override PanWndCallBack
ZoomInDone | LBW_ZOOM | override OnZoom
Resize | LBW_SIZECHANGED | override MsgProcCallBack
RgnChange | LBW_RGNCHANGED |
MoveFirstFrame | LAM_MOVE_FIRST |
MoveLastFrame | LAM_MOVE_LAST |
MoveNextFrame | LAM_MOVE_NEXT |
MovePreviousFrame | LAM_MOVE_PREV |
MoveToFrame | LAM_MOVE_TO |
Animation Playback events, during playback | LAM_PLAYBACK_EVENT |

For more information, refer to LAnimationWindow Control Notification Messages:


LAnimationWindow Control Notification Messages

Message | wParam | lParam
LBW_LBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_MOUSEMOVE | ID of bitmap window | LPMOUSEDATA
LBW_KEYDOWN | ID of bitmap window | LPKEYDATA
LBW_KEYUP | ID of bitmap window | LPKEYDATA
LBW_KEYPRESS | ID of bitmap window | LPKEYDATA
LBW_SIZECHANGED | ID of bitmap window | LPSIZEDATA
LBW_FILEDRAGDROP | ID of bitmap window | LPDRAGDROPDATA
LBW_PAINTEFFECTS | ID of bitmap window | LPPAINTEFFECTDATA
LBW_PANWINDOW | ID of bitmap window | LPPANWINDOWDATA
LBW_ZOOM | ID of bitmap window | LPZOOMDATA
LBW_SETFOCUS | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_KILLFOCUS | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_ENABLED | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_DISABLED | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_SCROLLED | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_BITMAPCHANGED | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_PAINTED | ID of bitmap window | (HWND) Handle of the LAnimationWindow
LBW_RGNCHANGED | ID of bitmap window | LPREGIONDATA
LAM_MOVE_FIRST | ID of animation window | LPANIMATIONEVENTDATA
LAM_MOVE_LAST | ID of animation window | LPANIMATIONEVENTDATA
LAM_MOVE_NEXT | ID of animation window | LPANIMATIONEVENTDATA
LAM_MOVE_PREV | ID of animation window | LPANIMATIONEVENTDATA
LAM_MOVE_TO | ID of animation window | LPANIMATIONEVENTDATA
LAM_PLAYBACK_EVENT | ID of animation window | LPANIMATIONEVENTDATA


LAnnotationWindow: Window vs. Control

To be notified of: | LAnnotationWindow as Control | LAnnotationWindow as Window
MouseDown | LBW_LBUTTONDOWN LBW_RBUTTONDOWN | override MsgProcCallBack
MouseUp | LBW_LBUTTONUP LBW_RBUTTONUP | override MsgProcCallBack
Click | LBW_LBUTTONCLICKED LBW_RBUTTONCLICKED | override MsgProcCallBack
Double Click | LBW_LBUTTONDBLCLK LBW_RBUTTONDBLCLK | override MsgProcCallBack
MouseMove | LBW_MOUSEMOVE | override MsgProcCallBack
GotFocus | LBW_SETFOCUS | override MsgProcCallBack
LostFocus | LBW_KILLFOCUS | override MsgProcCallBack
KeyDown | LBW_KEYDOWN | override MsgProcCallBack
KeyUp | LBW_KEYUP | override MsgProcCallBack
KeyPress | LBW_KEYPRESS | override MsgProcCallBack
Scroll | LBW_SCROLLED | override MsgProcCallBack
File Drag/Drop | LBW_FILEDRAGDROP | overrride OnFileDropped
BitmapChange | LBW_BITMAPCHANGED | override StartChanging override EndChanging
WindowPaint | LBW_PAINTED | override OnDraw
PaintNotification | LBW_PAINTEFFECTS | override PaintNotification
PanWindowEvent | LBW_PANWINDOW | override PanWndCallBack
ZoomInDone | LBW_ZOOM | override OnZoom
Resize | LBW_SIZECHANGED | override MsgProcCallBack
RgnChange | LBW_RGNCHANGED | NA
AnnSelected | LBAW_SELECTED | override OnAnnEvent
AnnHyperLink | LBAW_HYPERLINK | override OnAnnEvent
AnnHyperLinkMenu | LBAW_HYPERLINKMENU | override OnAnnEvent
AnnChanged | LBAW_CHANGED | override OnAnnEvent
AnnDestroyed | LBAW_DESTROYED | override OnAnnEvent
AnnDrawn | LBAW_DRAWN | override OnAnnEvent
AnnLocked | LBAW_LOCKED | override OnAnnEvent
AnnUnlocked | LBAW_UNLOCKED | override OnAnnEvent
AnnClicked | LBAW_CLICKED | override OnAnnEvent
AnnCreated | LBAW_CREATED | override OnAnnEvent

For more information, refer to LAnnotationWindow Control Notification Messages:


LAnnotationWindow Control Notification Messages

Message | wParam | lParam
LBW_LBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDOWN | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONUP | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONCLICKED | ID of bitmap window | LPMOUSEDATA
LBW_LBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_RBUTTONDBLCLK | ID of bitmap window | LPMOUSEDATA
LBW_MOUSEMOVE | ID of bitmap window | LPMOUSEDATA
LBW_KEYDOWN | ID of bitmap window | LPKEYDATA
LBW_KEYUP | ID of bitmap window | LPKEYDATA
LBW_KEYPRESS | ID of bitmap window | LPKEYDATA
LBW_SIZECHANGED | ID of bitmap window | LPSIZEDATA
LBW_FILEDRAGDROP | ID of bitmap window | LPDRAGDROPDATA
LBW_PAINTEFFECTS | ID of bitmap window | LPPAINTEFFECTDATA
LBW_PANWINDOW | ID of bitmap window | LPPANWINDOWDATA
LBW_ZOOM | ID of bitmap window | LPZOOMDATA
LBW_SETFOCUS | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_KILLFOCUS | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_ENABLED | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_DISABLED | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_SCROLLED | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_BITMAPCHANGED | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_PAINTED | ID of bitmap window | (HWND) Handle of the LAnnotationWindow
LBW_RGNCHANGED | ID of bitmap window | LPREGIONDATA
LBAW_SELECTED | ID of annotation window | LPANNEVENTDATA
LBAW_HYPERLINK | ID of annotation window | LPANNEVENTDATA
LBAW_HYPERLINKMENU | ID of annotation window | LPANNEVENTDATA
LBAW_CHANGED | ID of annotation window | LPANNEVENTDATA
LBAW_DESTROYED | ID of annotation window | LPANNEVENTDATA
LBAW_DRAWN | ID of annotation window | LPANNEVENTDATA
LBAW_LOCKED | ID of annotation window | LPANNEVENTDATA
LBAW_UNLOCKED | ID of annotation window | LPANNEVENTDATA
LBAW_CLICKED | ID of annotation window | LPANNEVENTDATA
LBAW_CREATED | ID of annotation window | LPANNEVENTDATA


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:

LBitmapBase TmpBitmap; /* LBitmapBase
 object for the temporary bitmap */
/* Load a bitmap at its own bits per pixel */
TmpBitmap.Load(TEXT("v:\\images\\eagle.cmp"), 0, ORDER_BGR);
/* Save the image as a 24-bit Windows BMP file */
TmpBitmap.Save(TEXT("d:\\temp\\test.bmp"), FILE_BMP, 24, 0);

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

Implementing GeoKeys (GeoTIFF tags)

Multipage 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 LFile::StartFeedLoad, LFile::FeedLoad, and LFile::StopFeedLoad functions.

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

When working with multipage files, you can delete individual pages within the file using LFile::DeletePage.

To load an image from a file, into a bitmap, and resize the bitmap as it loads, call LFile::LoadBitmapResize or LBitmapBase::LoadResize.

To save a bitmap to a file in a memory buffer, use LMemoryFile::SaveBitmapBuffer or LMemoryFile::SaveFileBuffer. If the buffer of the LBuffer object used by the LMemoryFile::SaveBitmapBuffer is not large enough to accommodate the file in memory, the LMemoryFile::SaveBitmapBufferCallBack function is called, giving the user the opportunity to reallocate the buffer to the appropriate size. If the buffer of the LBuffer object used by the LMemoryFile::SaveFileBuffer is not large enough to accommodate the file in memory, the LMemoryFile::SaveFileBufferCallBack function is called, giving the user the opportunity to reallocate the buffer to the appropriate size. In addition, the LMemoryFile::SaveFileBuffer also calls the LMemoryFile::SaveFileCallBack to the image data from the specified bitmap. The LMemoryFile::SaveFileCallBack can be overridden if the user wants to supply the image data to save.

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 LBase::EnableOverlayCallBack. To determine the current overlay callback function, (which is the one last set), use LBase::EnableOverlayCallBack. This overlay callback must adhere to the function syntax specified in LBase::OverlayCallBack.

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

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

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

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

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) Class Library Help File .

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 LFile::InitICCProfile. Then, the profile itself can be loaded by calling LFile::LoadICCProfile. When the structure that contains the loaded profile is no longer needed, the memory must be freed by calling LFile::FreeICCProfile. Please note that LEAD also supports ICC Profile functions through the LTCLR DLL. For more information on these functions, refer to Using ICC Profile Functions.

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 LFile::LoadCMYKArray. To save the bitmap as TIFF CMYK, call LFile::SaveCMYKArray.

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

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

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 LBitmapBase::GetLoadStatus will return an error code.

When loading TXT files, you can use the LFileSettings::GetTXTOptions to get the current values for the control options used by LEADTOOLS. You can also use LFileSettings::SetTXTOptions to change the values for the control options before loading TXT file.

When saving JBIG2 file, you can use the LFileSettings::GetJBIG2Options to get the current values for the control options used by LEADTOOLS. You can also use LFileSettings::SetJBIG2Options to change the values for the control options before saving JBIG2 file.


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.

LFile::GetInfo will report the IFD of a TIFF page by filling FILEINFO.IFD.

To get LFile::GetInfo 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:

void CMainFrame::OnFileinfo()
{
// We will assume that "mtif.tif" has over
 42 pages.
// The error checks
// are not performed to simplify the example get info
 for page 40
LOADFILEOPTION LoadFileOption;
FILEINFO FileInfo;
memset(&FileInfo, 0, sizeof(FILEINFO));
// get the info and IFD for page 40
memset(&LoadFileOption, 0, sizeof(LOADFILEOPTION));
LoadFileOption.PageNumber = 40;
LFile MyFile;
MyFile.SetFileName(TEXT("d:\\work\\images\\mtif.tif"));
MyFile.GetInfo(&FileInfo, FILEINFO_TOTALPAGES, &LoadFileOption);
// get the info and IFD for page 41.
LoadFileOption.PageNumber = 2;
LoadFileOption.IFD = FileInfo.IFD;
LoadFileOption.Flags = ELO_USEIFD;
MyFile.GetInfo(&FileInfo, FILEINFO_TOTALPAGES, &LoadFileOption);
}

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

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 LoadXXX 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 a SaveXXX 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 LFile::Compact 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:

LFileSettings::PreLoadFilters

Call LFileSettings::GetPreLoadFilters to determine the current list of filters that LEADTOOLS should load. If LFileSettings::GetPreLoadFilters is called before LFileSettings::PreLoadFilters has ever been called, then LFileSettings::GetPreLoadFilters will retrieve the list of default filters.

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

LFileSettings::IgnoreFilters

Call LFileSettings::GetIgnoreFilters to determine the current list of file format filters LEADTOOLS does not load. If LFileSettings::GetIgnoreFilters is called before LFileSettings::IgnoreFilters has ever been called in an application, then the list retrieved by LFileSettings::GetIgnoreFilters will be empty.

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

Also, you can use LBase::LoadLibraries to control the LEADTOOLS DLLs that your application loads into memory.


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.

All of the class library save functions take a pSAVEFILEOPTION argument, which defaults to NULL.

When NULL is passed for this argument, the Passes field of the SAVEFILEOPTION structure defaults to 0, which means the file saved will not be progressive. Alternatively, you can do the following:

SAVEFILEOPTION SaveOption;

LBaseFile::GetDefaultSaveFileOption(&SaveOption);

//Set any of the SaveOption fields

//pass &SaveOption to any of the Save member functions

Since the default for Passes=0, the saved file will not be progressive.

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:

/*******************************************************************************************

1.

First, create a class that derives from LFile. This class will include an override for LFile::LoadFileCallBack.

//MyLFile.h
#ifndef _MY_LFILE_H
#define _MY_LFILE_H

#include "d:\lead14\dll\include\classlib\ltwrappr.h"

class LProgressiveFile : public LFile
{
LEAD_DECLAREOBJECT(LProgressiveFile);
private:
HWND m_hWnd;

protected:
virtual L_INT LoadFileCallBack(pFILEINFO
 pFileInfo, LBitmapBase L_FAR* pLBitmap, LBuffer L_FAR* pLBuffer, L_UINT
 uFlags, L_INT nRow, L_INT nLines);

public:
LProgressiveFile();
virtual ~LProgressiveFile();

L_VOID SetDisplayWnd(HWND hWnd);
L_INT LoadFile(L_INT nBitsPerPixel=0,
 L_INT nOrder=ORDER_BGRORGRAY, L_UINT uFlags=LOADFILE_ALLOCATE | LOADFILE_STORE,
 pLOADFILEOPTION pLoadFileOption = NULL);

L_INT SaveBitmap(L_INT nFormat, L_INT
 nBitsPerPixel=0, L_INT nQFactor=2, L_UINT uFlags=SAVE_OVERWRITE, pSAVEFILEOPTION
 pSaveFileOption = NULL);
};

#endif _MY_LFILE_H

2.

Now, implement the class member functions as follows:

//MyLFile.cpp
#include "MyLFile.h"

LEAD_IMPLEMENTOBJECT(LProgressiveFile)

LProgressiveFile::LProgressiveFile()
{
m_hWnd=0;
}

LProgressiveFile::~LProgressiveFile()
{
}

L_VOID LProgressiveFile::SetDisplayWnd(HWND hWnd)
{
m_hWnd=hWnd;
}

L_INT LProgressiveFile::LoadFile(L_INT nBitsPerPixel, L_INT nOrder, L_UINT
 uFlags, pLOADFILEOPTION pLoadFileOption)
{
L_BOOL bTemp;
L_INT nRet;
L_INT iOldPasses;
LOADFILEOPTION LoadFileOption;

if (pLoadFileOption == NULL)
{
LBaseFile::GetDefaultLoadFileOption(&LoadFileOption);
pLoadFileOption = &LoadFileOption;
}

iOldPasses = pLoadFileOption->Passes;
pLoadFileOption->Passes=CALLBACK_WHEN_MEANINGFUL;

if(!IsWindow(m_hWnd))
LEAD_ERROR_RETURN(WRPERR_INVALID_PARAMETERS);

bTemp=EnableCallBack(TRUE);
nRet=LFile::LoadFile(nBitsPerPixel,nOrder,uFlags, pLoadFileOption);
EnableCallBack(bTemp);
pLoadFileOption->Passes = iOldPasses;
return(nRet);
}

L_INT LProgressiveFile::SaveBitmap(L_INT nFormat, L_INT nBitsPerPixel,
 L_INT nQFactor, L_UINT uFlags, pSAVEFILEOPTION pSaveFileOption)
{
L_INT iOldPasses;
SAVEFILEOPTION SaveFileOption;

if(IsValid())
{
if (pSaveFileOption == NULL)
{
LBaseFile::GetDefaultSaveFileOption(&SaveFileOption);
pSaveFileOption =
 &SaveFileOption;
}

iOldPasses = pSaveFileOption->Passes;
pSaveFileOption->Passes=8;
}

L_INT nRet = LFile::SaveBitmap(nFormat,nBitsPerPixel,nQFactor,uFlags,pSaveFileOption);
pSaveFileOption->Passes = iOldPasses;
return nRet;
}

L_INT LProgressiveFile::LoadFileCallBack(pFILEINFO pFileInfo, LBitmapBase
 L_FAR* pLBitmap, LBuffer L_FAR* pLBuffer, L_UINT uFlags, L_INT nRow, L_INT
 nLines)
{
LBuffer LBufferExp;
HDC hDC;
RECT Rect;

if(!IsWindow(m_hWnd))
return(SUCCESS);

::GetClientRect(m_hWnd,&Rect);

if(uFlags&FILEREAD_COMPRESSED)
LBufferExp.ExpandRows(*pLBuffer,pLBitmap->GetWidth(),nLines);

hDC=::GetDC(m_hWnd);

pLBitmap->SetSrcRect(&Rect);
pLBitmap->SetClipSrcRect(&Rect);
pLBitmap->SetDstRect(&Rect);
pLBitmap->SetClipDstRect(&Rect);

pLBitmap->Paint()->SetDC(hDC);
pLBitmap->Paint()->PaintDCBuffer((uFlags&FILEREAD_COMPRESSED)
 ? LBufferExp : *pLBuffer, nRow, nLines);
pLBitmap->Paint()->SetDC(0);
Sleep(3);

::ReleaseDC(m_hWnd,hDC);
return(SUCCESS);
}

3.

Now, you can use the new class as follows:

L_VOID Example54(HWND hWnd, L_TCHAR L_FAR* szFilename)
{
LProgressiveFile ProgressiveFile;
LBitmapBase Bitmap;

//load the image
Bitmap.Load(szFilename);
ProgressiveFile.SetBitmap(&Bitmap);
ProgressiveFile.SetFileName(TEXT("d:\\progress.cmp"));

//save the image in progressive format (8 passes)
ProgressiveFile.SaveBitmap(FILE_CMP,24,PQ2);

::InvalidateRect(hWnd,0,TRUE);
::UpdateWindow(hWnd);
//set the window to be used for displaying the progressive
 image
ProgressiveFile.SetDisplayWnd(hWnd);

//load the progressive file
ProgressiveFile.LoadFile(0,ORDER_BGR,LOADFILE_ALLOCATE|LOADFILE_STORE);
}


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 LBitmapBase::ColorRes to reduce the image using an optimized palette.


Thumbnail Browser

LEADTOOLS Class Library 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 LFile::BrowseDir. The parameters passed to this function affect both the browse process and thumbnail characteristics. Thumbnails generated by this function are handled by the LFile::BrowseDirCallBack function.


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 LFile::GetInfo 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:

LFile::LoadFile

LFile::LoadFile

LFile::LoadOffset

LFile::StartFeedLoad

LMemoryFile::LoadMemory

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.

The LBitmapBase::ChangeCompression 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 LBitmapBase::Create or LBitmapBase::Allocate, 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:

LBitmapBase::GetRowColCompressed

LBitmapBase::PutRowColCompressed

LBitmapBase::GetRowCompressed

LBitmapBase::PutRowCompressed

LBuffer::ExpandRow

LBuffer::CompressRow

If you use the LFile::LoadFileCallBack 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 LBuffer::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 LPaint::PaintDCBuffer function's nCount parameter.


Implementing Screen Capture

Capturing Screen Images

LEADTOOLS supports a number of functions for capturing images from the screen. You can capture the entire screen , or you can elect to capture some small part of the screen. LScreenCapture::CaptureFullScreen lets you capture the entire screen, while LScreenCapture::CaptureActiveWindow lets you capture all of the active window. To capture just the client portion of the active window, use LScreenCapture::CaptureActiveClient. LScreenCapture::CaptureWindowUnderCursor captures the window immediately under the cursor, and LScreenCapture::CaptureSelectedObject captures an image of the selected window's object.

In addition, you can capture wallpaper, menus and the mouse cursor, using LScreenCapture::CaptureWallPaper, LScreenCapture::CaptureMenuUnderCursor and LScreenCapture::CaptureMouseCursor. To capture an area, use LScreenCapture::CaptureArea. LEADTOOLS provides two functions for capturing bitmaps, cursors and icons from EXEs or DLLs, LScreenCapture::CaptureFromEXE and LScreenCapture::CaptureFromEXEDlg. Finally, to stop a capture operation, use LScreenCapture::StopCapture.

Getting and Setting Capture Information

In addition to the capture functions given above, there are a number of functions for getting and setting capture information, and two overridables. These are as follows: LScreenCapture::CaptureAreaOptionDlg, LScreenCapture::GetCaptureOptions, LScreenCapture::CaptureGetResCount, LScreenCapture::SetCaptureOptions, LScreenCapture::SetCaptureOptionDlg, LScreenCapture::IsCaptureActive, LScreenCapture::ScreenCaptureCallBack, and LScreenCapture::CaptureHotKeyCallBack.


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

The following functions now take an optional pLOADFILEOPTION argument:

LAnnContainer::Load

LAnnContainer::LoadOffset

LFile::ReadLoadResolutions

LFile::FileConvert

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::GetInfo

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadFileTransforms

LFile::ReadTag

LFile::ReadStamp

LFile::StartFeedLoad

LFileSettings::GetLoadResolution

LMemoryFile::Decompress

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadComment

LMemoryFile::ReadTag

The following functions now take an optional pSAVEFILEOPTION argument:

LFile::FileConvert

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LMemoryFile::SaveBitmap

LFile::SaveFile

LFile::SaveTile

LFile::SaveOffset

LMemoryFile::StartCompressBuffer

LFile::WriteComment

LFile::WriteStamp


Implementing GeoKeys (GeoTIFF tags)

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

The GeoTIFF extra data is stored using six standard tags. The following three tags contain scaling information:

ModelTiepointTag = 33922 (0x8482)

ModelPixelScaleTag = 33550 (0x830E)

ModelTransformationTag = 33920 (0x8480)

The following three tags contain many extra values. We will refer to these values stored in these three tags as "GeoKeys":

GeoKeyDirectoryTag 34375 (0x87AF) – This tag will store all the keys and the SHORT values.

GeoDoubleParamsTag 34736 (0x87B0) – This tag will store the DOUBLE values.

GeoAsciiParamsTag 34737 (0x87B1) – This tag will store the ASCII values.

There are 65536 possible GeoKeys values. The GeoTIFF specification recommends you 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 LFile::SetGeoKey. These GeoKeys are maintained as a per-thread array of GeoKeys. You can obtain the list of GeoKeys that have been set using LFile::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: LFile::SaveFile, LFile::SaveBitmap, etc.
2. | You can update an existing file, using LFile::WriteGeoKey or LFile::WriteMetaData.

You can enumerate the GeoKeys from an existing file using LFile::EnumGeoKeys. For each GeoKeys enumerated by LFile::EnumGeoKeys, LFile::EnumGeoKeysCallBack function is called.

You can read a particular GeoKey from a file using LFile::ReadGeoKey.


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


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 LBitmap::WindowLevel 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.


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 LBaseFile::LoadInfoCallBack. To do this you must override LBaseFile::LoadInfoCallBack function. To get the user data previously set using LBaseFile::LoadInfoCallBack, use LFile::GetLoadInfoCallbackData. When calling the file load functions (LFile::LoadFile, LFile::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 LBaseFile::LoadInfoCallBack function.

Inside the LBaseFile::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 palletized 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 LBitmapBase object. 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 Class Library functions (LFile::SaveFile, LFile::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 LFile::SaveOffset.

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

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;

class LUserFile : public LFile

{

protected:

RAWLOADDATA m_RawData;

public:

void SetRawLoadData(LPRAWLOADDATA pRawData);

LUserFile();

~LUserFile();

L_INT LoadInfoCallBack(L_INT fd,pLOADINFO pInfo);

};

//////////////////////////////////////////////////////////////////////

// Construction/Destruction

//////////////////////////////////////////////////////////////////////

LUserFile::LUserFile()

{

ZeroMemory( &m_RawData, sizeof(RAWLOADDATA)) ;

}

LUserFile::~LUserFile()

{

}

void LUserFile::SetRawLoadData(LPRAWLOADDATA pRawData)

{

m_RawData.nWidth = pRawData->nWidth;

m_RawData.nHeight = pRawData->nHeight;

m_RawData.nBitsPerPixel = pRawData->nBitsPerPixel;

m_RawData.nViewPerspective = pRawData->nViewPerspective;

m_RawData.nOrder = pRawData->nOrder;

m_RawData.nOffset = pRawData->nOffset;

m_RawData.bPadding = pRawData->bPadding;

m_RawData.bReverseBits = pRawData->bReverseBits;

}

L_INT LUserFile::LoadInfoCallBack(L_INT fd,pLOADINFO pInfo)

{

UNREFERENCED_PARAMETER(fd);

pInfo->Format = FILE_RAW;

pInfo->Width = m_RawData.nWidth;

pInfo->Height = m_RawData.nHeight;

pInfo->BitsPerPixel = m_RawData.nBitsPerPixel;

pInfo->XResolution = 150;

pInfo->YResolution = 150;

pInfo->Offset = m_RawData.nOffset;

pInfo->Flags = 0;

if (m_RawData.bPadding)

pInfo->Flags |= LOADINFO_PAD4;

if (m_RawData.nOrder == ORDER_RGB)

pInfo->Flags |= LOADINFO_ORDERRGB;

if (m_RawData.bReverseBits)

pInfo->Flags |= LOADINFO_LSB;

switch(m_RawData.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;

}

//This example loads RAW data into a LEAD LBitmapBase object.

//Raw data parameters are set in the overridden LUserFile::LoadInfoCallBack function,

//which gets called when the file format is FILE_RAW, or any unrecognized file format.

//The LUserFile::LoadInfoCallBack obtains information through a user-defined structure.

//In this example it is RAWLOADDATA

L_INT LoadRawData(L_TCHAR *pszFile, LBitmapBase* pLEADBitmap, LPRAWLOADDATA pRawData)

{

L_INT nRet = FALSE ;

FILEINFO fileInfo;

LUserFile file;

memset(&fileInfo, 0, sizeof(fileInfo));

fileInfo.uStructSize = sizeof(fileInfo);

fileInfo.Format = FILE_RAW;

fileInfo.Flags = FILEINFO_FORMATVALID;

file.SetBitmap(pLEADBitmap);

file.SetFileName(pszFile);

file.SetRawLoadData(pRawData);

file.EnableLoadInfoCallBack(TRUE);

nRet = file.LoadFile( 0, ORDER_BGR, LOADFILE_ALLOCATE | LOADFILE_STORE, NULL, &fileInfo);

file.EnableLoadInfoCallBack(FALSE);

return nRet;

}

//This example saves a LEAD LBitmapBase object 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 pLEADBitmap.

//If pLEADBitmap 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, LBitmapBase* pLEADBitmap,

L_UINT32 uOffset, LUserFile& file)

{

SAVEFILEOPTION SaveFileOption;

L_INT nRet;

memset(&SaveFileOption, 0, sizeof(SaveFileOption));

SaveFileOption.uStructSize = sizeof(SaveFileOption);

SaveFileOption.Flags = ESO_PAD4 | ESO_REVERSEBITS;

file.SetBitmap(pLEADBitmap);

file.SetFileName(pszFileName);

file.EnableCallBack(FALSE);

if (uOffset == 0)

{

nRet = file.SaveFile( FILE_RAW, 0, 0, SAVEFILE_OPTIMIZEDPALETTE, &SaveFileOption);

}

else

{

HFILE hFile;

L_INT32 SizeWritten;

#ifdef UNICODE

hFile = _wcreat(pszFileName, 0);

#else

hFile = _lcreat(pszFileName, 0);

#endif

nRet = file.SaveOffset(hFile, uOffset, &SizeWritten, FILE_RAW, 0, 0, SAVEFILE_OPTIMIZEDPALETTE, &SaveFileOption);

_lclose(hFile);

}

return nRet;

}

void CAnasDemoView::OnSettxtoptionsTxt()

{

LBitmapBase LEADBitmap;

LUserFile LeadFile;

//LoadRawData(TEXT("C:\\Raw Data.raw"), &LEADBitmap);

JBIG2OptionsExample();

LoadTXTFile( TEXT("C:\\txt.txt"), &LeadFile, 50,

50, 50, 50);

}


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 LFile::ReadFileExtensions. The extensions are kept in an EXTENSIONLIST structure. When the LFile::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 LFile::LoadExtensionStamp function. To get embedded audio data, use the LFile::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 LFile::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 LFileSettings::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.

void CTt2View::TestFunction(HWND hWnd, L_TCHAR L_FAR* szFilename)
{
LBitmapBase LeadBitmap;

L_CHAR L_FAR * pCommentToGet; /* Comment string that we will get */
LBuffer CommentToGet; /* Handle for memory management */
L_INT CommentLength; /* Length of the string */
L_CHAR CommentToSet[80]; /* Comment string that we will set */
L_CHAR L_FAR * pCommentToSet = CommentToSet;
L_CHAR 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 szMessage2[256];
 /* MessageBox string */

L_INT i; /* Loop counter */
/* Load the bitmap */
LeadBitmap.Load(szFilename);
/* Load the current comments from the file */
for(i = 0 ; i < CMNT_LAST ; i++ )
{
/* Clear the comment */
LFileSettings::SetComment(i,NULL,0);
/* Use the return value to get the
 length of a comment in the file */
CommentLength=LeadBitmap.File()->ReadComment(i,0);
if(CommentLength>0)
{
/* Allocate and lock
 a zero-filled buffer for the comment */
CommentToGet.Reallocate(CommentLength);
/* Get the comment
 from the file */
LeadBitmap.File()->ReadComment(i,&CommentToGet);
/* Set the comment
 to be saved */
LFileSettings::SetComment(i,(L_UCHAR
 L_FAR*)CommentToGet.Lock(),CommentLength);
/* Unlock and free
 memory */
CommentToGet.Unlock();
}
}

   /* Reverse the image
 */
LeadBitmap.Reverse();
/* Create the CMNT_USERCOMMENT comment as a byte array
 */
LFileSettings::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 */
LFileSettings::SetComment(CMNT_USERCOMMENT,(L_UCHAR
 L_FAR*)pCommentToSet,
strlen(pUserComment) + 9);
/* Save the image as an Exif file */
LeadBitmap.Save(FILE_EXIF,24,0, NULL, 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=LeadBitmap.File()->ReadComment(CMNT_SUBJECTDISTANCE,0);

if(CommentLength>0)
{
/* Allocate and lock a zero-filled
 buffer for the comment */
CommentToGet.Reallocate(CommentLength);
/* Get the actual comment from the
 file */
LeadBitmap.File()->ReadComment(CMNT_SUBJECTDISTANCE,&CommentToGet);
pDistance = (L_UINT32 L_FAR *)CommentToGet.Lock();
Numerator = pDistance[0];
Denominator = pDistance[1];
fDistance = (float)Numerator / (float)Denominator;
wsprintf (szMessage,TEXT("Subject
 distance: %.6f\n"),fDistance );

CommentToGet.Unlock();
}
/* Use the return value to get the length of the CMNT_USERCOMMENT
 comment */
CommentLength=LeadBitmap.File()->ReadComment(CMNT_USERCOMMENT,0);
if (CommentLength > 0)
{
/* Allocate and lock a zero-filled
 buffer for the comment */
CommentToGet.Reallocate(CommentLength);
/* Get the actual comment from the
 file */
LeadBitmap.File()->ReadComment(CMNT_USERCOMMENT,&CommentToGet);
/* If the prefix is ASCII, move the
 pointer and update the message string */
pCommentToGet=(L_CHAR L_FAR*)CommentToGet.Lock();
if (strcmp(pCommentToGet,"ASCII")==
 0)
{
pCommentToGet = pCommentToGet
 + 8;
}

               wsprintf(szMessage2,TEXT("%s%hs"),szMessage,
 pCommentToGet);
/*
 Unlock and free memory */
CommentToGet.Unlock();
}
/*
 Show the two comments */
::MessageBox
 (NULL,szMessage2, TEXT("Notice"), MB_OK);
/*
 Clear the comments */
for(i
 = 0 ; i < CMNT_LAST ; i++ )
LFileSettings::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 Module 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 module 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 each FlashPix Module you license, you are limited to 25 copies of your application.

To use the extended FlashPix functions, LSettings::UnlockSupport must be called with the key found on the FlashPix Module Certificate, included in your product packaging. LSettings::UnlockSupport(L_SUPPORT_FPXEXTENSIONS, "FlashPix Module Certificate key") tells the package to unlock support for the FlashPix extended support functions and passes the key for verification. If the wrong key is passed, calls to these functions will result in ERROR_FPXEXTENSIONS_LOCKED. 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 LFileSettings::SetComment. Once all comments are set, the comments are saved using any function which saves files, such as LFile::SaveFile or LFile::SaveBitmap when creating a new file, or LFile::WriteComment when changing a comment in an existing file. LFileSettings::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 Module 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 LFile::GetCommentSize and LFile::ReadCommentExt, 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 LFile::ReadComment 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 LFile::ReadComment function.

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 LFile::WriteComment in this package, as outlined above and 2) the LFile::GetCommentSize only works 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 LFile::LoadTile 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 LFile::SaveTile.

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 LFile::ReadStamp. To save a stamp into an already existing FlashPix file, use LFile::WriteStamp. 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, LFile::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.

To store transforms in a FlashPix file, set the appropriate variables in an instance of FILETRANSFORMS to the desired values and use LFile::WriteFileTransforms to write them to the FlashPix file. For an example using both LFile::ReadFileTransforms and LFile::WriteFileTransforms, see "Example" under the LFile::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 EFO_IGNOREVIEWTRANSFORMS and the EFO_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 EFO_IGNOREVIEWTRANSFORMS flag, and clear the EFO_IGNORECOLORTRANSFORMS flag. To load the image with only the effects of the viewing transforms incorporated, you must set the EFO_IGNORECOLORTRANSFORMS flag and clear the EFO_IGNOREVIEWTRANSFORMS flag. Finally, to load the image with both the color transforms and the view transforms incorporated, clear both the EFO_IGNOREVIEWTRANSFORMS and the EFO_IGNORECOLORTRANSFORMS flags. Examples of all four of these options are available in "Example" under LFile::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 LFileSettings::GetComment, LFileSettings::SetComment, LFile::ReadComment, and LMemoryFile::ReadComment functions. In these functions, only the CMNT_SZDESC type of comment is supported.

In a multipage 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 LFile::LoadFile function.

To save a GIF file as an interlaced file, use the SAVEFILEOPTION structure 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 LFile::ReadLoadResolutions function to examine which sizes are available in a file. You can then use the LFileSettings::SetLoadResolution function to specify which size to load. (The LFileSettings::GetLoadResolution function only gets the last width and height values that were set with the LFileSettings::SetLoadResolution function.). When saving a file, you can use LFileSettings::SetSaveResolution to set resolutions for the next save operation . If you want to get the information saved by the last call to LFileSettings::SetSaveResolution, you can use LFileSettings::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 LFile::LoadFileCallBack 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 is the number of resolutions present in the file) then the LFile::LoadFileCallBack 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, LSettings::UnlockSupport must be called with the key found on the JBIG Module Certificate, which will be e-mailed to you. LSettings::UnlockSupport(L_SUPPORT_JBIG, "JBIG Certificate key") tells the package to unlock JBIG support and passes the key for verification. For more information about required files, refer to Files To Be Included With Your Application.


Implementing 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 LFileSettings::GetJ2KOptions function. To change the JPEG 2000 features, use the LFileSettings::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 JPEG2000 features, use the LFileSettings::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.

Please note that LEAD also offers the LEADTOOLS JPEG 2000 COM Object for IE, which lets you view JPEG 2000 images in ActiveX enabled web browsers, such as Internet Explorer. For more information, refer to LEADTOOLS JPEG 2000 COM Object for IE in the Products help file.


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

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.

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 that has been 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 LFileSettings::GetPDFSaveOptions. To set the options used when saving a PDF file, call LFileSettings::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 LFileSettings::GetPCDResolution function to examine which of the fixed sizes are available in a file. You can then use the LFileSettings::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 LFile::ReadLoadResolutions function to examine which sizes are available in a file. You can then use the LFileSettings::SetLoadResolution function to specify which size to load. (The LFileSettings::GetLoadResolution function only gets the last width and height values that were set with the LFileSettings::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 LFile::GetInfo 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 LBaseFile::EnableRedirectIO or LFile::FeedLoad to load one of these files.

Although you can load PhotoCD files on WIN32 systems, you cannot load them with the WIN32 toolkit on a WIN32s system (which implements 32-bit applications on a 16-bit system).

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 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 LMarker::Load. Although TIFF files do not support markers, LEADTOOLS provides limited support through the use of APP1 Exif markers. When you call LMarker::Load 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 LMarker::Create function lets you create a collection of markers from scratch. You can then insert markers with LMarker::Insert. After you call LMarker::Insert once, you can call LMarker::Enum and insert markers using LMarker::EnumMarkersCallBack.

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

Please note that both the LMarker::SetAsGlobalMarkers and LMarker::GetGlobalMarkers functions use copies of the list of markers. Therefore, the resources associated with these lists of markers should be freed by calling LMarker::Free when the markers are no longer needed.

Markers set using LMarker::SetAsGlobalMarkers can also be written to files using the LFile::WriteComment and LFile:WriteTag functions. The comments or tags being written by these two functions will overwrite any similar comments or tags contained in the markers. The LFile::WriteMetaData function can also be used to write markers, tags and comments to a file. To summarize:

This function: | will write this type of data
LFile::WriteComment | Comments and Markers
LFile::WriteTag | Tags and Markers
LFile::WriteMetaData | Comments, Tags and Markers

Markers are generally modified by deleting all markers of a certain type. To delete all markers of a certain type, use the LMarker::Delete function. To delete a marker at a given index, use LMarker::DeleteIndex. A marker can also be deleted by using LMarker::Enum to delete the specific marker or create a new marker collection using LMarker::Create and insert all markers except the marker to be deleted.

The LMarker::Enum 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 LMarker::Enum, an LMarker::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 LMarker::Enum function. To insert a new marker in a marker collection, use LMarker::Insert.

To determine how many markers are in a collection, call LMarker::GetCount.

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


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 LFileSettings::SetComment and LFileSettings::GetComment functions. To read a comment from an existing file, you can use LFile::ReadComment or LMemoryFile::ReadComment. To read a comment from a file at a specified location, use the LFile::ReadCommentOffset function. 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 LFileSettings::SetTag and LFileSettings::GetTag functions. To load the tagged data from a file, you can use LFile::ReadTag or LMemoryFile::ReadTag. To write tags to an existing file, or to change existing tags in a file, use LFile::WriteTag.

LFile::EnumTags enumerates all tags in a TIFF or Exif file. For each tag enumerated, the LFile::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 LFile::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 LIsis::GetTagASCII and LIsis::SetTagASCII. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For more 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 LIsis::GetTagLong and LIsis::SetTagLong. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For more information on using ISIS, refer to Using ISIS to Scan Images.

Value | Meaning
TAG_XRESOLUTION | [0x011A] Gets or sets the horizontal resolution in PixelsPerInch.
TAG_YRESOLUTION | [0x011B] Gets or sets the vertical resolution in PixelsPerInch.
TAG_FEEDER | [0x0503] [Read Only] Gets information about the scanner's flatbed and/or feeder. Values may be:
 | TAG_FEEDER_FEED [0x00000001L] Scanner has feeder.
 | TAG_FEEDER_FLAT [0x00000002L] Scanner has flatbed.
 | TAG_FEEDER_TELLFLAT [0x00020000L] Can detect page on flatbed.
 | TAG_FEEDER_TELLFEED [0x00010000L] Can detect page in feeder.
 | TAG_FEEDER_TELLSCAN [0x00040000L] Can only detect by committing.
 | TAG_FEEDER_CENTERFEED [0x00080000L] Can center page in feeder.
 | TAG_FEEDER_CENTERFLAT [0x00100000L] Can detect if page is centered in flatbed.
TAG_XPOSITION | [0x011E] Gets or sets distance from left edge of page to start of image in pixels.
TAG_YPOSITION | [0x011F] Gets or sets distance from top edge of page to start of image in pixels.
TAG_IMAGELENGTH | [0x0101] Gets or sets the number of rows (height) of the image in pixels.
TAG_IMAGEWIDTH | [0x0100] Gets or sets the number of columns (width) of the image in pixels.


ISIS short tags

These ISIS Scanner Driver Tags are used to retrieve and set information concerning the scanner. They are retrieved and set using LIsis::GetTagShort and LIsis::SetTagShort. Possible tags are given below. Not all tags are supported by all drivers and not all possible values are supported by all drivers. For more 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 LBitmap::AddMessage function. A message that has been added using the LBitmap::AddMessage function can be retrieved using the LBitmap::ExtractMessage.


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

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 LFileSettings::SetComment function. LFileSettings::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 LFile::SaveFile or LFile::SaveBitmap., or in an already existing file, using LFile::WriteComment.

In the LEADTOOLS extended FlashPix support, you have the option of reading single comments, groups of comments, multiple groups of comments, or all comments. (See "Example" under LFile::ReadCommentExt.) 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
CR | computed radiography
CT | computed tomography
DS | digital subtraction angiography
MR | magnetic resonance
NM | nuclear medicine
US | ultrasound
OT | other
AS | angioscopy
BI | biomagnetic imaging
CD | color flow doppler
CF | cinefluorography
CP | culposcopy
CS | cystoscopy
DD | duplex doppler
DF | digital fluoroscopy
DG | diaphanography
DM | digital microscopy
EC | echocardiography
ES | endoscopy
FA | fluorescein angiography
FS | fundoscopy
LP | laparoscopy
LS | laser surface scan
MA | magnetic resonance angiography
MS | magnetic resonance spectroscopy
PT | positron emission tomography
RG | radiographic imaging
ST | single photon emission computed tomography
TG | thermography
VF | videofluorography


Exif File Comments

When reading or updating Exif comments, you must specify the comment type using the following constants.

For a loop counter:

Value | Meaning
CMNT_LAST | Last defined number for comments. To get all comments, you can use the comment type constant as a loop counter. The first constant is 0 and the last is CMNT_LAST.

TIFF comments in Exif files: All Exif files (TIFF and JPG) can contain the following TIFF comments. Each TIFF comment field can contain a character string. The maximum field size is 32K, except for the date-time field, which is always 20.

Value | Meaning
CMNT_SZARTIST | [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.


CFA

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
1 | BYTE | CFA[0,0]
1 | BYTE | CFA[0,1]
: | : | :
1 | BYTE | CFA[0,n-1]
1 | BYTE | CFA[1,0]
: | : | :
1 | BYTE | CFA[1,n-1]
: | : | :
1 | BYTE | CFA[m-1,n-1]

where CFA[i,j] is the color filter value for row i, col j and can have one of these values:

CFA value | Filter color
0 | RED
1 | GREEN
2 | BLUE
3 | CYAN
4 | MAGENTA
5 | YELLOW
6 | WHITE


OECF

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
Any | ASCII | first column item name (NULL terminated)
: | : | :
Any | ASCII | last column item name (NULL terminated)
8 | SRATIONAL | OECF[0,0]
8 | SRATIONAL | OECF[0, 1]
: | : | :
8 | SRATIONAL | OECF[0,n-1]
: | : | :
8 | SRATIONAL | OECF[m-1,0]
8 | SRATIONAL | OECF[m-1,1]
: | : | :
8 | SRATIONAL | OECF[m-1,n-1]

where OECF[i,j] is the OECF coefficient for row i, column j


SFR

Length(bytes) | Type | Meaning
2 | SHORT | Columns = n
2 | SHORT | Rows = m
Any | ASCII | first column item name (NULL terminated)
: | : | :
Any | ASCII | last column item name (NULL terminated)
8 | RATIONAL | SFR[0, 0]
8 | RATIONAL | SFR[0, 1]
: | : | :
8 | RATIONAL | SFR[0, n-1]
: | : | :
8 | RATIONAL | SFR[m-1, 0]
8 | RATIONAL | SFR[m-1, 1]
: | : | :
8 | RATIONAL | SFR[m-1,n-1]

where SFR[i,j] is the SFR coefficient for row i, column j


Notes on Exif Data Types

The Exif standard defines the following data types for comments. Usage is dependent of your development system. To see the usage, refer to the code example for your system.

Data type | Description
UNDEFINED | The data type is determined by the field.
SHORT | Integer.
LONG | Long integer.
ASCII | Character string.
BYTE | Array of bytes.
RATIONAL | An array of two unsigned long integers that express a fraction. The first value is the numerator, and the second is the denominator. (Visual Basic does not recognize unsigned long integers and will interpret large values, as negative values.)
SRATIONAL | An array of two signed long integers that express a fraction. The first value is the numerator, and the second is the denominator.

The length of a comment is based on the data type. For example, an SRATIONAL with a length of 3 is an array of 6 long integers.

When you set a comment that requires an array, the array can be zero-based or 1-based (where the first element has an index of 1). When you get a comment that is an array, it will always be zero-based (where the first element has an index of 0).

When you assign comments, the ActiveX does data type conversions for you. For example, if a comment is a RATIONAL with a length of 3, you can assign an array of six integers. If you assign an invalid value, the value is ignored.


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

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.

You can also use the high-level classes LBitmapWindow, LAnimationWindow, and LAnnotationWindow to display images. These classes create a window and do all of the processing required to implement displaying an image for you, including zooming, scrolling palette changes, and special effects.

To control bitmap display settings, refer to Using Global / Local Settings for Bitmap Objects


Fitting an Image to a Window

If you are using the high-level LBitmapWindow (or derived) class, you can use the LBitmapWindow::SetZoomMode function to zoom an image in the following manners:

ZOOM_FIT | to fit the bitmap in the window while maintaining the aspect ratio.
ZOOM_STRETCH | to stretch the bitmap to the window.
ZOOM_NORMAL | to display the bitmap in its normal size.
ZOOM_FITWIDTH | to fit the bitmap to the width of the window.
ZOOM_FITHEIGHT | to fit the bitmap to the height of the window.

You can also use LBitmapWindow::FitToParent to fit the class object's window to it's parent.

If you are not using LBitmapWindow, 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 show how this can be done.

LBitmapBase LeadBitmap; //bitmap
 for the loading image

RECT rWndSize;
RECT rClientSize;
RECT rLeadDest;
L_INT WidthAllowed;
L_INT HeightAllowed;
L_INT WidthFactor;
L_INT HeightFactor;
L_INT Left, Top, Width, Height;
L_INT nRet;

/* Load the LEAD DLLs */
LBase LeadBase;
LeadBase.LoadLibraries(LT_ALL_LEADLIB);

/* Load an image */
nRet = LeadBitmap.Load(TEXT("v:\\images\\eagle.cmp"), 8);

/* Get the current window size and client area */
::GetWindowRect(this->m_hWnd, &rWndSize);
::GetClientRect(this->m_hWnd,&rClientSize);

/* Use this to fit the displayed image in the client area. */
WidthAllowed = rClientSize.right;
HeightAllowed = rClientSize.bottom;
WidthFactor = LeadBitmap.GetWidth();
HeightFactor = LeadBitmap.GetHeight();

/* 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 = 0;
}
else
{

   /* Use the
 maximum height, and calculate the width and left values */
Top = 0;
Height = HeightAllowed;
Width = MulDiv(Height, WidthFactor, HeightFactor);
Left = 0;
}

RECT rc;
/* Set the source rectangle to use the whole bitmap */
SetRect(&rc, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());
LeadBitmap.SetSrcRect(&rc);
/* Set the source clipping rectangle to use the whole bitmap */
LeadBitmap.SetClipSrcRect(&rc);
/* Set the destination rectangles */
SetRect(&rLeadDest, Left, Top, Width, Height);
LeadBitmap.SetDstRect(&rLeadDest);
LeadBitmap.SetClipDstRect(&rLeadDest);

/* paint the image */
HDC hDC = ::GetDC(this->m_hWnd);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.Paint()->PaintDC();
::ReleaseDC(this->m_hWnd, hDC);


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.

If you are using the high-level LBitmapWindow (or derived) class, scrolling is handled automatically for you. You can enable/disable scrolling using the LBitmapWindow::EnableAutoScroll function.

If you are not using LBitmapWindow, the following instructions describe how to implement scrollbars, turning them on when they are required and turning them off when they are not.

1. | Modify the window style for your window to include the WS_VSCROLL and WS_HSCROLL styles.
2. | Add variables to your program that track the scroll range and position.
3. | In your function for processing the WM_SIZE message, you can add code to show or hide the scrollbars, as needed, and adjust the scrollbar ranges and positions.
4. | In your functions for processing WM_HSCROLL and WM_VSCROLL messages, add this code.


Setting Rectangles

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.


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.

If you are using the high-level LBitmapWindow (or derived) class, you can use the LBitmapWindow::HandlePalette function to make handling palette change issues easy. This will allow the class object to do all the required processing for you.

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:

LBitmapSettings::SetDisplayMode (DISPLAYMODE_FIXEDPALETTE, DISPLAYMODE_FIXEDPALETTE);

The following code turns off the LEAD fixed palette:

LBitmapSettings::SetDisplayMode (DISPLAYMODE_FIXEDPALETTE, 0);

2.

Create the paint palette. The LBitmapBase::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 */
LBitmapBase LeadBitmap; /* Bitmap for the loaded image. */
HPALETTE hpalPaint; /* Paint palette handle. */
HDC hdc; /* Device context */
hdc = GetDC (hWnd);
hpalPaint = LeadBitamp.CreatePaintPalette(hdc);

3.

Select and realize the system palette, using the palette handle returned by the LBitmapBase::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.

LeadBitmap.Paint()->SetDC(hdc);
LeadBitmap.Paint()->PaintDC ();

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


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.


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

LBitmapBase::ColorRes 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.


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 EFO_ROTATED flag set in the LOADFILEOPTION structure, or if you use the LBitmapBase::RotateViewPerspective 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 LBitmapBase::GetPixelColor function to get the color at the current mouse position. Because LBitmapBase::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:

LBitmapBase::PointFromBitmap

LBitmapBase::PointToBitmap

LBitmapBase::RectFromBitmap

LBitmapBase::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:

LBitmapBase::ChangeViewPerspective


Zooming In on a Selection

If you are using the high-level LBitmapWindow (or derived) class, zooming in on a selection is done automatically for you when you set the tool to TOOL_ZOOMRECT using LBitmapWindow::SetToolType. The class object will automatically handle the mouse events for you, and adjust the bitmap's display rectangles in order to zoom in on the user-defined rectangle.

If you are not using LBitmapWindow, 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 LPaint::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.

1. | Add this code to load an image and init the display rectangles.
2. | Add these global variables for tracking coordinates to your program.
3. | Add this 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.
4. | Add this code to process WM_MOUSEMOVE messages. This code outlines the selection using GDI functions.
5. | Add this code to process WM_LBUTTONUP messages. This code defines the source and destination rectangles for painting, and forces a repaint (CalcDisplay is defined below).
6. | Add this code to process WM_RBUTTONDOWN messages. This code returns to the display of the full image when the user clicks the right mouse button.
7. | Add this code to process WM_PAINT messages. This code sets the bitmap rectangles and paints the image.


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 LPaintEffect::PaintBitmap, 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 LPaint::PaintRgnDC function paints only the region that is defined for a bitmap. The LBitmapBase::Combine 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 LBitmapRgn::CreateMaskFromBitmapRgn function, which you can save in the alpha channel of a 16- or 32-bit file. Refer to the LBitmapBase::SetAlpha 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.

(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. By default the transparent color is white (0x00FFFFFF). Use the following functions to work with transparent colors:

LAnnPoint Class:

LAnnPoint::GetTransparentColor

LAnnPoint::GetTransparent

LAnnPoint::SetTransparentColor

LAnnPoint::SetTransparent

LAnnStamp Class:

LAnnStamp::GetTransparentColor

LAnnStamp::GetTransparent

LAnnStamp::SetTransparentColor

LAnnStamp::SetTransparent

LAnnAutomation Class:

LAnnAutomation::GetTransparentColor

LAnnAutomation::SetTransparentColor

LAnnContainer Class:

LAnnContainer::SetTransparent

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

void TestFunction(HWND hWnd)
{
LBitmapWindow Image;
LBitmapBase MaskBitmap,AlphaBitmap,DstBitmap;
int nRet;

Image.SetWndHandle(hWnd);
Image.Load(TEXT("c:\\parrots.jpg"));

/* Specify a rectangle to define the region */
RECT Rect={10,10,50,200};
LBitmapRgn Region(&Image);

// check if the bitmap region is valid or not
if (Region.IsValid() ==
 FALSE)
Region.SetBitmap(&Image)
 ;

/* Create an elliptical region in the AlphaBitmap */
Region.SetRgnEllipse(&Rect);

/* Create a mask bitmap from the region */
nRet = Region.CreateMaskFromBitmapRgn(&MaskBitmap,
 sizeof(BITMAPHANDLE)) ;

/* Update the alpha channel in the main bitmap */
Image.SetAlpha(MaskBitmap);

/* Save the bitmap at 16 bits per pixel to keep the alpha channel */
Image.Save(TEXT("c:\\Test.Tif"),
 FILE_TIF, 16, 0,1, 0);

/* Load the bitmap that we just saved and get its alpha channel */
Image.Load(TEXT("c:\\Test.Tif"));
AlphaBitmap.CreateAlphaBitmap(Image);

DstBitmap.Create(AlphaBitmap.GetWidth(), AlphaBitmap.GetHeight(), 24, ORDER_BGR,
 NULL, TOP_LEFT, TYPE_CONV);
nRet = DstBitmap.FeatherAlphaBlend(0,
 0, AlphaBitmap.GetWidth(),
 AlphaBitmap.GetHeight(),
&Image, 0, 0, &MaskBitmap);

Image.SetHandle(DstBitmap.GetHandle());
}


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, LBitmapBase::FeatherAlphaBlend 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 CreateAlphaBitmap to get the alpha channel information back into a bitmap form. Once the transparency mask information is in a bitmap, it can be passed directly to the FeatherAlphaBlend 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 the 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 Class library annotation demo (either clanno32.exe for the Microsoft platform, or BCLAnnot.exe for the Borland platform)
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.

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

To use double buffering, first you must create a double buffer handle using LDoubleBuffer::CreateHandle. 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 LDoubleBuffer::Begin and LDoubleBuffer::End calls.

The LDoubleBuffer::Begin call returns a memory hDC. All subsequent paint operations should use this hDC for painting. To render the contents of the memory hDC, call LDoubleBuffer::End.

The LDoubleBuffer::Begin and LDoubleBuffer::End 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 LDoubleBuffer::EnableDoubleBuffer 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 LDoubleBuffer::End.

When you are finished double buffering, call LDoubleBuffer::DestroyHandle to free the internally allocated resources.


Overlay Overview

General info

Every bitmap can have up to MAX_OVERLAYS + 1 (17) overlay bitmaps. Each overlay is a 1-bit image. 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 0-based indexes (the index of the first entry is 0).

For each overlay, the overlay pixels with value of 0 are considered transparent.

For each overlay, the overlay pixels with value of 1 are considered non-transparent and will be painted with a certain color picked by the user.

The overlays can be painted automatically by the LPaint::PaintDC function or you can paint them using LPaint::PaintDCOverlay. The LPaint::PaintDC function 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 LPaint::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 LPaint::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 LPaint::PaintDC functions or not. If set, LPaint::PaintDC will automatically paint this overlay. If not set, LPaint::PaintDC will not automatically paint this overlay. In this case, you might want to paint the overlay manually, using LPaint::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 tells 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 ROI area.
ROIMean | ROI Mean.
ROIStandardDeviation | ROI standard deviation.
NumFramesInOverlay | Number of frames in overlay. Required if overlay data contains multiple frames.
ImageFrameOrigin | Frame number of multi-frame image to which this overlay applies; frames are numbered from 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 bitmap is freed.

You set the attributes for a certain overlay index with LBitmap::SetOverlayAttributes. You can change one or more attributes at a time.

You can get the attributes for a certain overlay index with LBitmap::GetOverlayAttributes. You can find out how many overlays have been defined by calling LBitmap::GetOverlayCount.

The overlay bitmaps are independent of the main bitmap. Separate memory is allocated for each overlay bitmap.

You can set the overlay bitmap in two ways:

1. | Call LBitmap::SetOverlay and pass the overlay bitmap.
2. | Have LEADTOOLS generate an overlay bitmap for you from the bits of a certain bitplane from the main bitmap by calling LBitmap::UpdateOverlayBits and setting the SETOVERLAYBITS_FROMBITMAP flag.

You can get the overlay bitmap by calling LBitmap::GetOverlay.

You can update the corresponding bitplane in the main bitmap with the bits from the overlay bitmap by calling LBitmap::UpdateOverlayBits and setting the SETOVERLAYBITS_FROMOVERLAY flag. A typical use of this is if you want to make sure a certain bitplane is preserved by an image processing function. If you want to prevent a certain image processing function from affecting a bitplane, you can:

get the bitplane into an overlay bitmap with LBitmap::UpdateOverlayBits(…, SETOVERLAYBITS_FROMBITMAP);

apply the image processing

restore the desired main bitmap bitplane with LBitmap::UpdateOverlayBits(…, SETOVERLAYBITS_FROMOVERLAY);

In order to preserve the whole bitplane, you must 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 – Left offset. The display width depends on the bitmap’s ViewPerspective 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 – top offset.

You can change the size of the overlay bitmap by calling LBitmap::SetOverlay. Note that you can call LBitmap::SetOverlay 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 LPaintEffect::PaintBitmap or LPaintEffect::EffectBlt, 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:

LPaintEffect::DrawPattern 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.)

LPaintEffect::DrawGradient lets you paint a rectangle with a 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.)

LPaintEffect::PaintTransition lets you paint a rectangle with a 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 or unrotated text using LPaintEffect::Draw3dText or LPaintEffect::Draw3dText. You can 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 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.

The angle of rotation.

Painting a Frame

You can use LPaintEffect::DrawFrame 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 LPaintEffect::Draw3dShape 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.

You can also use the high-level class LBitmapWindow to implement special effects. This class creates a window and does all of the processing required to implement special effects. You control the effects using various member functions of LBitmapWindow.


Using the ImageList Control

LEADTOOLS Class Library provides an ImageListControl class that lets you display and manipulate a list of images. The ImageListControl functions let you do the following with a list of images:

To create the control, use the following function:

LImageListControl::CreateControl

You can get or set item options, display options, and scroll options using the following:

LImageListControl::EnableKeyboard

LImageListControl::GetBackColor

LImageListControl::GetBorderColor

LImageListControl::GetFirstVisible

LImageListControl::GetItemOptions

LImageListControl::GetScrollStyle

LImageListControl::GetSelectionOptions

LImageListControl::GetViewSize

LImageListControl::SetBackColor

LImageListControl::SetBorderColor

LImageListControl::SetItemOptions

LImageListControl::SetScrollStyle

LImageListControl::SetSelectionBitmap

LImageListControl::SetSelectionOptions

To enable or disable keyboard processing, use the following:

LImageListControl::EnableKeyboard

To get information about items in the list, or to perform operations on items in the list, LEADTOOLS provides the following:

LImageListControl::Clear

LImageListControl::DrawItem

LImageListControl::EnsureVisible

LImageListControl::ExportBitmapList

LImageListControl::GetColumnCount

LImageListControl::GetItem

LImageListControl::GetItemCount

LImageListControl::GetRowCount

LImageListControl::GetSelectCount

LImageListControl::GetSelectedItems

LImageListControl::HitTest

LImageListControl::ImportBitmapList

LImageListControl::Insert

LImageListControl::Remove

LImageListControl::ScrollItems

LImageListControl::SelectAll

LImageListControl::Sort

LImageListControl::SortExt

LImageListControl::Update

For customizing message handling and item selection, use the following:

LImageListControl::ItemSelected

LImageListControl::MsgProcCallBack


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.


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:

LBitmapWindow::CreatePanWnd

LBitmapWindow::DestroyPanWnd

LBitmapWindow::UpdatePanWnd

LBitmapWindow::PanWndCallBack


Using the Magnifying Glass

LEADTOOLS provides a "magnifying glass" for the LBitmapWindow class. This magnifying glass provides a means of "zooming in" on the image loaded into an LBitmapWindow object.

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.

Use the "Magnifying Glass" if you want to:

control the painting options for the zoomed display.

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

The magnifying glass options and the zoomed display options are set using a MAGGLASSDATA structure. To use the magnifying glass, call the LBitmapWindow::GetMagGlassOptions function to get the current magnifying glass options. Next call the LBitmapWindow::SetMagGlassOptions function to set any new magnifying glass options to be used. Then call LBitmapWindow::SetToolType to set the tool type to TOOL_MAGGLASS. As the magnifying glass is moved over an image, the zoomed - in view is also displayed. To determine whether a class object has a magnifying glass attached to it, call the LBitmapWindow::IsToolTypeMagGlass function. The following can be set in a MAGGLASSDATA structure:

size of the magnifying glass

shape of the magnifying glass

magnifying glass border (color, thickness, appearance)

magnification level

paint characteristics

section of the pixel on which to center the zoomed image

color masks

When the magnifying glass is no longer needed, just change the tool type using LBitmapWindow::SetToolType.


Vector Images

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

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

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D

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 LFileSettings::GetAutoCADFilesColorScheme. To set the color shceme to use, call LFileSettings::SetAutoCADFilesColorScheme.


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 = GetPixelColor(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);
}


Using the Zoom View

Note:

This topic is for Document/Medical only.

LEADTOOLS provides a "zoomed view" that can be attached to a Bitmap Window. 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.

Note that LEADTOOLS also provides a "magnifying glass" that can be attached to a window handle. Use the "Magnifying Glass" if you want to:

control the painting options for the zoomed display.

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

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

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.

To attach the zoomed view to a Bitmap window, call the LBitmapWindow::AddZoomView function. To determine whether a window has a zoomed view attached to it, call the LBitmapWindow::HasZoomView 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 LBitmapWindow::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 the LBitmapWindow::UpdateZoomView function.

To update the Zoom View with a new destination rectangle, call the LBitmapWindow::UpdateZoomView function.

The LBitmapWindow::AddZoomView function lets you set all of the properties of a zoomed view through the ZOOMVIEWPROPS structure.

The LBitmapWindow::EnableHiliteZoomView enables or disables "highlighting" of the zoom view source area in the underlying image of the LBitmapWindow when zoom views are displaying.

The LBitmapWindow::IsHiliteZoomViewEnabled determines whether the underlying image for the LEADRasterView is "highlighted" in the source area when a zoom view is enabled

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

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


Implementing Animation

If you are using the LAnimationWindow (or derived) class, the class object will perform all of the processing required to implement animation for you.

Alternatively, 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 LFile::LoadBitmapList.
2. | Use LBitmapBase::Create to create a target bitmap that is the size of the images in the bitmap list.
3. | Use LPlayBack::Create 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 LPlayBack::Process to process the current state and get the next state of the playback.
b. | Use LPlayBack::GetUpdateRect to get the update rectangle (the portion of the target bitmap that has changed).
c. | Use LPaint::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 LFile::GetInfo 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 LFile::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 LFile::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
LPlayBack::Process | 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.
LPlayBack::Append | This example plays an animated GIF or AVI file as it loads the file. The example includes both the calling function and the LFile::LoadFileCallBack function, which displays the image.
LBitmapList::Create | 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.
LBitmapList::GetItem | 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.

You can also use the high-level class LAnimationWindow to implement animation. This class creates a window and does all of the processing required to implement animation for you.


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 Transition Filling Styles

The following are possible values for the LPaintEffect::PaintTransition 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 Gradient Styles

The following are possible values for the LPaintEffect::DrawGradient 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 Types

The following are possible values for the effect that can be applied
 by LPaintEffect::EffectBlt,
 LPaintEffect::PaintBitmap,
 LPaintEffect::PaintTransition,
 or LPaintEffect::PaintRgnDCEffect:

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.


Effect Text Style Flags

The following are possible values for the text style that can be applied by LPaintEffect::Draw3dText:

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 Text Alignment Flags

The following are possible values for the text alignment that can be applied by LPaintEffect::Draw3dText:

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 Shapes

The following are possible shapes that you can paint using the LPaintEffect::Draw3dShape 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_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 Background Styles

The following are possible background styles that you can specify when using the LPaintEffect::Draw3dShape 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


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


Compression Quality Factors

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

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

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

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

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

For JP2 and J2K files, the qFactor can be a value between –1 and 255. –1, and 0 represent lossless compression, while all the values between 1 and 255 are considered as compression ratios. For example a qFactor of 10 is a compression ratio of 10. A qFactor of 1 gives the best lossy quality, while a qFactor of 255 gives the highest compression. If the compression control used by the toolkit when saving J2K files is J2K_COMPRESSION_QFACTOR, then the compression used is based on the Qfactor passed to the SaveXXX function. For more information about setting the options for saving J2K files, refer to the FILEJ2KOPTIONS structure, LFileSettings::GetJ2Koptions, or LFileSettings::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.


Super Compressed Bitmaps

(Document/Medical only) Super compressed bitmaps are kept compressed in memory. Only 24-bit, 8-bit grayscale, 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.

Super compressed bitmaps can be allocated or created using the following functions:

LBitmap::LBitmap

LBitmapBase::LBitmapBase

LBitmapBase::Allocate

LBitmapBase::Create

The following Load functions support loading super compressed bitmaps:

LFile::LoadFile

LFile::LoadOffset

LFile::LoadTile

The LBitmapBase::ChangeCompression 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. To determine whether a bitmap is super compressed, use the LBitmapBase::IsSuperCompressed function.

To get information about a super compressed bitmap in memory, call the LMemoryFile::GetBitmapMemoryInfo function.


Compressing and Decompressing Buffers

ABIC Compression:

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

To begin the compression process, the LBase::EncodeABIC function must be called. This function 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 LBase::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.


Scanning Images Using ISIS Device

Note:

Document/Medical.

You can load an image from an ISIS device, such as a scanner, or you can capture an image from a screen. 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

This support is available in the Document/Medical Toolkits.

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 LIsis::Acquire and LIsis::AcquireMulti functions, provided an ISIS driver is present. (The LEADTOOLS software does not include ISIS Drivers). LIsis::Acquire loads an image scanned from an ISIS scanner into a bitmap. LIsis::AcquireMulti provides support for multi-page scanning, saving pages in a single or multiple files.

Prior to scanning however, other functions must be used to prepare for scanning. LIsis::IsAvailable indicates whether ISIS support DLLs are available for use. If so, load the ISIS Scanner Driver using LIsis::LoadDriver. LIsis::Select 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 LIsis::SetScanOptions.

LEADTOOLS provides the LIsis::GetTagLong, LIsis::GetTagShort and LIsis::GetTagASCII functions for getting information on the current scanner settings and scanning properties. Certain scanner settings and scanning properties can be changed using LIsis::SetTagLong, LIsis::SetTagShort and LIsis::SetTagASCII. ISIS tags can have multiple values, also called choices. LEADTOOLS provides the LIsis::GetTagASCIIChoice, LIsis::GetTagLongChoice, and LIsis::GetTagShortChoice 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, ISIS short tags and ISIS ASCII tags.

Finally, when the ISIS driver is no longer needed, unload the driver using LIsis::UnloadDriver.

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.


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 LBitmap::ColorSeparate and LBitmap::ColorMerge 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 LBuffer::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, will be done by shifting the image data or intensity values by a specific value. The ability to shift image data back and forth between signed and unsigned is often useful in medical or analytical applications.

To change image data from signed to unsigned, which is often done before applying image processing or analysis functions, there are the following options:

LBitmap::ConvertUnsignedToSigned shifts the image data based on internal aspects of the bitmap.

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

LBitmapBase::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:

LBitmap::ConvertSignedToUnsigned shifts the image data based on internal aspects of the bitmap.

LBitmap::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, LBitmap::Deskew (Document/Medical only) and LBitmap::DeskewExt (Document/Medical only) let you automatically straighten and trim scanned documents.

For resizing any kind of bitmap, LBitmapBase::Size provides the most up-to-date options, but you may also find the alternative and low-level functions useful.

LEADTOOLS also provides the LFile::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 LBitmapBase::Rotate, LBitmapBase::Flip or LBitmapBase::Reverse and then resaving it. It uses the LFile::TransformFileCallBack function for processing the file. For more information, refer to LFile::TransformFile.

The LBitmap::DisplaceMap function displaces bitmap pixels horizontally and vertically according to the values of the displacement map image. The LBitmap::Perspective 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

Getting or Setting Bitmap Information

Using the LBitmap::Perlin Function

Adding Another Image to a Bitmap

The LBitmapBase::Combine 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 LBitmapBase::CombineExt function extends the capabilities of the LBitmapBase::Combine 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 LBitmapBase::CombineBitmapWarp.

The LBitmapBase::Underlay 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 LBitmap::Picturize function replaces an image with a new image created by combining images present in a specific directory. LBitmap::PicturizeList replaces an image with a new image created by combining images present in a bitmap list.

The LBitmap::PicturizeSingle function picturizes an image using various versions of a single image.

Borders and frames may be added to a bitmap using the LBitmap::AddBorder and LBitmap::AddFrame functions.

LBitmap::TextureAlphaBlend 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 LBitmap::BricksTexture function creates a brick texture that makes the image look like it has been drawn on a brick wall.

The LBitmap::Clouds function creates a cloud texture that can be saved by itself or combined with another image.

The LBitmap::DigitalSubtract function does not combine images, but subtracts the live (destination) bitmap from the mask (source) bitmap to show the differences between the two bitmaps.

The LBitmap::BumpMap function lets you combine a bitmap with a bump image to create a three-dimensional texture pattern.

The LBitmap::Canvas function applies an image as an overlay for another image.

Two bitmaps can also be blended by combining the images with an opacity value. The LBitmapBase::AlphaBlend function combines two bitmaps with a fixed opacity value to create a new blended image. The LBitmapBase::FeatherAlphaBlend 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 LBItmapBase::CreateFadedMask function.

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

Comparing Images

Two bitmaps or parts of two bitmaps can be compared using the LBitmap::Correlation 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 LBitmap::CorrelationList function compares the images in hCorList with all the areas of the same dimensions in the bitmap image and finds those portions that match according to the measure of correlation.

Related Topics:

Color Halftones and Halftone Images


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 following functions:

LBitmapBase::SetPaintIntensity

LBitmapBase::SetPaintContrast

LBitmapBase::SetPaintGamma

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 LBitmap::ChangeIntensity, LBitmap::ChangeContrast, and LBitmap::GammaCorrect or LBitmap::GammaCorrectExt. If you use these functions, the changes become permanent when you save the bitmap in a file.

The LBitmap::Add function can be used to improve the brightness of an image by adding a list of bitmaps. The list of bitmaps consists of several "versions" of the same view or image.

The LBitmap::AdaptiveContrast function performs adaptive contrast enhancement (ACE) to areas that are originally low in contrast.

The LBitmap::ColorIntensityBalance function changes the distribution of the red, green, or blue channels.

The LBitmap::ContBrightInt function applies brightness, contrast and intensity adjustments to enhance the image tonal range.

The LBitmap::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 LBitmap::ChangeHue, LBitmap::ChangeSaturation, and LBitmap::ChangeIntensity 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 LBitmap::MathFunction 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.

The LBitmap::AddWeighted 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 LBitmap::IntensityDetect function filters the specified bitmap to detect colors in a specified intensity range in all planes or a specific plane.

The LBitmap::Multiply 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.

Special Functions

The LBitmap::SubtractBackground 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 LBitmap::Multiply in order to include the capability for increasing the brightness of the final image.

The LBitmap::DynamicBinary 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 LBitmap::MultiScaleEnhancementBitmap function wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).

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 LBitmap::HistoContrast function is similar to the ordinary LBitmap::ChangeContrast 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 LBitmap::HistoContrast 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 LBitmap::StretchIntensity 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 LBitmap::HistoEqualize function is often the most effective function for bringing out hidden details through contrast improvement. Like the LBitmap::StretchIntensity 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 LBitmap::AutoColorLevel function darkens dark values and lightens light values, enhancing shadows and brightening the image automatically.

The LBitmap::ColorLevel function applies color leveling to an image. It changes the image's shadows, midtones and highlights.

The LBitmap::LocalHistoEqualize 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 LBitmap::LightControl 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.

To create your own histogram-based function, you can use the LBitmap::GetHistogram function to get a bitmap's histogram. You can then manipulate the histogram to create a lookup table and call the LBitmap::RemapIntensity function to change the bitmap's intensities through the lookup table. The LBitmap::GetFunctionalLookupTable and LBitmap::GetUserLookupTable functions provide means for programmatically updating lookup tables before calling LBitmap::RemapIntensity. You can also use the LBitmap::GetHistogram function to get the histogram for a 12- or 16-bit grayscale image. 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 LBitmap::GetHistogram and LBitmap::RemapIntensity 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 LBitmap::ColorSeparate function to do an HSV separation. You can then manipulate the value plane and recombine the color planes with the LBitmap::ColorMerge function.

When working with DICOM files, you can remap pixel values using a lookup table, or by applying a linear transformation using LBitmap::ApplyModalityLUT or LBitmap::ApplyLinearModalityLUT, respectively. You can also set up window leveling options for a bitmap using a lookup table or a linear transformation using LBitmap::ApplyVOILUT or LBitmap::ApplyLinearVOILUT, respectively.


Removing Noise

[Document/Medical only] The LBitmap::Despeckle function is designed specifically for removing specks from 1-bit images, such as FAX transmissions or scanned documents.

LBitmap::MedianFilter 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 LBitmap::AverageFilter 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 LBitmap::Add function can be used to average the bitmaps in a list, eliminating random noise contained in the images.

The LBitmap::AddWeighted 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 LBitmap::HighPassFilter function removes low frequency details in a bitmap, resulting in a sharpened image. The effect is opposite to that of the Gaussian Blur filter (LBitmap::GaussianFilter). Unlike the LBitmap::UnsharpMask function, when using this function image noise is not increased.

The LBitmap::GaussianFilter function smoothes 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 LBitmap::BinaryFilter function applies directional binary filters. The LBitmap::MaxFilter and LBitmap::MinFilter 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 LBitmapBase::Combine with the CB_OP_AVG (averaging) flag.

[Document/Medical only] The LBitmap::AutoBinary 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 LBitmap::DynamicBinary function converts a bitmap into a black and white image without changing its bits per pixel.

The LBitmap::Deinterlace 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 LBitmap::SmoothEdges function smoothes the edges of a bitmap.

Fourier Transforms

Fourier Transforms are useful in removing harmonic noise like:

Herringbone patterns seen in video images

Sine wave patterns

Moiré patterns

Halftone patterns

Interference patterns

Fourier Transforms are also useful in removing noise from video signals and CCDs.

Fourier transforms convert an image from one where intensity varies over space into one where the intensity varies with frequency. After an image has been described (transformed) as a series of frequencies and phase, that information can then be analyzed using a power spectrum. The power spectrum is a two-dimensional map that plots the frequency of pixel intensity values. Low frequencies lie close to the origin and high frequencies close to the edges. From the analysis suitable filters can be applied to remove those parts of the image that correspond to the noise in the image. The image can then be retransformed back into the original image, only without the noise.

A Discrete Fourier Transform is a Fourier transform that uses a series which has values that have both a real and an imaginary component. Discrete Fourier transforms reveal periodicities in the data as well as the relative strengths of those periodicities.

Discrete Fourier Transforms can take a long time to compute. To reduce computing time, Fast Fourier Transforms can be used, which reduce the number of computations from 2N2 to 2N Lg N. However, using a Fast Fourier Transform requires that the number of points in the series be a power of 2.

The following functions provide Fourier transform capabilities:

LBitmap::AllocFTArray | Allocates an FTARRAY structure large enough to hold Fourier Transform coefficients
LBitmap::DFT | Computes the Discrete Fourier Transform of an image or the Inverse Discrete Fourier Transform, whichever is specified.
LBitmap::FFT | Computes the Fast Fourier Transform of an image or the Inverse Fast Fourier Transform, whichever is specified.
LBitmap::FreeFTArray | Frees the 2D storage array that was allocated by LBitmap::AllocFTArray.
LBitmap::FTDisplay | Converts the frequency harmonics amplitude or phase to a bitmap. It allows displaying the results of FFT and DFT as a bitmap.
LBitmap::FrqFilter | Filters the frequency harmonics according to the range rectangle.
LBitmap::FrqFilterMask | Creates a mask filter for use in removing specific frequency components from a bitmap.


Detecting and Enhancing Edges and Lines

The LBitmap::Sharpen 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 LBitmap::SpatialFilter 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 LBitmapBase::Combine 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 LBitmap::DiffuseGlow function adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow.

The LBitmap::EdgeDetector function can be used to apply a specific edge filter to an image. The available edge filters include: Sobel vertical, Sobel horizontal, Sobel all, Laplacian vertical and horizontal, Laplacian diagonal, Gradient North, Gradient South, and many others. LBitmap::EdgeDetectEffect can be used to detect the edges in a bitmap and then replace the values of the edges with calculated values.

The LBitmap::EdgeDetectStatistical 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 LBitmap::GlowFilter function can be used to make the colored edges in a bitmap shine with a neon-like glow.

The LBitmap::HighPassFilter function removes low frequency details in a bitmap, resulting in a sharpened image. The effect is opposite to that of the Gaussian Blur filter (LBitmap::GaussianFilter). Unlike the LBitmap::UnsharpMask function, when using this function image noise is not increased.

The LBitmap::MaskConvolution function multiplies the pixels of an image by a mask, resulting in one of several 3D edge effects being applied to the image.

The LBitmap::ColoredPencil function applies a colored pencil effect to a bitmap. This function brightens the bitmap and enhances its edges.

The LBitmap::SmoothEdges function can be used to smooth the rough edges in a bitmap.

The LBitmap::Skeleton 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 LBitmap::IntensityDetect 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 LBitmap::UnsharpMask 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 LBitmap::EdgeDetectEffect function performs edge detection on the image.

The LBitmap::DirectionEdgeStatistical function can be used to detect the variation of colors in the specified direction using statistical indices. It is similar to LBitmap::EdgeDetectStatistical, but this function allows you to specify the direction angle.


Applying Artistic Effects

The following functions are designed specifically for artistic effects:

Function | Purpose
LBitmap::AddNoise | Adds random pixels to a bitmap, letting you specify the percentage of coverage and the color plane.
LBitmap::AddShadow | 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.
LBitmap::Aging | Adds effects that simulate random color changes, scratches, dust and pits, making a bitmap look like it was made from an old film.
LBitmap::Bending | Wraps the bitmap along the inside or outside of an arc pattern.
LBitmap::BricksTexture | Creates a brick texture that makes the image look like it has been drawn on a brick wall.
LBitmap::BumpMap | Adds a three-dimensional texture pattern by applying the bump image to the destination image.
LBitmap::Canvas | Applies an image as an overlay for another image.
LBitmap::Clouds | Generates different cloud patterns.
LBitmap::ColoredBalls | Adds colored balls to the bitmap. Various parameters control the color and appearance of the balls.
LBitmap::ColoredPencil | Applies a colored pencil effect to a bitmap. This function brightens the bitmap and enhances its edges.
LBitmap::Cubism | Remaps the bitmap into a collection of rotated rectangles (cubic faces), in the Cubist style.
LBitmap::Cylindrical | Warps the bitmap to a cylindrical shape.
LBitmap::DiceEffect | 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.
LBitmap::DiffuseGlow | Adds a colored glow to a bitmap's light or dark areas, making these areas shine with a neon glow.
LBitmap::DisplaceMap | Displaces bitmap pixels horizontally and vertically according to the values of the displacement map image.
LBitmap::DrawStar | Draws a star on the bitmap.
LBitmap::Dry | Simulates painting an image with the watercolor dry brush technique.
LBitmap::Emboss | Applies an emboss effect to a bitmap, letting you specify the depth and direction of the effect.
LBitmap::Fragment | Averages a bitmap with its shifted copies.
LBitmap::FreeHandShear | Shears the bitmap by the wave drawn using amplitude values obtained from LBitmap::GetCurvePoints.
LBitmap::FreeHandWave | Distorts the bitmap by the wave drawn using amplitude values obtained from LBitmap::GetCurvePoints and a specified angle.
LBitmap::FreePlaneBend | Wraps the bitmap onto a 3D plane shaped by pnCurve.
LBitmap::FreeRadBend | Wraps the bitmap along its radius on a 3D surface shaped by pnCurve.
LBitmap::FunctionalLight | 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.
LBitmap::HalfTonePattern | Creates a halftone screen effect for an image while keeping its continuous range of tones.
LBitmap::GlassEffect | Divides the image into cells and makes it look as if it is being viewed through glass blocks.
LBitmap::GlowFilter | Makes colored edges shine with a neon-like glow.
LBitmap::Impressionist | Makes a bitmap look like it was painted by an impressionist painter.
LBitmap::LensFlare | Simulates the secondary reflections caused when bright lights are facing the camera lens.
LBitmap::LightControl | Lightens or darkens all or part of a bitmap by remapping the pixel values.
LBitmap::Light | Adds many spots of directed light sources to the bitmap.
LBitmap::MaskConvolution | Multiplies the pixels of an image by a kernel, resulting in one of several 3D edge effects being applied to the image.
LBitmap::Mosaic | 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.
LBitmap::MosaicTiles | 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.
LBitmap::MotionBlur | Applies a filter, which creates the illusion of movement in an image.
LBitmap::Ocean | Reflects the bitmap on an ocean surface.
LBitmap::Oilify | Applies an oil-painting effect to a bitmap.
LBitmap::Offset | Shifts the bitmap pixels horizontally and vertically.
LBitmap::Perspective | Gives a bitmap a 3-D depth, as if it exists on a flat plane and has been skewed into a different shape.
LBitmap::PlasmaFilter | Applies color patterns that blend into each other like plasma.
LBitmap::Pointillist | 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.
LBitmap::Perlin | Uses a pseudo-random number generator in order to create a Perlin noise, and then procedurally transforms that noise into a texture.
LBitmap::Pixelate | 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.
LBitmap::PlaneBend | Places the bitmap on parallel planes along the Z-axis bent towards a center point.
LBitmap::Plane | Places the bitmap on parallel planes along the Z-axis.
LBitmap::Polar | Converts the bitmap from rectangular to polar coordinates and vice versa.
LBitmap::Posterize | 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.
LBitmap::Punch | Warps the bitmap by pinching it toward the center or expanding the bitmap away from its center.
LBitmap::PuzzleEffect | Splits the image into square blocks and randomizes these blocks inside the image.
LBitmap::RadialBlur | Rotates the bitmap pixels around a center point.
LBitmap::RadWave | Distorts a bitmap using a wave radiating from the specified center.
LBitmap::RemoveRedEye | 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).
LBitmap::RevEffect | 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.
LBitmap::RingEffect | 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.
LBitmap::Ripple | Warps the image in concentric rings.
LBitmap::RomanMosaic | 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.
LBitmap::SampleTarget | Corrects color values by shifting the sample colors to the target colors.
LBitmap::Segment | Divides the bitmap into segments where each segment’s pixels have approximately the same color (homogenous color).
LBitmap::SmoothEdges | Smoothes the rough edges in the bitmap.
LBitmap::Solarize | Applies an effect that mimics the accidental exposure of photographic film to light.
LBitmap::Spherize | Warps the image around a 3D spherical shape.
LBitmap::Swirl | Produces a swirl pattern by rotating the bitmap the specified number of degrees about the specified point.
LBitmap::TextureAlphaBlend | 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).
LBitmap::Tunnel | Places the bitmap inside a tunnel along the Z-axis.
LBitmap::Vignette | Draws a specified shape and feathers it to the bitmap.
LBitmap::Wave | Distorts the bitmap with two perpendicular waves at the specified angle and with the specified wave type.
LBitmap::Wind | Creates thin lines, directed along the specified angle, on the specified bitmap.
LBitmap::ZoomBlur | Blurs the bitmap along radial lines starting from the specified center point.
LBitmap::ZoomWave | Distorts the bitmap with a wave zoomed from the specified center.
LBitmapBase::Underlay | Combines two bitmaps so that one appears to be an underlying texture for the other.
LBitmap::ZigZag | Radially distorts the bitmap by creating waves that twist the image around a specified center.

With any of these functions, except LBitmapBase::Underlay, 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 LBitmapBase::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
LBitmap::AntiAlias | Applies an anti-aliasing filter to a specific bitmap.
LBitmap::AdjustTint | Adjusts the bitmap tint by changing the colors in an image using two separate color wheel rotations.
LBitmap::ApplyMathLogic | Performs specific Mathematical or logical operations on the colors of a bitmap.
LBitmap::AutoColorLevel | Makes dark values darker and light values lighter to automatically enhance shadows and brighten the image.
LBitmap::BalanceColors | Linearizes the number of pixels in a bitmap across RGB, YUV or Gray color space.
LBitmap::ChangeHue | Changes the hue of colors in a bitmap by rotating the color wheel.
LBitmap::ChangeHueSatIntBitmap | Changes the hue, saturation and brightness of all or specified colors in the image. This function combines the functionality found in the LBitmap::ChangeHue, LBitmap::ChangeSaturation, and LBitmap::ChangeIntensity 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.
LBitmap::ChangeSaturation | Increases or decreases the saturation of colors in a bitmap.
LBitmap::ChannelMix | Rebalances the colors in a bitmap in order to make color adjustments and to correct images which have more color than others.
LBitmap::ColorIntensityBalance | Changes the distribution of the red, green, or blue channels.
LBitmap::ColorizeGray | 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.
LBitmap::ColorLevel | Applies color leveling to an image. It changes the image shadows, midtones and highlights.
LBitmap::ColorReplace | Replaces specified colors by adjusting values of hue, saturation and brightness.
LBitmap::ColorThreshold | Using any one of eight color spaces, resets those bitmap’s pixel component values that fall inside or outside of a specified range.
LBitmap::ColorHalfTone | Creates an enlarged halftone screen for each image channel.
LBitmap::Invert | Inverts the colors in the specified bitmap, making it like a photographic negative.
LBitmap::RemoveRedEye | 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).
LBitmap::SampleTarget | Corrects color values by shifting the sample colors to the target colors.
LBitmap::SelectData | 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.
LBitmap::SelectiveColor | Changes the color of a bitmap by altering the definitions of one or more colors used by the bitmap.
LBitmap::ShiftData | 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.
LBitmap::SwapColors | Swaps colors channels in a bitmap.


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 LBitmapBase::GrayScale function. The LBitmap::GrayScaleExt 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 LBitmap::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 LBitmap::ColorizeGray.

The LBitmap::GrayScaleToDuotone function converts a grayscale bitmap into a colored one by mixing or replacing the original values of the pixels with new colors.

The LBitmap::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 LBitmapBase::CreateAlphaBitmap function creates a grayscale image from the alpha channel information of an image.

The LBitmap::Desaturate 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 LBitmap::ShiftData 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 LBitmap::SelectData 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.

Getting information about grayscale images

LEADTOOLS also provides functions for getting information about grayscale images. The LBitmap::GetMinMaxBits provides information on the minimum and maximum bit set in a 12 or 16 - bit grayscale image. The LBitmap::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 LBitmap::GetHistogramGray.

To determine the kind of grayscale palette associated with a bitmap, if any, call LBitmapBase::IsGrayScale.

Changing the Highlight pen and Cursor Style (Document/Medical only)

When working with grayscale images containing many midrange grays, both the highlight pen and the cursor may be difficult to see properly. When working with the automated annotations in such cases, use the LAnnAutomation::SetAutoHilightPen and the LAnnAutomation::SetAutoCursor functions. These two functions are used to set the default highlight pen color, used in drawing and selecting, and the cursor, respectively. By changing the default highlight pen color and the cursor style, highlight and cursor visibility can be greatly improved.

Window leveling (Document/Medical Imaging 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. LBitmap::WindowLevel provides "on demand" window leveling for the paint functions and does not alter the image, and LBItmap::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 LBitmap::GetMinMaxBits and LBitmap::GetMinMaxVal. LBitmap::GetMinMaxBits gets the minimum and maximum bits of the values present in a 12 or 16-bit grayscale image. LBitmap::GetMinMaxVal gets the minimum and maximum intensity values of the image. LBitmap::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 LBitmap::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 only)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:

LBitmap::Smooth

LBitmap::LineRemove

LBitmap::DotRemove

LBitmap::HolePunchRemove

LBitmap::InvertedText

LBitmap::BorderRemove

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 member functions allow you to provide customized region processing, as well as create your own composite of the removed regions.

LBitmap::SmoothCallback

LBitmap::LineRemoveCallback

LBitmap::DotRemoveCallback

LBitmap::HolePunchRemoveCallback

LBitmap::BorderRemoveCallback

LBitmap::InvertedTextCallback


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 LBitmap::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 LBitmap::SearchRegMarks function.
uMarkDetectedCount | Count of detected marks. Set this to 0. This will be updated by LBitmap::SearchRegMarks function.

With this information you can use the LBitmap::GetMarksCenterMass 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 LBitmap::SearchRegMarks function on the scanned image to find the registration marks. If all the registration marks were detected (the uMarkDetectedCount parameter in each SEARCHMARKS structure equals 1), then use the LBitmap::GetMarksCenterMass 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 LBitmap::GetTransformationParameters function.

To re-orient and resize the scanned image so it is like the reference image, use the values from the LBitmap::GetTransformationParameters function and pass them to the LBitmap::ApplyTransformationParameters function. This is equivalent to shifting the image using LBitmapBase::CombineExt, rotating the image using LBitmapBase::Rotate(without resizing), and scaling the image using either LBitmapBase::Size or LBitmapBase::Resize. (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


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.


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


Bitmap Change Notifications and Notification Categories

Description

Bitmaps

When calling some functions of the LBitmapBase and LBitmap LEADTOOLS Class Library classes, particularly those that affect the bitmap itself, then notification messages are sent through the LBitmapBase::StartChanging and LBitmapBase::EndChanging member functions. These functions are called before and after executing the function that changes the bitmap. This gives you more control over the operation in progress. In order to use this feature, you must override the virtual functions for StartChanging and EndChanging. In the LBitmapBase::StartChanging function, if you return an error code, the change operation will halt the calling function and will return the same error code. In the LBitmapBase::EndChanging function you will be notified that the calling function's operation is complete. This gives you a chance to do other processing such as updating the display.

The following sections describe the change notifications and the notification categories:

Bitmap Changing Notifications:

The following is a list of all the notification messages and the functions that send them:

Notification Message | Function In Progress
NC_RECTS_SRC_RECT | LBitmapBase::SetSrcRect
NC_RECTS_CLIPSRC_RECT | LBitmapBase::SetClipSrcRect
NC_RECTS_DST_RECT | LBitmapBase::SetDstRect
NC_RECTS_CLIPDST_RECT | LBitmapBase::SetClipDstRect
NC_BITMAP_BITMAPHANDLE | LBitmapBase::SetHandle
 | LDialogFile::DoModalOpen
NC_BITMAP_ALLOC | LBitmapBase::Allocate
NC_BITMAP_COPY | LBitmapBase::Copy
NC_BITMAP_DATA | LBitmapBase::CopyData
NC_BITMAP_COPYHANDLE | LBitmapBase::CopyHandle
NC_BITMAP_CREATE | LBitmapBase::Create
NC_BITMAP_CREATEALPHA | LBitmapBase::CreateAlphaBitmap
NC_BITMAP_INITIALIZE | LBitmapBase::Initialize
NC_BITMAP_COLOR_MERGE | LBitmap::ColorMerge
NC_REGION_FREE_REGION | LBitmapRgn::Free
NC_REGION_OFFSET_REGION | LBitmapRgn::Offset
NC_REGION_SET_REGION | LBitmapRgn::SetRgnFromMask
 | LBitmapRgn::SetRgnColor
 | LBitmapRgn::SetRgnEllipse
 | LBitmapRgn::SetRgnPolygon
 | LBitmapRgn::SetRgnRect
 | LBitmapRgn::SetRgnRoundRect
 | LBitmapRgn::SetRgnHandle
NC_REGION_RESIZE_REGION | LBitmapRgn::ResizeRgn
NC_FREE_FREE | LBitmapBase::Free
NC_FREE_CHANGE_TO_DIB | LChange::ChangeToDIB
NC_FREE_CHANGE_TO_DDB | LChange::ChangeToDDB
NC_ACCESS_ACCESS | LBitmapBase::Access
NC_ACCESS_RELEASE | LBitmapBase::Release
NC_EDIT_ADD | LBitmap::Add
NC_EDIT_ADD_BORDER | LBitmap::AddBorder
NC_EDIT_ADD_FRAME | LBitmap::AddFrame
NC_EDIT_ALPHA_BLEND | LBitmapBase::AlphaBlend
NC_EDIT_BALANCE_COLORS | LBitmap::BalanceColors
NC_EDIT_CHANGE_COMPRESSION | LBitmapBase::ChangeCompression
NC_EDIT_CLEAR | LBitmapBase::Clear
NC_EDIT_CLEAR_NEGATIVE_PIXELS | LBitmapBase::ClearNegativePixels
NC_EDIT_COLORED_GRAY | LBitmap::ConvertToColoredGray
NC_EDIT_COLORRES | LBitmapBase::ColorRes
 | LDialogColor::DoModalColorRes
NC_EDIT_COMBINE | LBitmapBase::Combine LBitmapBase::CombineExt
NC_EDIT_COPYRECT | LBitmapBase::CopyRect
NC_EDIT_FEATHER_ALPHA_BLEND | LBitmapBase::FeatherAlphaBlend
NC_EDIT_FILL | LBitmapBase::Fill
NC_EDIT_GRAY | LBitmapBase::GrayScale
NC_EDIT_GRAY_EXT | LBitmap::GrayScaleExt
NC_EDIT_PICTURIZE | LBitmap::Picturize
NC_EDIT_PIXELCOLOR | LBitmapBase::PutPixelColor
NC_EDIT_PIXELDATA | LBitmapBase::PutPixelData
NC_EDIT_PUTROW | LBitmapBase::PutRow
NC_EDIT_PUTROWCOL | LBitmapBase::PutRowCol
NC_EDIT_PUTROWCOLCOMP | LBitmapBase::PutRowColCompressed
NC_EDIT_PUTROWCOMP | LBitmapBase::PutRowCompressed
NC_EDIT_PUTCOLORS | LBitmapBase::PutColors
NC_EDIT_REMAP_INTENSITY | LBitmap::RemapIntensity
NC_EDIT_REMOVE_REDEYE | LBitmap::RemoveRedEye
NC_EDIT_SETALPHA | LBitmapBase::SetAlpha
NC_EDIT_SIGNED_TO_UNSIGNED | LBitmapBase::ConvertSignedToUnsigned
NC_EDIT_SWAP_COLORS | LBitmap::SwapColors
NC_EDIT_UNDERLAY | LBitmapBase::Underlay
NC_EDIT_WINDOW_LEVEL | LBitmap::WindowLevel
NC_EDIT_WINDOW_LEVEL_BITMAP | LBitmap::WindowLevelBitmap
 | LDialogColor::DoModalWindowLevel
NC_TRANSFORM_ROTATE_VIEW_PERSPECTIVE | LBitmapBase::RotateViewPerspective
NC_TRANSFORM_VIEW_PERSPECTIVE | LBitmapBase::ChangeViewPerspective
NC_TRANSFORM_FLIP | LBitmapBase::Flip
NC_TRANSFORM_REVERSE | LBitmapBase::Reverse
NC_TRANSFORM_ROTATE | LBitmapBase::Rotate
 | LBitmapBase::RotateFine
NC_TRANSFORM_SHEAR | LBitmapBase::Shear
NC_DIM_HEIGHT | LBitmapBase::ChangeHeight
NC_DIM_TRIM | LBitmapBase::Trim
NC_DIM_SIZE | LBitmapBase::Size
NC_DIM_RESAMPLE | LBitmapBase::Resample
NC_DITHERING_START_DITHERING | LBitmapBase::StartDithering
NC_DITHERING_DITHERING | LBitmapBase::DitherLine
NC_DITHERING_STOP_DITHERING | LBitmapBase::StopDithering
NC_FILTER_ADDNOISE | LBitmap::AddNoise
 | LDialogImageEffect::DoModalAddNoise
NC_FILTER_ANTI_ALIAS | LBitmap::AntiAlias
NC_FILTER_AUTOTRIM | LBitmap::AutoTrim
NC_FILTER_AVERAGE | LBitmap::AverageFilter
 | LDialogImageEffect::DoModalAverage
NC_FILTER_BINARY | LBitmap::BinaryFilter
NC_FILTER_CONTRAST | LBitmap::ChangeContrast
 | LDialogColor::DoModalContrast
NC_FILTER_EDGE_DETECTOR | LBitmap::EdgeDetector
NC_FILTER_HALFTONE | LBitmap::HalfTone
 | LDialogColor::DoModalHalftone
NC_FILTER_HUE | LBitmap::ChangeHue
 | LDialogColor::DoModalHue
NC_FILTER_INTENSITY | LBitmap::ChangeIntensity
NC_FILTER_SATURATION | LBitmap::ChangeSaturation
NC_FILTER_DESKEW | LBitmap::Deskew
NC_FILTER_DESPECKLE | LBitmap::Despeckle
NC_FILTER_EMBOSS | LBitmap::Emboss
 | LDialogImageEffect::DoModalEmboss
NC_FILTER_GAMMA_CORRECT | LBitmap::GammaCorrect
 | LDialogColor::DoModalGammaAdjustment
NC_FILTER_GAUSSIAN | LBitmap::GaussianFilter
NC_FILTER_INVERT | LBitmap::Invert
NC_FILTER_HISTO_CONTRAST | LBitmap::HistoContrast
 | LDialogColor::DoModalHistoContrast
NC_FILTER_HISTO_EQUALIZE | LBitmap::HistoEqualize
NC_FILTER_INTENSITY_DETECT | LBitmap::IntensityDetect
 | LDialogColor::DoModalIntensityDetect
NC_FILTER_MAX | LBitmap::MaxFilter
 | LDialogImageEffect::DoModalMaxFilter
NC_FILTER_MEDIAN | LBitmap::MedianFilter
 | LDialogImageEffect::DoModalMedian
NC_FILTER_MIN | LBitmap::MinFilter
 | LDialogImageEffect::DoModalMinFilter
NC_FILTER_MOTION_BLUR | LBitmap::MotionBlur
NC_FILTER_OILIFY | LBitmap::Oilify
 | LDialogImageEffect::DoModalOilify
NC_FILTER_POSTERIZE | LBitmap::Posterize
 | LDialogColor::DoModalPosterize
NC_FILTER_SOLARIZE | LBitmap::Solarize
 | LDialogColor::DoModalSolarize
NC_FILTER_SPATIAL | LBitmap::SpatialFilter
NC_FILTER_STRETCH_INTENSITY | LBitmap::StretchIntensity
NC_FILTER_GRADIENT | LDialogImageEffect::DoModalGradientFilter
NC_FILTER_LAPLACIAN | LDialogImageEffect::DoModalLaplacianFilter
NC_FILTER_SOBEL | LDialogImageEffect::DoModalSobelFilter
NC_FILTER_PREWITT | LDialogImageEffect::DoModalPrewittFilter
NC_FILTER_SHIFTDIFF | LDialogImageEffect::DoModalShiftDifferenceFilter
NC_FILTER_LINESEG | LDialogImageEffect::DoModalLineSegmentFilter
NC_FILTER_EROSION | LDialogImageEffect::DoModalErosionFilter
NC_FILTER_DILATION |
NC_FILTER_SHARPEN | LDialogImageEffect::DoModalSharpen LBitmap::Sharpen
NC_FILTER_BRIGHTNESS | LDialogColor::DoModalBrightness
NC_FILTER_MOSAIC | LDialogImageEffect::DoModalMosaic LBitmap::Mosaic
NC_FILTER_UNSHARP_MASK | LBitmap::UnsharpMask
NC_FILTER_MULTIPLY | LBitmap::Multiply LDialogImageEffect::DoModalMultiply
NC_FILTER_REMAP_HUE | LBitmap::RemapHue
NC_FILTER_ADDWEIGHTED | LDialogColor::DoModalRemapHue
NC_FILTER_LOCAL_HISTOEQUALIZE | LBitmap::AddWeighted
 | LBitmap::HistoEqualize
NC_FILTER_PIXELATE |
NC_FILTER_WIND | LBitmap::Pixelate
NC_FILTER_IMPRESSIONIST | LBitmap::Wind
NC_FILTER_WAVE | LBitmap::Impressionist
NC_FILTER_ZOOM_WAVE | LBitmap::Wave
NC_FILTER_RAD_WAVE | LBitmap::ZoomWave
NC_FILTER_FREE_HAND_SHEAR | LBitmap::RadWave
NC_FILTER_FREE_HAND_WAVE | LBitmap::FreeHandShear
NC_FILTER_ADD_MESSAGE | LBitmap::FreeHandWave
NC_FILTER_EXTRACT_MESSAGE | LBitmap::AddMessage
NC_FILTER_SPHERIZE | LBitmap::ExtractMessage
NC_FILTER_CYLINDRICAL | LBitmap::Spherize
NC_FILTER_BENDING | LBitmap::Cylindrical
NC_FILTER_PUNCH | LBitmap::Bending
NC_FILTER_RIPPLE | LBitmap::Punch
NC_FILTER_POLAR | LBitmap::Ripple
NC_FILTER_RADIAL_BLUR | LBitmap::Polar
NC_FILTER_ZOOM_BLUR | LBitmap::RadialBlur
NC_FILTER_SWIRL | LBitmap::ZoomBlur
NC_FILTER_DEINTERLACE | LBitmap::Swirl
NC_FILTER_SAMPLE_TARGET | LBitmap::Deinterlace
NC_FILTER_HALF_TONE | LBitmap::SampleTarget
NC_FILTER_CUBISM | LBitmap::HalfTone
NC_FILTER_LIGHT_CONTROL | LBitmap::Cubism
NC_FILTER_GLASS_EFFECT | LBitmap::LightControl
NC_FILTER_LENS_FLARE | LBitmap::GlassEffect
NC_FILTER_BUMP_MAP | LBitmap::LensFlare
NC_FILTER_GLOW_FILTER | LBitmap::BumpMap
NC_FILTER_EDGE_DETECT_STATISTICAL | LBitmap::GlowFilter
NC_FILTER_DESATURATE | LBitmap::EdgeDetectStatistical
NC_FILTER_SMOOTH_EDGES | LBitmap::Desaturate
NC_FILTER_AUTO_BINARY | LBitmap::SmoothEdges
NC_FILTER_BINARY | LBitmap::AutoBinary
NC_FILTER_CHANNEL_MIX | LBitmap::BinaryFilter
NC_FILTER_PLANE | LBitmap::ChannelMix
NC_FILTER_PLANE_BEND | LBitmap::Plane
NC_FILTER_TUNNEL | LBitmap::PlaneBend
NC_FILTER_FREE_RAD_BEND | LBitmap::Tunnel
NC_FILTER_FREE_PLANE_BEND | LBitmap::FreeRadBend
NC_FILTER_OCEAN | LBitmap::FreePlaneBend
NC_FILTER_LIGHT | LBitmap::Ocean
NC_FILTER_DRY | LBitmap::Light
NC_FILTER_DRAW_STAR | LBitmap::Dry
NC_FILTER_ADD_SHADOW | LBitmap::DrawStar
NC_FILTER_ALLOC_FT_ARRAY | LBitmap::AddShadow
NC_FILTER_CHANGE_HUE_SAT_INT | LBitmap::AllocFTArray
NC_FILTER_COLOR_REPLACE | LBitmap::ChangeHueSatIntBitmap
NC_FILTER_COLOR_THRESHOLD | LBitmap::ColorReplace
NC_FILTER_DFT | LBitmap::ColorThreshold
NC_FILTER_DIRECTION_EDGE_STATISTICAL | LBitmap::DFT
NC_FILTER_FFT | LBitmap::DirectionEdgeStatistical
NC_FILTER_FT_DISPLAY | LBitmap::FFT
NC_FILTER_FRQ_FILTER | LBitmap::FTDisplay
NC_FILTER_FRQ_FILTER_MASK | LBitmap::FrqFilter
NC_FILTER_GET_STATISTICS_INFO | LBitmap::FrqFilterMask
NC_FILTER_GET_FERETS_DIAMETER | LBitmap::GetStatisticsInfo
NC_FILTER_GET_OBJECT_INFO | LBitmap::GetFeretsDiameter
NC_FILTER_GET_RGN_CONTOUR_POINTS | LBitmap::GetObjectInfo
NC_FILTER_GET_RGN_PERIMETER_LENGTH | LBitmap::GetRgnContourPoints
NC_FILTER_MATH_FUNCTION | LBitmap::GetRgnPerimeterLength
NC_FILTER_REV_EFFECT | LBitmap::MathFunction
NC_FILTER_SEGMENT | LBitmap::RevEffect
NC_FILTER_SUBTRACT_BACKGROUND | LBitmap::Segment
NC_FILTER_USER_FILTER | LBitmap::SubtractBackground
NC_FILTER_ADAPTIVE_CONTRAST | LBitmap::UserFilter
NC_FILTER_AGING | LBitmap::AdaptiveContrast
NC_FILTER_APPLY_MATH_LOGIC | LBitmap::Aging
NC_FILTER_COLOR_INTENSITY_BALANCE | LBitmap::ApplyMathLogic
NC_FILTER_COLORIZE_GRAY | LBitmap::ColorIntensityBalance
NC_FILTER_CONT_BRIGHT_INT | LBitmap::ColorizeGray
NC_FILTER_DICE_EFFECT | LBitmap::ContBrightInt
NC_FILTER_DIGITAL_SUBTRACT | LBitmap::DiceEffect
NC_FILTER_DYNAMIC_BINARY | LBitmap::DigitalSubtract
NC_FILTER_EDGE_DETECT_EFFECT | LBitmap::DynamicBinary
NC_FILTER_FUNCTIONAL_LIGHT | LBitmap::EdgeDetectEffect
NC_FILTER_MULTI_SCALE_ENHANCEMENT | LBitmap::FunctionalLight
NC_FILTER_PUZZLE_EFFECT | LBitmap::MultiScaleEnhancementBitmap
NC_FILTER_RING_EFFECT | LBitmap::PuzzleEffect
NC_FILTER_SELECT_DATA | LBitmap::RingEffect
NC_FILTER_SHIFT_DATA | LBitmap::SelectData
NC_FILTER_TEXTURE_ALPHA_BLEND | LBitmap::ShiftData
NC_FILTER_IS_REG_MARK | LBitmap::TextureAlphaBlend
NC_FILTER_GET_MARKS_CENTER_MASS | LBitmap::IsRegMarkBitmap
NC_FILTER_SEARCH_REG_MARKS | LBitmap::GetMarksCenterMass
NC_FILTER_GET_TRANSFORMATION_PARAMETERS | LBitmap::SearchRegMarks
NC_FILTER_APPLY_TRANSFORMATION_PARAMETERS | LBitmap::GetTransformationParameters
NC_FILTER_GRAY_SCALE_TO_DUOTONE | LBitmap::ApplyTransformationParameters
NC_FILTER_GRAY_SCALE_TO_MULTITONE | LBitmap::GrayScaleToDuotone
NC_FILTER_SKELETON | LBitmap::GrayScaleToMultitone
 | LBitmap::Skeleton
NC_FILTER_COLOR_LEVEL |
NC_FILTER_AUTO_COLOR_LEVEL | LBitmap::ColorLevel
NC_FILTER_SELECTIVE_COLOR | LBitmap::AutoColorLevel
NC_FILTER_CORRELATION | LBitmap::SelectiveColor
NC_FILTER_SET_OVERLAY | LBitmap::Correlation
NC_FILTER_GET_OVERLAY | LBitmap::SetOverlay
NC_FILTER_SET_OVERLAY_ATTRIBUTES | LBitmap::GetOverlay
NC_FILTER_GET_OVERLAY_ATTRIBUTES | LBitmap::SetOverlayAttributes
NC_FILTER_UPDATE_OVERLAY_BITS | LBitmap::GetOverlayAttributes
NC_FILTER_GET_OVERLAY_COUNT | LBitmap::UpdateOverlayBits
 | LBitmap::GetOverlayCount
NC_FILTER_SCRAMBLE |
NC_FILTER_APPLY_MODALITY_LUT | LBitmap::Scramble
NC_FILTER_APPLY_LINEAR_MODALITY_LUT | LBitmap::ApplyModalityLUT
NC_FILTER_APPLY_VOILUT | LBitmap::ApplyLinearModalityLUT
NC_FILTER_APPLY_LINEAR_VOILUT | LBitmap::ApplyVOILUT
NC_DIALOG_OPEN | LDialogFile::DoModalOpen
NC_DIALOG_GAMMA_ADJUSTMENT | LDialogColor::DoModalGammaAdjustment
NC_DIALOG_ADD_NOISE | LDialogImageEffect::DoModalAddNoise
NC_DIALOG_EMBOSS | LDialogImageEffect::DoModalEmboss
NC_DIALOG_COLORRES | LDialogColor::DoModalColorRes
NC_DIALOG_SAVE | LDialogFile::DoModalSave
NC_DIALOG_WINDOWLEVEL | LDialogColor::DoModalWindowLevel
NC_DIALOG_GETEFFECT | LDialogEffect::DoModalGetEffect
NC_DIALOG_GETSHAPE | LDialogEffect::DoModalGetShape
NC_DIALOG_GETTEXT | LDialogEffect::DoModalGetText
NC_DIALOG_GETGRADIENT | LDialogEffect::DoModalGetGradient
NC_DIALOG_GETTRANSITION | LDialogEffect::DoModalGetTransition
NC_DIALOG_HALFTONE | LDialogColor::DoModalHalftone
NC_DIALOG_MOTION_BLUR | LDialogImageEffect::DoModalMotionBlur
NC_DIALOG_RADIAL_BLUR | LDialogImageEffect::DoModalRadialBlur
NC_DIALOG_ZOOM_BLUR | LDialogImageEffect::DoModalZoomBlur
NC_DIALOG_GAUSSIAN_BLUR | LDialogImageEffect::DoModalGaussianBlur
NC_DIALOG_ANTI_ALIAS | LDialogImageEffect::DoModalAntiAlias
NC_DIALOG_AVERAGE | LDialogImageEffect::DoModalAverage
NC_DIALOG_MEDIAN | LDialogImageEffect::DoModalMedian
NC_DIALOG_MAX_FILTER | LDialogImageEffect::DoModalMaxFilter
NC_DIALOG_MIN_FILTER | LDialogImageEffect::DoModalMinFilter
NC_DIALOG_SHARPEN | LDialogImageEffect::DoModalSharpen
NC_DIALOG_SHIFT_DIFFERENCE_FILTER | LDialogImageEffect::DoModalShiftDifferenceFilter
NC_DIALOG_OILIFY | LDialogImageEffect::DoModalOilify
NC_DIALOG_MOSAIC | LDialogImageEffect::DoModalMosaic
NC_DIALOG_EROSION_FILTER | LDialogImageEffect::DoModalErosionFilter
NC_DIALOG_DILATION_FILTER | LDialogImageEffect::DoModalDilationFilter
NC_DIALOG_CONTOUR_FILTER | LDialogImageEffect::DoModalContourFilter
NC_DIALOG_GRADIENT_FILTER | LDialogImageEffect::DoModalGradientFilter
NC_DIALOG_LAPLACIAN_FILTER | LDialogImageEffect::DoModalLaplacianFilter
NC_DIALOG_SOBEL_FILTER | LDialogImageEffect::DoModalSobelFilter
NC_DIALOG_PREWITT_FILTER | LDialogImageEffect::DoModalPrewittFilter
NC_DIALOG_LINE_SEGMENT_FILTER | LDialogImageEffect::DoModalLineSegmentFilter
NC_DIALOG_UNSHARP_MASK | LDialogImageEffect::DoModalUnsharpMask
NC_DIALOG_MULTIPLY | LDialogImageEffect::DoModalMultiply
NC_DIALOG_ADD_BITMAPS | LDialogImageEffect::DoModalAddBitmaps
NC_DIALOG_STITCH | LDialogImageEffect::DoModalStitch
NC_DIALOG_FREE_HAND_WAVE | LDialogImageEffect::DoModalFreeHandWave
NC_DIALOG_WIND | LDialogImageEffect::DoModalWind
NC_DIALOG_POLAR | LDialogImageEffect::DoModalPolar
NC_DIALOG_ZOOM_WAVE | LDialogImageEffect::DoModalZoomWave
NC_DIALOG_RADIAL_WAVE | LDialogImageEffect::DoModalRadialWave
NC_DIALOG_SWIRL | LDialogImageEffect::DoModalSwirl
NC_DIALOG_WAVE | LDialogImageEffect::DoModalWave
NC_DIALOG_WAVE_SHEAR | LDialogImageEffect::DoModalWaveShear
NC_DIALOG_PUNCH | LDialogImageEffect::DoModalPunch
NC_DIALOG_RIPPLE | LDialogImageEffect::DoModalRipple
NC_DIALOG_BENDING | LDialogImageEffect::DoModalBending
NC_DIALOG_CYLINDRICAL | LDialogImageEffect::DoModalCylindrical
NC_DIALOG_SPHERIZE | LDialogImageEffect::DoModalSpherize
NC_DIALOG_IMPRESSIONIST | LDialogImageEffect::DoModalImpressionist
NC_DIALOG_PIXELATE | LDialogImageEffect::DoModalPixelate
NC_DIALOG_EDGE_DETECTOR | LDialogImageEffect::DoModalEdgeDetector
NC_DIALOG_UNDERLAY | LDialogImageEffect::DoModalUnderlay
NC_DIALOG_PICTURIZE | LDialogImageEffect::DoModalPicturize
NC_DIALOG_BALANCE_COLORS | LDialogColor::DoModalBalanceColors
NC_DIALOG_COLORED_GRAY | LDialogColor::DoModalColoredGray
NC_DIALOG_GRAYSCALE | LDialogColor::DoModalGrayScale
NC_DIALOG_REMAP_INTENSITY | LDialogColor::DoModalRemapIntensity
NC_DIALOG_REMAP_HUE | LDialogColor::DoModalRemapHue
NC_DIALOG_CUSTOMIZE_PALETTE | LDialogColor::DoModalCustomizePalette
NC_DIALOG_LOCAL_HISTOEQUALIZE | LDialogColor::DoModalHistoEqualize
NC_DIALOG_INTENSITY_DETECT | LDialogColor::DoModalIntensityDetect
NC_DIALOG_SOLARIZE | LDialogColor::DoModalSolarize
NC_DIALOG_POSTERIZE | LDialogColor::DoModalPosterize
NC_DIALOG_BRIGHTNESS | LDialogColor::DoModalBrightness
NC_DIALOG_CONTRAST | LDialogColor::DoModalContrast
NC_DIALOG_HUE | LDialogColor::DoModalHue
NC_DIALOG_SATURATION | LDialogColor::DoModalSaturation
NC_DIALOG_HISTOCONTRAST | LDialogColor::DoModalHistoContrast
NC_DIALOG_COLOR | LDialogColor::DoModalColor
NC_DIALOG_ROTATE | LDialogImage::DoModalRotate
NC_DIALOG_SHEAR | LDialogImage::DoModalShear
NC_DIALOG_RESIZE | LDialogImage::DoModalResize
NC_DIALOG_ADD_BORDER | LDialogImage::DoModalAddBorder
NC_DIALOG_ADD_FRAME | LDialogImage::DoModalAddFrame
NC_DIALOG_AUTO_TRIM | LDialogImage::DoModalAutoTrim
NC_DIALOG_CANVAS_RESIZE | LDialogImage::DoModalCanvasResize
NC_DIALOG_HISTOGRAM | LDialogImage::DoModalHistogram
NC_DIALOG_GETDIRECTORY | LDialogFile::DoModalGetDirectory
NC_DIALOG_FILE_CONVERSION | LDialogFile::DoModalFileConversion
NC_DIALOG_FILES_ASSOCIATION | LDialogFile::DoModalFilesAssociation
NC_DIALOG_PRINT_STITCHED_IMAGES | LDialogFile::DoModalPrintStitchedImages
NC_DIALOG_PRINT_PREVIEW | LDialogFile::DoModalPrintPreview
NC_DIALOG_REMOVE_REDEYE | LDialogDocument::DoModalRemoveRedEye
NC_DIALOG_SMOOTH | LDialogDocument::DoModalSmooth
NC_DIALOG_LINE_REMOVE | LDialogDocument::DoModalLineRemove
NC_DIALOG_BORDER_REMOVE | LDialogDocument::DoModalBorderRemove
NC_DIALOG_INVERTED_TEXT | LDialogDocument::DoModalInvertedText
NC_DIALOG_DOT_REMOVE | LDialogDocument::DoModalDotRemove
NC_DIALOG_HOLE_PUNCH_REMOVE | LDialogDocument::DoModalHolePunchRemove
NC_DIALOG_PNG_WEB_TUNER | LDialogWeb::DoModalPNGWebTuner
NC_DIALOG_GIF_WEB_TUNER | LDialogWeb::DoModalGIFWebTuner
NC_DIALOG_JPEG_WEB_TUNER | LDialogWeb::DoModalJPEGWebTuner
NC_DIALOG_HTML_MAPPER | LDialogWeb::DoModalHTMLMapper

Bitmap Changing Notification Categories:

The following is a list of all the notification categories:

Notification Category | Description
NCAT_RECTS | Changing bitmap rectangles
NCAT_BITMAP | Changing the bitmap handle
NCAT_FREE | Freeing the bitmap
NCAT_ACCESS | Accessing/Releasing bitmap data
NCAT_DIM | Changing bitmap dimensions
NCAT_EDIT | Editing bitmap data
NCAT_TRANSFORM | Doing transformations on the bitmap, such as rotation, flipping, etc.
NCAT_FILTER | Using image processing filters on the bitmap
NCAT_AUTOPROCESS | Generated by dialogs when specifying the auto process flag
NCAT_DITHERING | Start/Stop and dithering bitmap data
NCAT_REGION | Setting/Freeing bitmap region
NCAT_DIALOG | Starting/Ending an imaging common dialog. The type of the dialog is defined by the NC_DIALOG constants


Flags for the LBitmap::ApplyMathLogic 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 LBitmapBase::Combine 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 LBitmapBase::CombineExt 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 LBitmapSettings::SetDisplayMode Function

The following are the possible values for the LBitmapSettings::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 it 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 LBitmapBase::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 LPaint::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 LBitmapBase::CreateFadedMask function:

When using the LBitmapBase::CreateFadedMask function, the general process is as follows:

1. | Create an LBitmapBase object and use it to load an image.
2. | Set a region in the image using an LBitmapRgn object.
3. | Create another LBitmapBase object to hold the fade mask and call the function on the image’s object. 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………..


List of Spatial Filters

The following is a list of the predefined spatial filters that can be applied using the LBitmap::SpatialFilter 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 LBitmapRgn::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 GDI PolyBezier and PolyBezierTo functions.


Using the LBitmap::Perlin 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 LBitmap::Perlin 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 LBitmap::Perlin function, the general process is as follows:

1. | Open any bitmap.
2. | Use the LBitmap::Perlin 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 LBitmap::Clouds function also makes use of Perlin noise.


Image Optimization

LEADTOOLS provides functionality to optimize certain image file formats, by saving images using the optimal bits per pixel, based on specific optimization options. For more information about the file formats that can be optimized, refer to LEAD Image optimizer supported formats.

To optimize an image buffer in memory use the LOptimize::OptimizeBuffer function. The LOptimize::OptimizeBuffer function calls the LOptimize::OptimizeBufferCallBack function repeatedly to notify the user of the percentage of the optimization operation that has been completed.

To optimize an entire directory of images and save the optimized images to another directory, use the LOptimize::OptimizeDir function. The LOptimize::OptimizeDir function calls the LOptimize::OptimizeDirCallBack function to provide the user with information on the image(s) in the directory being optimized.

Both LOptimize::OptimizeBuffer and LOptimize::OptimizeDir, require optimization options for optimizing images. The user can get the default options by calling the LOptimize::GetDefaultOptions function.


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 LFile::InitICCProfileExt to initialize an ICC profile structure (ICCPROFILEEXT). This must be called before creating a new profile or loading an existing profile.

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 LFile::InitICCProfileExt function must be called to initialize the ICC profile structure.

To load an ICC profile from an image file, call LFile::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.

Saving an ICC Profile

An ICC profile can be saved, or embedded, in a TIFF, GIF or JPEG image file by calling LFile::SaveICCProfile.

Freeing an ICC Profile

When an ICC profile structure is no longer needed, free the structure by calling LFile::FreeICCProfileExt.


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 LFile::LoadCMYKArray. 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 LFile::LoadBitmap,
 LMemoryFile::LoadBitmap,
 LFile::LoadBitmapResize,
 LFile::LoadFile,
 LFile::LoadOffset,
 or LMemoryFile::LoadMemory
 and then obtain the CMYK planes by calling LBitmap::ColorSeparate.

Paint the bitmaps using LPaint::PaintDCCMYKArray.

To save the bitmap as TIFF CMYK, call LFile::SaveCMYKArray. To save as another format, create a BGR bitmap using LBitmap::ColorMerge and then save the image with LFile::SaveBitmap or LFile::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 Halftones 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 LBitmap::ColorSeparate 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 LBitmap::ColorSeparate function using the following values:

Parameter | Value
uFlags | COLORSEP_CMYK

The following figures result:

Use the LBitmap::ColorMerge 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 LBitmap::ColorSeparate function creates.

Use the LBitmap::ColorHalfTone 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 that 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 LBitmap::ColorHalfTone function using the following values:

Parameter | Value
uMaxRad | 8
nCyanAngle | 108
nMagentaAngle | 163
nYellowAngle | 90
nBlackAngle | 45

The following figure results:

Halftones

Use the LBitmap::Desaturate 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 LBitmap::HalfTone 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 LBitmap::HalfTone function using the following values:

Parameter | Value
uType | HT_PRINT
nAngle | 6
uDim | na
hList | na

The following figure results:

Use the LBitmap::HalfTonePattern 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 LBitmap::HalfTonePattern 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 LBitmap::HalfTonePattern 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 LBitmap::GetStatisticsInfo 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 LBitmap::GetHistogram 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 LBitmapBase::GetColorCount function to get the number of unique colors in an image. Use the LBitmapBase::GetColors function to load your palette with selected colors from a bitmap handle's palette. Use the LBitmap::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 LBitmap::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.


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 LBitmap::Posterize) 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 LPaint::FrameRgn 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 LPaint::FrameRgn 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.

To create a new curve region, or update an existing region with a curve region, use LBitmapRgn::SetRgnCurve.

Use LBitmap::SetKaufmannRgn 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.

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

Use LBitmapRgn::SetRgnMagicWand to set a region based on the color of a specified point. To create a region based on the color of a specified point and a range of tolerance values, use LBitmapRgn::SetRgnBorder.

You can also use the high-level class LBitmapWindow for creating a bitmap region. This class does all of the processing required to allow the user to interactively define a bitmap 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 LBitmapRgn::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 LBitmapRgn::SetRgnFromMask 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 LBitmapRgn::CreateMaskFromBitmapRgn function, after which you would set the mask to the alpha channel using the LBitmapBase::SetAlpha function. During load, you would get the alpha bitmap with the LBitmapBase::CreateAlphaBitmap function, convert it to 1-bit if necessary and then set the region with the LBitmapRgn::SetRgnFromMask 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


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 LPaint::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 LPaint::FrameRgn, LBitmapRgn::GetRgnBounds, and LBitmapRgn::GetRgnHandle.
 | 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 LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnHandle, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, and LBitmapRgn::SetRgnRoundRect.
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 LBitmapBase::SetAlpha.

You can use the LBitmapBase::HasRgn function to see if a bitmap has a region. If the bitmap has a region, you can do the following with it:

Use LPaint::FrameRgn to outline the region.

Display the region using functions described in Displaying a Region.

Use LBitmapRgn::GetRgnHandle to create a Windows region that is a snapshot of the bitmap region.

Use LBitmapRgn::Offset to move the region.

Use LBitmapRgn::GetRgnArea, LBitmapRgn::GetRgnBounds, and LBitmapRgn::IsPtInRgn to get information about the region's size and location.

Use LPaint::ColorRgn to display a filled, color representation of a region.

Determine the number of maximum number of segments present in any row in the region by calling LBitmapRgn::GetClipSegmentsMax. Once this is known, a buffer can be allocated and the segments can be retrieved using the LBitmapRgn::GetClipSegments function.

To create a new region, or update an existing region, based on either an HSV range or an RGB range, use the LBitmapRgn::SetRgnColorHSVRange function or the LBitmapRgn::SetRgnColorRGBRange function.

To create a new curve region, or update an existing region with a curve region, use LBitmapRgn::SetRgnCurve.

To resize a bitmap region a specific number of pixels, use the LBitmapRgn::ResizeRgn function.

Use LBitmapRgn::Free to free the region.

Use LBitmapRgn::Free to free the region.

To create a new curve region, or update an existing region with a curve region, use LBitmapRgn::SetRgnCurve.

To resize a bitmap region a specific number of pixels, use the LBitmapRgn::ResizeRgn function.

Use LBitmapRgn::HolesRemovalRgn to remove holes from a bitmap region.

Related Topics:

Saving a Region


Working with Floaters

LEADTOOLS provides a number of functions for working with floaters. To determine whether an object has a floater, use LBitmapWindow::HasFloater. For an object that has a floater, you can retrieve the floater itself using LBitmapWindow::GetFloater, or you can retrieve a region corresponding to the floater using LBitmapWindow::GetFloaterRgn.

You also have the option of generating floaters automatically from regions created programmatically. To enable or disable this option use the LBitmapWindow::SetAutoRgnToFloater function. To determine whether this option is currently enabled or disabled, use LBitmapWindow::GetAutoRgnToFloater.


Floaters and Regions in the LBitmapWindow Class

The LBitmapWindow class automates the region and floater capabilities of the toolkit.

Some definitions:

Floater

A selection (actually, a separate bitmap) that has an animated outline.

The floater can be created by using LBitmapWindow::SetToolType().

The floater can be moved by clicking and dragging the mouse.

The LBitmapWindow::HasFloater() member function returns TRUE if there is a floater.

Region

A subset of a bitmap, much like a Windows region. When a bitmap has a region, most image processing functions will only process the region and not the entire bitmap.

The LBitmapBase::HasRgn() member function returns TRUE if there is a region.

The following are various scenarios and how they can be implemented with the LBitmapWindow class.

Scenario One

I want to create a floater with the region tool, and move it around. I don't want a region

m_BitmapWindow.SetAutoFloaterToRgn(FALSE)
m_BitmapWindow.SetToolType(TOOL_REGION)
m_BitmapWindow.SetRegionType(REGION_TYPE_RECT)
<Click and drag mouse to create floater>
<Drag mouse to move floater>

In this scenario, no region is created

Scenario Two

I want to create a region with the region tool. I don't want the floater.

m_BitmapWindow.SetAutoFloaterToRgn(TRUE)
m_BitmapWindow.SetToolType(TOOL_REGION)
m_BitmapWindow.SetRegionType(REGION_TYPE_RECT)
Click and drag mouse to create floater
m_BitmapWindow.CancelRgn()
 //this removes the floater, but leaves the bitmap region

In this scenario, a region is created and the floater is destroyed.

Scenario Three

I want to create a floater programmatically (without using the tools). I don't want a bitmap region.

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(TRUE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

Scenario Four

I want to create a region programmatically (without using the tools). I don't want a floater.

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(FALSE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

Related Topics:

Saving a Region


LBitmapWindow Inherited Floater Functions

The following inherited functions will work only on an LBitmapWindow object’s floater (if one exists). These functions do not affect the main displayed bitmap:

LBitmapBase::Clear | LBitmap::HalfTone
LBitmapBase::Combine | LBitmap::AddNoise
LBitmapBase::GrayScale | LBitmap::AutoTrim
LBitmapBase::PutPixelColor | LBitmap::AverageFilter
LBitmapBase::PutColors | LBitmap::BinaryFilter
LBitmapBase::SetAlpha | LBitmap::ChangeContrast
LBitmapBase::Size | LBitmap::ChangeHue
LBitmapBase::Trim | LBitmap::ChangeIntensity
LBitmapBase::Resize | LBitmap::ChangeSaturation
LBitmapBase::ColorRes | LBitmap::Deskew
LBitmapBase::ChangeViewPerspective | LBitmap::Despeckle
LBitmapBase::CopyFromClipboard | LBitmap::Emboss
LBitmapBase::CopyToClipboard | LBitmap::GammaCorrect
LBitmapBase::Fill | LBitmap::Invert
LBitmapBase::Flip | LBitmap::HistoContrast
LBitmapBase::Resample | LBitmap::HistoEqualize
LBitmapBase::Reverse | LBitmap::IntensityDetect
LBitmapBase::Rotate | LBitmap::MaxFilter
LBitmapBase::RotateFine | LBitmap::MedianFilter
LBitmapBase::Shear | LBitmap::MinFilter
LBitmapBase::Underlay | LBitmap::Oilify
LBitmapBase::ClearNegativePixels | LBitmap::Posterize
LBitmap::Multiply | LBitmap::Solarize
LDialogImageEffect::DoModalMultiply | LBitmap::SpatialFilter
LBitmap::RemapHue | LBitmap::StretchIntensity
LDialogColor::DoModalRemapHue | LBitmap::RemapIntensity
LBitmap::AddWeighted | LBitmap::Mosaic
LBitmap::HistoEqualize | LBitmap::Sharpen
LBitmap::Pixelate | LBitmap::Picturize
LBitmap::Wind | LBitmap::WindowLevel
LBitmap::Impressionist | LBitmap::WindowLevelBitmap
LBitmap::Wave | LBitmap::ZoomWave
LBitmap::RadWave | LBitmap::FreeHandShear
LBitmap::FreeHandWave | LBitmap::AddMessage
LBitmap::ExtractMessage | LBitmap::Spherize
LBitmap::Cylindrical | LBitmap::Bending
LBitmap::Punch | LBitmap::Polar
LBitmap::Ripple | LBitmap::RadialBlur
LBitmap::ZoomBlur | LBitmap::Swirl
LBitmap::Deinterlace | LBitmap::SampleTarget
LBitmap::HalfTone | LBitmap::Cubism
LBitmap::LightControl | LBitmap::Light
LBitmap::GlassEffect | LBitmap::Dry
LBitmap::LensFlare | LBitmap::DrawStar
LBitmap::BumpMap | LBitmap::AddShadow
LBitmap::GlowFilter | LBitmap::AllocFTArray
LBitmap::EdgeDetectStatistical | LBitmap::ChangeHueSatIntBitmap
LBitmap::Desaturate | LBitmap::ColorReplace
LBitmap::SmoothEdges | LBitmap::ColorThreshold
LBitmap::AutoBinary | LBitmap::DFT
LBitmap::BinaryFilter | LBitmap::DirectionEdgeStatistical
LBitmap::ChannelMix | LBitmap::FFT
LBitmap::Plane | LBitmap::FTDisplay
LBitmap::PlaneBend | LBitmap::FrqFilter
LBitmap::Tunnel | LBitmap::FrqFilterMask
LBitmap::FreeRadBend | LBitmap::GetStatisticsInfo
LBitmap::FreePlaneBend | LBitmap::GetFeretsDiameter
LBitmap::Ocean | LBitmap::GetObjectInfo
LBitmap::GetRgnContourPoints | LBitmap::ContBrightInt
LBitmap::GetRgnPerimeterLength | LBitmap::DiceEffect
LBitmap::MathFunction | LBitmap::DigitalSubtract
LBitmap::RevEffect | LBitmap::DynamicBinary
LBitmap::Segment | LBitmap::EdgeDetectEffect
LBitmap::SubtractBackground | LBitmap::FunctionalLight
LBitmap::UserFilter | LBitmap::MultiScaleEnhancementBitmap
LBitmap::AdaptiveContrast | LBitmap::PuzzleEffect
LBitmap::Aging | LBitmap::RingEffect
LBitmap::ApplyMathLogic | LBitmap::SelectData
LBitmap::ColorIntensityBalance | LBitmap::ShiftData
LBitmap::ColorizeGray | LBitmap::TextureAlphaBlend
LBitmap::IsRegMarkBitmap | LBitmap::Skeleton
LBitmap::GetMarksCenterMass | LBitmap::ColorLevel
LBitmap::SearchRegMarks | LBitmap::AutoColorLevel
LBitmap::GetTransformationParameters | LBitmap::SelectiveColor
LBitmap::ApplyTransformationParameters | LBitmap::Correlation
LBitmap::GrayScaleToDuotone | LBitmap::Scramble
LBitmap::GrayScaleToMultitone |


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:

LAnnAutomation::SetAutoText( 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.
LAnnAutomation::SetAutoDialogFontSize( 9);

//Change the font name.
LAnnAutomation::SetAutoText( ANNAUTOTEXT_DIALOG_FONT, "Japanese
 Font Name");

2.

Change all the automation strings as follows:

LAnnAutomation::SetAutoText( ANNAUTOTEXT_XXX, "New Japanese String.");

3.

Change the default font to be used for all annotation objects (except buttons) created with this automation object, as follows.

LAnnotation::SetFontName( "Japanese Font Name");


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:

LAnnContainer::Create

Then, use the following functions to create and maintain an automation object:

LAnnAutomation::Create

LAnnAutomation::SetAutoContainer

LAnnAutomation::GetAutoContainer

LAnnAutomation::SetTool

LAnnAutomation::GetTool

LAnnAutomation::SetDpiX

LAnnAutomation::SetDpiY

LAnnAutomation::GetDpiX

LAnnAutomation::GetDpiY

LAnnAutomation::SetAutoHilightPen

LAnnAutomation::GetAutoCursor

LAnnContainer::Insert

LAnnotation::SetAutoDefaults

LAnnotation::GetRect

LAnnotation::SetRect

LAnnAutomation::GetShowFlags

LAnnAutomation::SetShowFlags

LAnnotation::GetAutoBackColor

LAnnotation::SetAutoBackColor

LAnnotation::GetOptions

LAnnotation::SetOptions

LAnnotation::SetTextOptions

LAnnotation::GetTextOptions

LAnnotation::SetFillMode

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnotation::SetFillModeExt

The following functions provide selection capabilities:

LAnnotation::IsSelected

LAnnotation::Remove

LAnnContainer::SelectPoint

LAnnContainer::SelectRect

LAnnContainer::GetSelectRect

LAnnotation::GetContainer

LAnnotation::GetTopContainer

LAnnotation::CutToClipboard

LAnnotation::GetType

LAnnotation::ShowLockedIcon

LAnnotation::SetSelected

LAnnContainer::Insert

Use the LAnnotation::CreateAnnObject function to create an annotation class object of the specified type. You can use this static function to get a proper annotation class object that is compatible and of the same type as the passed annotation handle.

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 LAnnotation::SetTag function sets the tag, and LAnnotation::GetTag gets the current tag.
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.

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

New Annotation Features of Version 14.5

Calibrating Annotation Ruler Objects


Implementing Custom Annotations

[Document/Medical ]

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:

LAnnContainer::RestrictCursor

LAnnContainer::HitTestExt

LAnnotation::SetRestrictToContainer

LAnnotation::GetRestrictToContainer

LAnnContainer::Convert

LAnnotation::AdjustPoint

LAnnotation::Define

LAnnotation::Define2

LAnnotation::CalibrateRuler

LAnnotation::GetAutoSnapCursor

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetRotateOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetRotateOptions

LAnnotation::SetTextOptions

In addition, functionality for adding and maintaining user-defined handles has been added to the Annotation Class Library. This functionality has been implemented by adding the AddUserHandle, GetUserHandle, GetUserHandles, ChangeUserHandle, DeleteUserHandle, EnumerateHandles, and EnumHandleCallBack functions to each of the following classes:

LAnnAudioClip

LAnnButton

LAnnCrossProduct

LAnnCurve

LAnnCurveClosed

LAnnEllipse

LAnnEncrypt

LAnnFreehand

LAnnFreehandHotSpot

LAnnHilite

LAnnHotSpot

LAnnLine

LAnnNote

LAnnPolygon

LAnnPoint

LAnnPolyline

LAnnPolyRuler

LAnnProtractor

LAnnPointer

LAnnPushPin

LAnnRedact

LAnnRectangle

LAnnRTF

LAnnRuler

LAnnStamp

LAnnText

LAnnTextPointer

LAnnToolBar

LAnnVideo

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.

The following narrative describes the process of creating a custom annotation.

In the LEAD toolkit, there is no LAnnotation::Define 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 LAnnotation::Define 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 LAnnotation::CreateAnnObject (). 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 LAnnotation::Define(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 LAnnotation::Define(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 LAnnotation::Define state to do this, so it is necessary to process the LTANNEVENT_HIGHLIGHT message. This message allows you to customize the highlighting 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 LAnnotation::SetSelected , give them their default automation values (using LAnnotation::SetAutoDefaults), and finally group them together (using LAnnotation::Group). 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 LAnnotation::Define and LAnnotation::Define2 statements to accomplish the desired behavior.

4.

Restricts the mouse cursor. This can easily be done in two ways:

i) Calling LAnnContainer::RestrictCursor(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 LAnnotation::AdjustPoint 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 (LAnnotation::Define(ANNDEFINE_BEGINRESIZE) and move the line (LAnnotation::Define (ANNDEFINE_MOVE).

If dragging handle HANDLE_ID_HORIZONTAL_BOTTOM, we want to again resize the rectangle (LAnnotation::Define(ANNDEFINE_BEGINRESIZE)), but with the line instead of moving it, we now want to resize it. (LAnnotation::Define(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 an LAnnotation::Define(ANNDEFINE_BEGINROTATE). This is done for both the line and the rectangle.

)

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.

See Also

WM_LTANNEVENT Message

ANNMOUSEPOS

Implementing Annotations

Automated User Interface for Annotations


Automated User Interface for Annotations

Note:

This topic is for Document/Medical only.

The annotation example program that ships with LEADTOOLS is implemented using the high-level LAnnotationWindow class automated features. This topic describes how the example program uses the LAnnotationWindow class.

First, the example derives a user-defined class from the LEADTOOLS LAnnotationWindow class. Then, the example assigns the handle of the window created by the MFC framework to the LAnnotationWindow derived class in the CAnnDemoView::OnCreate function. This allows the LEADTOOLS class object to do all of the necessary processing for displaying images and annotations in the MDI child windows. (Note: This example is using the LAnnotationWindow class object as a window, not as a control.)

The demo creates the Annotation Toolbar by using the LAnnotationWindow::GetToolBar function to get a pointer to an LAnnToolbar object. Then, it calls LAnnToolbar::Create to create the toolbar.The example code also handles selecting the appropriate button on the toolbar in response to the menu items.

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 LAnnotationWindow::AnnLoad function. If there is no associated annotation file, the LAnnotationWindow object automatically creates an annotation container that is the same size as the bitmap. The LAnnotationWindow object also creates and assigns an automation object automatically. (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 LAnnotationWindow::AnnPrint function.

Edit > User Mode sets the automated user mode to design mode or run mode by first calling LAnnotationWindow::GetContainerObject and then using the returned object to call LAnnContainer::SetUserMode.

Edit > Tool changes the selected tool in the toolbar by first calling LAnnotationWindow::GetAutomationObject and then using the returned object to call LAnnAutomation::SetTool.

View > Normal, Zoom, and Fit Image to Window change the display rectangle for painting the image by calling the base class LBitmapWindow::SetZoomMode. The LAnnotationWindow class automatically handles scrolling and/or zooming the annotation objects.

Behavior That Is Automated

The toolbar created by the LAnnToolbar::Create 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 binary raster operation (ROP2) code property. See ROP2 Dialog Box for Annotations.

Change whether transparency is used.

Change the transparent color. See Color Dialog Box for Annotations.

Change the default fill mode (transparent, translucent, or opaque) and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

Change the default foreground and background colors. See Color Dialog Box for Annotations.

Change the background color used by Note, Redact, or Hilite objects. See Color Dialog Box for Annotations.

Change the font selection and font characteristics. See Font Dialog Box for Annotations.

Change the Button font selection and font characteristics. See Font Dialog Box for Annotations.

Change the metafile to be used by Hotspot objects. See Hotspot Metafile Dialog Box for Annotations.

Change the metafile to be used by Encrypt objects. See Encrypt Metafile Dialog Box for Annotations.

Change the metafile to be used by Decrypt objects. See Decrypt Metafile Dialog Box for 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 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.

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 LAnnContainer::Insert. 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 LAnnAutomation::SetAutoText, 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 LAnnAutomation::SetAutoText and pass a valid string.

The default background color does not affect highlight, redaction, and note objects.

Use the LAnnotation::SetOptions function and the LAnnotation::GetOptions 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 Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function.

Use the LAnnotation::SetFillMode and LAnnotation::GetFillMode functions to manage the fill mode used by annotation objects. The LAnnotation::SetFillModeExt and the LAnnotation::GetFillModeExt 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 LAnnotation::SetOptions function.

For low-level implementation details, refer to the Container Annotation Object and the Annotation Automation Object topics.


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 LPaint::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:

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::GetScalarX

LAnnotation::GetScalarY

Offsets:

LAnnotation::SetOffsetX

LAnnotation::SetOffsetY

LAnnotation::GetOffsetX

LAnnotation::GetOffsetY

Related topics:

Implementing Annotations

Types of Annotations


Implementing Annotation Security

Note:

This topic is for Document/Medical only.

LEADTOOLS provides annotation security through a number of functions. LAnnotation::Lock and LAnnotation::Unlock let you lock and unlock annotations using a specific case sensitive key. LAnnotation::ShowLockedIcon provides you the option of having a padlock icon drawn on top of all locked objects. LAnnotation::IsLocked 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 LAnnotation::SetHyperlink. To determine the type of hyperlink associated with an annotation, use LAnnotation::GetHyperlink. 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 LAnnotation::GetHyperlinkLen 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, LAnnAutomation::SetHyperlinkMenuEnabled 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 LAnnAutomation::IsHyperlinkMenuEnabled.


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.

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:

LAnnContainer::Load

LAnnContainer::LoadMemory

LAnnContainer::LoadOffset

Each annotation file contains information about the annotations stored in that file. This information can be obtained using the following functions:

LAnnContainer::FileInfo

LAnnContainer::FileInfoMemory

LAnnContainer::FileInfoOffset

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:

LAnnContainer::DeletePage

LAnnContainer::DeletePageMemory

LAnnContainer::DeletePageOffset

Finally, annotation files may be saved to disk, to memory, or embedded within another file, using the following functions:

LAnnContainer::Save

LAnnContainer::SaveMemory

LAnnContainer::SaveOffset


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


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:

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::GetScalarX

LAnnotation::GetScalarY

Offsets:

LAnnotation::SetOffsetX

LAnnotation::SetOffsetY

LAnnotation::GetOffsetX

LAnnotation::GetOffsetY

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:

Functionality for Fixing an annotation programmatically has been added to the Annotation Class Library. This functionality has been implemented by adding the LAnnXXX::GetFixed, LAnnXXX::SetFixed, LAnnXXX::PushFixedState, LAnnXXX::PopFixedState, and LAnnXXX::FixedInRect functions, where LAnnXXX represents the classes that support fixing. These classes are as follows:

LAnnAutomation

LAnnAudioClip

LAnnButton

LAnnCrossProduct

LAnnCurve

LAnnCurveClosed

LAnnEllipse

LAnnFreehand

LAnnFreehandHotSpot

LAnnHilite

LAnnHotSpot

LAnnLine

LAnnNote

LAnnPolygon

LAnnPoint

LAnnPolyline

LAnnPolyRuler

LAnnProtractor

LAnnPointer

LAnnPushPin

LAnnRectangle

LAnnRTF

LAnnRuler

LAnnStamp

LAnnText

LAnnTextPointer

LAnnVideo

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:

LAnnAutomation::ClearTextTokenTable

LAnnAutomation::DeleteTextTokenTable

LAnnAutomation::EnumerateTextTokenTable

LAnnAutomation::GetTextExpandTokens

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::SetTextExpandTokens

Use LAnnAutomation::ClearTextTokenTable to remove all tokens from the text token table.

Use LAnnAutomation::DeleteTextTokenTable to delete a text token from the annotation text token table.

Use LAnnAutomation::EnumerateTextTokenTable to examine the contents of the annotation text token table.

Use LAnnAutomation::GetTextExpandTokens to get the text expand token property of an annotation.

Use LAnnAutomation::InsertTextTokenTable to insert a text token into the text token table.

Use LAnnAutomation::SetTextExpandTokens 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.


Grouping and Ungrouping Annotation Objects

Note: | This topic is for Document/Medical only.
Note: | This topic only applies for annotation automation mode.

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

Objects that are in a subcontainer of the main container are treated in the automated mode as grouped. When you select/unselect one object belonging to a group, all the other objects belonging to the same group are selected/unselected.

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


Using Rulers in Annotation Objects

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 LAnnAutomation::GetUnit function or the LAnnRuler::GetUnit 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 LAnnAutomation::SetUnit or the LAnnRuler::SetUnit 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.

You can calibrate a ruler by calling the LAnnotation::CalibrateRuler function. For more information, refer to Calibrating Annotation Ruler Objects. Note that with Version 14.5, this function must be enabled by passing OPTIONS_NEW_ CALIBRATE_RULER to the LAnnotation::SetOptions function before calling LAnnotation::CalibrateRuler. For more information, refer to New Annotation Features of Version 14.5.

Each annotation object class that uses rulers has two members that can be used to get the length of a ruler: a GetDistance function and a GetDistance2 function (except the LAnnAutomation class only has LAnnAutomation::GetDistance). The GetDistance member can be used with up to 2 rulers, whereas the AnnGetDistance2 function can be used on any of the ruler objects. Use the GetDistance2 member to get the length of all the rulers in a ANNOBJECT_POLYRULER object. If the annotation object is type ANNOBJECT_CROSSPRODUCT, ANNOBJECT_PROTRACTOR or ANNOBJECT_POLYRULER, the GetDistance2 member provides more information on the length of each ruler, the number of rulers, the unit of measure of each ruler and the total length of all rulers. The AnnGetDistance2 function is meant to replace the AnnGetDistance function, which is being phased out.

At each end of the ruler is a perpendicular line called a gauge. Depending on which object is being used, call the LAnnAutomation::SetGaugeLength or the LAnnRuler::SetGaugeLength 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 LAnnAutomation::GetGaugeLength or the LAnnRuler::GetGaugeLength 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. Depending on which object is being used, the length of these tick marks can be set using the LAnnAutomation::SetTicMarkLength, the LAnnPolyRuler::SetTicMarkLength, or the LAnnRuler::SetTicMarkLength function The length of the tic mark is expressed in pixels, not in points. Use the LAnnAutomation::GetShowFlags or the LAnnRuler::GetShowFlags function to determine how the rulers are being displayed. Use the LAnnAutomation::SetShowFlags or the LAnnRuler::SetShowFlags 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 LAnnAutomation::SetBitmapDpiYL function and set the vertical Bitmap DPI value to the bitmap's Y resolution. Likewise, call the LAnnAutomation::SetBitmapDpiXL 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

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:

SetBitmap – The LAnnStamp, LAnnPushPin, and LAnnPoint classes each have a SetBitmap member that can be used to set the bitmap for the ANNOBJECT_STAMP, ANNOBJECT_POINT, or ANNOBJECT_PUSHPIN 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.

GetBitmap – The LAnnStamp, LAnnPushPin, and LAnnPoint classes each have a GetBitmap member that can be used to get the bitmap for the ANNOBJECT_STAMP, ANNOBJECT_POINT, or ANNOBJECT_PUSHPIN 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, 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.

SetMetafile – The LAnnStamp, LAnnHotSpot, LAnnEncrypt, and LAnnFreehandHotSpot classes each have a SetMetafile member that can be used to set the metafile for 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 LAnnotation::SetPredefinedMetafile function and pass NULL to hMetafile.

GetMetafile – The LAnnStamp, LAnnHotSpot, LAnnEncrypt, and LAnnFreehandHotSpot classes each have a GetMetafile member that can be used to retrieve the metafile for the selected ANNOBJECT_STAMP, ANNOBJECT_HOTSPOT, ANNOBJECT_FREEHANDHOTSPOT, and ANNOBJECT_ENCRYPT objects and the Rubber Stamp tool.

SetSecondaryBitmap - Only PushPin objects (ANNOBJECT_PUSHPIN) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the LAnnPushPin::SetBitmap and LAnnPushPin::GetBitmap functions) which displays whenever the text is shown, and a secondary bitmap, changed using the LAnnPushPin::SetSecondaryBitmap 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.

GetSecondaryBitmap - Gets the secondary bitmap used by the specified annotation object. Only PushPin objects (ANNOBJECT_PUSHPIN) use a secondary bitmap. A PushPin object has a primary bitmap, (manipulated using the LAnnPushPin::SetBitmap and LAnnPushPin::GetBitmap functions) which displays whenever the text is shown, and a secondary bitmap, changed using the LAnnPushPin::SetSecondaryBitmap 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.

GetPredefinedBitmap – LAnnPoint::GetPredefinedBitmap gets a copy of the specified predefined bitmap, used for the annotation Point object (ANNOBJECT_POINT).

SetPredefinedBitmap – Changes or resets the predefined bitmap, used for the annotation Point object (ANNOBJECT_POINT).

GetSecondaryMetafile - LAnnEncrypt::GetSecondaryMetafile 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. Use the LAnnEncrypt::GetMetafile function to retrieve the current metafile for an encrypt object in an ‘encryptor’ state.

SetPredefinedMetafile – The LAnnStamp, LAnnHotSpot, LAnnEncrypt, and LAnnFreehandHotSpot classes each have a SetPredefinedMetafile member that sets the default metafiles used by the associated object types:

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_STAMP (including the Rubber Stamp tools)

GetPredefinedMetafile – The LAnnStamp, LAnnHotSpot, LAnnEncrypt, and LAnnFreehandHotSpot classes each have a GetPredefinedMetafile member that sets the default metafiles used by the associated object types:

ANNOBJECT_ENCRYPT

ANNOBJECT_FREEHANDHOTSPOT

ANNOBJECT_HOTSPOT

ANNOBJECT_STAMP

Rubber Stamp Tool


Displaying and Manipulating Annotation Objects

Note:

This topic is for Document/Medical only.

The LAnnotation::Draw function can be used to display a specific annotation object. If the annotation object is within a container, call the LAnnotation::BringToFront or the LAnnotation::SendToBack function to alter the object’s display order within the container.

The LAnnAutomation::SetAutoDrawEnabled 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 property must be set to True.

To apply an annotation object (except for Encrypt objects, which cannot be realized) to the bitmap itself, call the LAnnotation::Realize or the LAnnContainer::Realize function. This application is permanent, except when realizing a redact object. Realized redact objects store the background behind them within the object. Call LAnnContainer::Unrealize or LAnnRedact::Unrealize to restore the background hidden by the redact object.

Call the LAnnotation::SetVisible 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 True, a user can select them with a mouse. Call the LAnnotation::IsVisible function to determine whether the specified object is visible.

Use the LAnnotation::SetAutoSnapCursor 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 LAnnotation::GetAutoSnapCursor function to get a value that indicates whether snapping is enabled.

The following functions may be used to work with containers and the objects they contain:

LAnnAutomation::SetAutoContainer

LAnnContainer::Convert

LAnnContainer::CopyFromClipboard

LAnnContainer::Create

LAnnContainer::GetGrouping

LAnnContainer::GetItem

LAnnContainer::GetSelectcount

LAnnContainer::GetSelectItems

LAnnContainer::GetSelectRect

LAnnContainer::HitTest

LAnnContainer::HitTestExt

LAnnContainer::Insert

LAnnContainer::RestrictCursor

LAnnContainer::SelectPoint

LAnnContainer::SelectRect

LAnnContainer::SetGrouping

LAnnotation::BringToFront

LAnnotation::Copy

LAnnotation::CreateAnnObject

LAnnotation::CutToClipboard

LAnnotation::Define2

LAnnotation::Define

LAnnotation::Destroy

LAnnotation::Flip

LAnnotation::GetBoundingRect

LAnnotation::GetContainer

LAnnotation::GetRect

LAnnotation::GetRestrictToContainer

LAnnotation::GetScalarX

LAnnotation::GetScalarY

LAnnotation::GetTopContainer

LAnnotation::Group

LAnnotation::IsClipboardReady

LAnnotation::Lock

LAnnotation::Realize

LAnnotation::Remove

LAnnotation::Resize

LAnnotation::Reverse

LAnnotation::Rotate

LAnnotation::SendToBack

LAnnotation::SetRect

LAnnotation::SetRestrictToContainer

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::SetSelected

LAnnotation::Ungroup

LAnnotation::Unlock

LAnnotationWindow::CopyFromClipboard

LAnnotationWindow::CopyToClipboard

LAnnotationWindow::CreateWnd

LAnnotationWindow::GetAutomationObject

LAnnotationWindow::GetContainerObject

LAnnotationWindow::GetContainerObject

LAnnotation::SetRestrictToContainer

If the annotation object(s) are Stamp or Point objects and are using a bitmap, the user can call the following functions to set transparency and the transparent color:

LAnnAutomation::GetTransparentColor

LAnnAutomation::SetTransparentColor

LAnnPoint::GetTransparent

LAnnPoint::GetTransparentColor

LAnnPoint::SetTransparent

LAnnPoint::SetTransparentColor

LAnnStamp::GetTransparentColor

LAnnStamp::GetTransparent

LAnnStamp::SetTransparent

LAnnStamp::SetTransparentColor

Set the color display options of any annotation object by calling the following functions:

LAnnotation::GetROP2

LAnnotation::SetROP2

When working with automated annotations, change the color of the pen used for highlighting and selecting by calling the following function:

LAnnAutomation::SetAutoHilightPen

Perform geometric transformations on an annotation object by calling the following functions:

LAnnFreehand::Define

LAnnFreehand::GetPointCount

LAnnotation::BringToFront

LAnnotation::Define2

LAnnotation::Define

LAnnotation::Flip

LAnnotation::Move

LAnnotation::Resize

LAnnotation::Reverse

LAnnotation::Rotate

LAnnotation::SendToBack

LAnnPolygon::Define

LAnnPolygon::GetPointCount

LAnnPolyline::Define

LAnnPolyline::GetPointCount


Flipping, Reversing and Rotating Annotation Objects

Note:

This topic is for Document/Medical only.

LEADTOOLS provides several methods for manipulating annotation objects so they are flipped, reversed, or rotated.

Use the LAnnotation::Flip 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 is 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 LAnnotation::Reverse 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 is 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 LAnnotation::Rotate function to rotate one or more annotation objects.

New with Version 14.5 of LEADTOOLS are the LAnnotation::GetRotateOptions and the LAnnotation::SetRotateOptions functions to control the interface used for performing rotations. For Version 14.5 of LEADTOOLS, enable these functions by calling the LAnnotation::SetOptions function and passing OPTIONS_NEW_ROTATE. For more information, refer to New Annotation Features of Version 14.5.

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:

ANN_OBJECT_AUDIO - metafile does not flip/reverse

ANN_OBJECT_BUTTON - text itself does not flip/reverse

ANN_OBJECT_ENCRYPT - metafile does not flip/reverse

ANN_OBJECT_FREEHANDHOTSPOT -- metafile does not flip/reverse

ANN_OBJECT_HOTSPOT - metafile does not flip/reverse

ANN_OBJECT_NOTE - text itself does not flip/reverse

ANN_OBJECT_POINT - if the point uses an image, the image does not flip/reverse

ANN_OBJECT_PUSHPIN - text itself does not flip/reverse

ANN_OBJECT_RTF - text itself does not flip/reverse

ANN_OBJECT_STAMP – the text flips/reverses, but the image and metafile do not flip/reverse

ANN_OBJECT_TEXT - text itself does not flip/reverse

ANN_OBJECT_TEXTPOINTER - the tail flips, but the text does not flip/reverse

ANN_OBJECT_VIDEO - metafile does not flip/reverse

Rotating:

All objects rotate EXCEPT for the following objects:

ANN_OBJECT_AUDIO

ANN_OBJECT_BUTTON

ANN_OBJECT_ENCRYPT

ANN_OBJECT_FREEHANDHOTSPOT – the object rotates, but not the metafile

ANN_OBJECT_HOTSPOT

ANN_OBJECT_NOTE

ANN_OBJECT_POINT

ANN_OBJECT_PUSHPIN

ANN_OBJECT_RTF

ANN_OBJECT_TEXTPOINTER

ANN_OBJECT_VIDEO

See Also

Displaying and Manipulating Annotation Objects


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 the LAnnAutomation::SetAutoHilightPen function.

To change the highlight color back to the default color after changing the highlight color, you must call the LAnnAutomation::SetAutoHilightPen function and use a COLORREF value of 0xFFFFFF (white).


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.

LAnimationWindow::SetBackgroundColor

LAnimationWindow::SetBitmapList

LAnimationWindow::SetDelay

LAnimationWindow::SetDisposalMethod

LAnimationWindow::SetPosition

LAnnContainer::SetBackColor

LAnnContainer::SetBitmap

LAnnContainer::SetDpiX

LAnnContainer::SetDpiY

LAnnContainer::SetFillMode

LAnnContainer::SetFillPattern

LAnnContainer::SetFontBold

LAnnContainer::SetFontItalic

LAnnContainer::SetFontName

LAnnContainer::SetFontSize

LAnnContainer::SetFontStrikeThrough

LAnnContainer::SetFontUnderline

LAnnContainer::SetForeColor

LAnnContainer::SetGrouping

LAnnContainer::SetLineStyle

LAnnContainer::SetLineWidth

LAnnContainer::SetNodes

LAnnContainer::SetPolyFillMode

LAnnContainer::SetText

LAnnotation::SetTextOptions

LAnnotation::GetTextOptions

LAnnContainer::SetTransparent

LAnnContainer::SetTransparentColor

LAnnContainer::SetUserMode

LAnnContainer::SetWnd

LAnnotation::SetActiveState

LAnnotation::SetAutoBackColor

LAnnotation::SetAutoDefaults

LAnnotation::SetAutoMenuItemEnable

LAnnotation::SetAutoMenuState

LAnnotation::SetAutoSnapCursor

LAnnotation::SetBackColor

LAnnotation::SetFillMode

LAnnotation::SetFontBold

LAnnotation::SetFontItalic

LAnnotation::SetFontName

LAnnotation::SetFontSize

LAnnotation::SetFontStrikeThrough

LAnnotation::SetFontUnderline

LAnnotation::SetForeColor

LAnnotation::SetHandle

LAnnotation::SetHyperlink

LAnnotation::SetNameOptions

LAnnotation::SetOffsetX

LAnnotation::SetOffsetY

LAnnotation::SetPredefinedMetafile

LAnnotation::SetRect

LAnnotation::SetRestrictToContainer

LAnnotation::SetRotateOptions

LAnnotation::SetROP2

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnotation::SetUser

LAnnotation::SetUserData

LAnnotation::SetVisible

LAnnotationWindow::SetWndHandle

LAnnToolBar::SetButtonVisible

LAnnToolBar::SetToolBarButtons

LAnnToolBar::SetToolBarColumns

LAnnToolBar::SetToolBarRows

LAnnToolBar::SetToolChecked

This next set of functions are more specialized in terms of which annotation objects they apply to. For more information, refer to the individual function's documentation.

LAnnAudioClip::SetFixed

LAnnAudioClip::SetText

LAnnButton::SetFixed

LAnnButton::SetForeColor

LAnnButton::SetText

LAnnCrossProduct::SetFixed

LAnnCrossProduct::SetLineStyle

LAnnCrossProduct::SetLineWidth

LAnnCrossProduct::SetPoints

LAnnCurve::SetFixed

LAnnCurve::SetPoints

LAnnCurveClosed::SetPoints

LAnnCurveClosed::SetFixed

LAnnEllipse::SetBackColor

LAnnEllipse::SetFillMode

LAnnEllipse::SetFillPattern

LAnnEllipse::SetFixed

LAnnEllipse::SetForeColor

LAnnEllipse::SetLineStyle

LAnnEllipse::SetLineWidth

LAnnEncrypt::SetEncryptOptions

LAnnEncrypt::SetLineStyle

LAnnEncrypt::SetLineWidth

LAnnEncrypt::SetMetafile

LAnnFreehand::SetFixed

LAnnFreehand::SetForeColor

LAnnFreehand::SetLineStyle

LAnnFreehand::SetLineWidth

LAnnFreehand::SetNodes

LAnnFreehand::SetPoints

LAnnFreehandHotSpot::SetFixed

LAnnFreehandHotSpot::SetMetafile

LAnnHilite::SetBackColor

LAnnHilite::SetFixed

LAnnHotSpot::SetFixed

LAnnHotSpot::SetMetafile

LAnnLine::SetFixed

LAnnLine::SetForeColor

LAnnLine::SetLineStyle

LAnnLine::SetLineWidth

LAnnNote::SetBackColor

LAnnNote::SetFixed

LAnnNote::SetFontBold

LAnnNote::SetFontItalic

LAnnNote::SetFontName

LAnnNote::SetFontSize

LAnnNote::SetFontStrikeThrough

LAnnNote::SetFontUnderline

LAnnNote::SetForeColor

LAnnNote::SetText

LAnnNote::SetTextAlign

LAnnNote::SetTextRotate

LAnnPoint::SetBitmap

LAnnPoint::SetFixed

LAnnPoint::SetPointOptions

LAnnPoint::SetPoints

LAnnPoint::SetPredefinedBitmap

LAnnPoint::SetTransparent

LAnnPoint::SetTransparentColor

LAnnPointer::SetFixed

LAnnPointer::SetForeColor

LAnnPointer::SetLineStyle

LAnnPointer::SetLineWidth

LAnnPolygon::SetBackColor

LAnnPolygon::SetFillMode

LAnnPolygon::SetFillPattern

LAnnPolygon::SetFixed

LAnnPolygon::SetForeColor

LAnnPolygon::SetLineStyle

LAnnPolygon::SetLineWidth

LAnnPolygon::SetNodes

LAnnPolygon::SetPoints

LAnnPolygon::SetPolyFillMode

LAnnPolyline::SetFixed

LAnnPolyline::SetForeColor

LAnnPolyline::SetLineStyle

LAnnPolyline::SetLineWidth

LAnnPolyline::SetNodes

LAnnPolyline::SetPoints

LAnnPolyRuler::SetFixed

LAnnPolyRuler::SetLineStyle

LAnnPolyRuler::SetLineWidth

LAnnPolyRuler::SetNodes

LAnnPolyRuler::SetPoints

LAnnPolyRuler::SetTicMarkLength

LAnnProtractor::SetFixed

LAnnProtractor::SetPoints

LAnnProtractor::SetProtractorOptions

LAnnPushPin::SetBitmap

LAnnPushPin::SetFixed

LAnnPushPin::SetSecondaryBitmap

LAnnRectangle::SetBackColor

LAnnRectangle::SetFillMode

LAnnRectangle::SetFillPattern

LAnnRectangle::SetFixed

LAnnRectangle::SetForeColor

LAnnRectangle::SetLineStyle

LAnnRectangle::SetLineWidth

LAnnRTF::SetFixed

LAnnRTF::SetText

LAnnRTF::SetTextRTF

LAnnRedact::SetBackColor

LAnnRuler::SetFixed

LAnnRuler::SetFontBold

LAnnRuler::SetFontItalic

LAnnRuler::SetFontName

LAnnRuler::SetFontSize

LAnnRuler::SetFontStrikeThrough

LAnnRuler::SetFontUnderline

LAnnRuler::SetForeColor

LAnnRuler::SetGaugeLength

LAnnRuler::SetLineStyle

LAnnRuler::SetLineWidth

LAnnRuler::SetPoints

LAnnRuler::SetShowFlags

LAnnRuler::SetTicMarkLength

LAnnRuler::SetUnit

LAnnStamp::SetBackColor

LAnnStamp::SetBitmap

LAnnStamp::SetFillMode

LAnnStamp::SetFillPattern

LAnnStamp::SetFixed

LAnnStamp::SetFontBold

LAnnStamp::SetFontItalic

LAnnStamp::SetFontName

LAnnStamp::SetFontSize

LAnnStamp::SetFontStrikeThrough

LAnnStamp::SetFontUnderline

LAnnStamp::SetForeColor

LAnnStamp::SetLineStyle

LAnnStamp::SetLineWidth

LAnnStamp::SetMetafile

LAnnStamp::SetText

LAnnStamp::SetTransparent

LAnnStamp::SetTransparentColor

LAnnText::SetBackColor

LAnnText::SetFillMode

LAnnText::SetFixed

LAnnText::SetFontBold

LAnnText::SetFontItalic

LAnnText::SetFontName

LAnnText::SetFontSize

LAnnText::SetFontStrikeThrough

LAnnText::SetFontUnderline

LAnnText::SetForeColor

LAnnText::SetText

LAnnText::SetTextAlign

LAnnTextPointer::SetFixed

LAnnTextPointer::SetTextAlign

LAnnTextPointer::SetTextPointerFixed

LAnnTextPointer::SetTextRotate

LAnnVideo::SetFixed

LAnnVideo::SetFixed

This final set of functions apply only to automation annotation objects.

LAnnAutomation::SetAutoContainer

LAnnAutomation::SetAutoCursor

LAnnAutomation::SetAutoDialogFontSize

LAnnAutomation::SetAutoDrawEnabled

LAnnAutomation::SetAutoMenuEnabled

LAnnAutomation::SetAutoOptions

LAnnAutomation::SetAutoText

LAnnAutomation::SetAutoUndoEnable

LAnnAutomation::SetBackColor

LAnnAutomation::SetBitmapDpiX

LAnnAutomation::SetBitmapDpiY

LAnnAutomation::SetDpiX

LAnnAutomation::SetDpiY

LAnnAutomation::SetEncryptOptions

LAnnAutomation::SetFillMode

LAnnAutomation::SetFillPattern

LAnnAutomation::SetFixed

LAnnAutomation::SetFontBold

LAnnAutomation::SetFontItalic

LAnnAutomation::SetFontName

LAnnAutomation::SetFontSize

LAnnAutomation::SetFontStrikeThrough

LAnnAutomation::SetFontUnderline

LAnnAutomation::SetForeColor

LAnnAutomation::SetGaugeLength

LAnnAutomation::SetHyperlinkMenuEnabled

LAnnAutomation::SetLineStyle

LAnnAutomation::SetLineWidth

LAnnAutomation::SetNodes

LAnnAutomation::SetPointOptions

LAnnAutomation::SetPolyFillMode

LAnnAutomation::SetShowFlags

LAnnAutomation::SetText

LAnnAutomation::SetTextAlign

LAnnAutomation::SetTextExpandTokens

LAnnAutomation::SetTextPointerFixed

LAnnAutomation::SetTextRotate

LAnnAutomation::SetTextRTF

LAnnAutomation::SetTicMarkLength

LAnnAutomation::SetTool

LAnnAutomation::SetTransparent

LAnnAutomation::SetTransparentColor

LAnnAutomation::SetUndoDepth

LAnnAutomation::SetUnit

LAnnAutomation::Undo


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.

In addition, functionality for adding and maintaining user-defined handles has been added to the Annotation Class Library. This functionality has been implemented by adding the AddUserHandle, GetUserHandle, GetUserHandles, ChangeUserHandle, DeleteUserHandle, EnumerateHandles, and EnumHandleCallBack functions to each of the following classes:

LAnnAudioClip

LAnnButton

LAnnCrossProduct

LAnnCurve

LAnnCurveClosed

LAnnEllipse

LAnnEncrypt

LAnnFreehand

LAnnFreehandHotSpot

LAnnHilite

LAnnHotSpot

LAnnLine

LAnnNote

LAnnPolygon

LAnnPoint

LAnnPolyline

LAnnPolyRuler

LAnnProtractor

LAnnPointer

LAnnPushPin

LAnnRedact

LAnnRectangle

LAnnRTF

LAnnRuler

LAnnStamp

LAnnText

LAnnTextPointer

LAnnToolBar

LAnnVideo

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.

LAnimationWindow::GetAnimationBitsPerPixel

LAnimationWindow::GetAnimationColorOrder

LAnimationWindow::GetAnimationHeight

LAnimationWindow::GetAnimationWidth

LAnimationWindow::GetAnimationWindow

LAnimationWindow::GetBackgroundColor

LAnimationWindow::GetCount

LAnimationWindow::GetCurrentIndex

LAnimationWindow::GetDelay

LAnimationWindow::GetDisposalMethod

LAnimationWindow::GetPosition

LAnimationWindow::GetRemainingDelay

LAnnContainer::FileInfo

LAnnContainer::FileInfoMemory

LAnnContainer::FileInfoOffset

LAnnContainer::GetBackColor

LAnnContainer::GetFillMode

LAnnContainer::GetFillPattern

LAnnContainer::GetForeColor

LAnnContainer::GetGrouping

LAnnContainer::GetItem

LAnnContainer::GetLineStyle

LAnnContainer::GetLineWidth

LAnnContainer::GetObjectFromTag

LAnnContainer::GetSelectCount

LAnnContainer::GetSelectItems

LAnnContainer::GetSelectRect

LAnnContainer::HitTest

LAnnContainer::HitTestExt

LAnnotation::GetActiveState

LAnnotation::GetArea

LAnnotation::GetAutoMenuItemEnable

LAnnotation::GetAutoMenuState

LAnnotation::GetAutoSnapCursor

LAnnotation::GetBackColor

LAnnotation::GetBoundingRect

LAnnotation::GetContainer

LAnnotation::GetFillMode

LAnnotation::GetFontName

LAnnotation::GetFontNameLen

LAnnotation::GetFontSize

LAnnotation::GetForeColor

LAnnotation::GetHandle

LAnnotation::GetHyperlink

LAnnotation::GetHyperlinkLen

LAnnotation::GetNameOptions

LAnnotation::GetOffsetX

LAnnotation::GetOffsetY

LAnnotation::GetPredefinedMetafile

LAnnotation::GetRect

LAnnotation::GetRestrictToContainer

LAnnotation::GetRgnHandle

LAnnotation::GetROP2

LAnnotation::GetRotateOptions

LAnnotation::GetScalarX

LAnnotation::GetScalarY

LAnnotation::GetTag

LAnnotation::GetAutoBackColor

LAnnotation::GetTopContainer

LAnnotation::GetType

LAnnotation::GetUserData

LAnnotation::GetUserMode

LAnnotation::GetWnd

LAnnotation::IsClipboardReady

LAnnotation::IsCreated

LAnnotation::IsFontBold

LAnnotation::IsFontItalic

LAnnotation::IsFontStrikeThrough

LAnnotation::IsFontUnderline

LAnnotation::IsLocked

LAnnotation::IsSelected

LAnnotation::IsValid

LAnnotation::IsVisible

LAnnotationWindow::GetAutomationObject

LAnnotationWindow::GetContainerObject

LAnnotationWindow::GetToolBar

This next set of functions are more specialized, applying only to certain annotation objects. For more information, refer to the individual function's documentation.

LAnnAudioClip::GetFixed

LAnnAudioClip::GetRotateAngle

LAnnAudioClip::GetText

LAnnAudioClip::GetTextLen

LAnnAudioClip::GetUserHandle

LAnnAudioClip::GetUserHandles

LAnnAudioClip::IsFixedInRect

LAnnButton::GetFixed

LAnnButton::GetForeColor

LAnnButton::GetRotateAngle

LAnnButton::GetText

LAnnButton::GetTextLen

LAnnButton::GetUserHandle

LAnnButton::GetUserHandles

LAnnButton::IsFixedInRect

LAnnCrossProduct::GetDistance

LAnnCrossProduct::GetDistance2

LAnnCrossProduct::GetFixed

LAnnCrossProduct::GetLineStyle

LAnnCrossProduct::GetLineWidth

LAnnCrossProduct::GetPointCount

LAnnCrossProduct::GetPoints

LAnnCrossProduct::GetUserHandle

LAnnCrossProduct::GetUserHandle

LAnnCrossProduct::IsFixedInRect

LAnnCurve::GetFixed

LAnnCurve::GetPointCount

LAnnCurve::GetPoints

LAnnCurve::GetUserHandle

LAnnCurve::GetUserHandles

LAnnCurve::IsFixedInRect

LAnnCurveClosed::GetFixed

LAnnCurveClosed::GetPointCount

LAnnCurveClosed::GetPoints

LAnnCurveClosed::GetUserHandle

LAnnCurveClosed::GetUserHandles

LAnnCurveClosed::IsFixedInRect

LAnnEllipse::GetBackColor

LAnnEllipse::GetFillMode

LAnnEllipse::GetFillPattern

LAnnEllipse::GetFixed

LAnnEllipse::GetForeColor

LAnnEllipse::GetLineStyle

LAnnEllipse::GetLineWidth

LAnnEllipse::GetRotateAngle

LAnnEllipse::GetUserHandle

LAnnEllipse::GetUserHandles

LAnnEllipse::IsFixedInRect

LAnnEncrypt::GetEncryptOptions

LAnnEncrypt::GetLineStyle

LAnnEncrypt::GetLineWidth

LAnnEncrypt::GetMetafile

LAnnEncrypt::GetRotateAngle

LAnnEncrypt::GetSecondaryMetafile

LAnnEncrypt::GetUserHandle

LAnnEncrypt::GetUserHandles

LAnnFreehand::GetFixed

LAnnFreehand::GetForeColor

LAnnFreehand::GetLineStyle

LAnnFreehand::GetLineWidth

LAnnFreehand::GetNodes

LAnnFreehand::GetPointCount

LAnnFreehand::GetPoints

LAnnFreehand::GetUserHandle

LAnnFreehand::GetUserHandles

LAnnFreehand::IsFixedInRect

LAnnFreehandHotSpot::GetFixed

LAnnFreehandHotSpot::GetMetafile

LAnnFreehandHotSpot::GetUserHandle

LAnnFreehandHotSpot::GetUserHandles

LAnnFreehandHotSpot::IsFixedInRect

LAnnHilite::GetBackColor

LAnnHilite::GetFixed

LAnnHilite::GetRotateAngle

LAnnHilite::GetUserHandle

LAnnHilite::GetUserHandles

LAnnHilite::IsFixedInRect

LAnnHotSpot::GetFixed

LAnnHotSpot::GetMetafile

LAnnHotSpot::GetRotateAngle

LAnnHotSpot::GetUserHandle

LAnnHotSpot::GetUserHandles

LAnnHotSpot::IsFixedInRect

LAnnLine::GetFixed

LAnnLine::GetForeColor

LAnnLine::GetLineStyle

LAnnLine::GetLineWidth

LAnnLine::GetRotateAngle

LAnnLine::GetUserHandle

LAnnLine::GetUserHandles

LAnnLine::IsFixedInRect

LAnnNote::GetBackColor

LAnnNote::GetFixed

LAnnNote::GetFontName

LAnnNote::GetFontNameLen

LAnnNote::GetFontSize

LAnnNote::GetForeColor

LAnnNote::GetRotateAngle

LAnnNote::GetText

LAnnNote::GetTextAlign

LAnnNote::GetTextLen

LAnnNote::GetTextRotate

LAnnNote::GetUserHandle

LAnnNote::GetUserHandles

LAnnNote::IsFixedInRect

LAnnNote::IsFontBold

LAnnNote::IsFontItalic

LAnnNote::IsFontStrikeThrough

LAnnNote::IsFontUnderline

LAnnPoint::GetBitmap

LAnnPoint::GetFixed

LAnnPoint::GetPointOptions

LAnnPoint::GetPoints

LAnnPoint::GetPredefinedBitmap

LAnnPoint::GetTransparent

LAnnPoint::GetTransparentColor

LAnnPoint::GetUserHandle

LAnnPoint::GetUserHandles

LAnnPoint::IsFixedInRect

LAnnPointer::GetFixed

LAnnPointer::GetForeColor

LAnnPointer::GetLineStyle

LAnnPointer::GetLineWidth

LAnnPointer::GetRotateAngle

LAnnPointer::GetUserHandle

LAnnPointer::GetUserHandles

LAnnPointer::IsFixedInRect

LAnnPolygon::GetBackColor

LAnnPolygon::GetFillMode

LAnnPolygon::GetFillPattern

LAnnPolygon::GetFixed

LAnnPolygon::GetForeColor

LAnnPolygon::GetLineStyle

LAnnPolygon::GetLineWidth

LAnnPolygon::GetNodes

LAnnPolygon::GetPointCount

LAnnPolygon::GetPoints

LAnnPolygon::GetPolyFillMode

LAnnPolygon::GetUserHandle

LAnnPolygon::GetUserHandles

LAnnPolygon::IsFixedInRect

LAnnPolyline::GetFixed

LAnnPolyline::GetForeColor

LAnnPolyline::GetLineStyle

LAnnPolyline::GetLineWidth

LAnnPolyline::GetNodes

LAnnPolyline::GetPointCount

LAnnPolyline::GetPoints

LAnnPolyline::GetUserHandle

LAnnPolyline::GetUserHandles

LAnnPolyline::IsFixedInRect

LAnnPolyRuler::GetDistance

LAnnPolyRuler::GetDistance2

LAnnPolyRuler::GetFixed

LAnnPolyRuler::GetLineStyle

LAnnPolyRuler::GetLineWidth

LAnnPolyRuler::GetNodes

LAnnPolyRuler::GetPointCount

LAnnPolyRuler::GetPoints

LAnnPolyRuler::GetTicMarkLength

LAnnPolyRuler::GetUnitLen

LAnnPolyRuler::GetUserHandle

LAnnPolyRuler::GetUserHandles

LAnnPolyRuler::IsFixedInRect

LAnnProtractor::GetAngle

LAnnProtractor::GetDistance

LAnnProtractor::GetDistance2

LAnnProtractor::GetFixed

LAnnProtractor::GetPointCount

LAnnProtractor::GetPoints

LAnnProtractor::GetProtractorOptions

LAnnProtractor::GetUserHandle

LAnnProtractor::GetUserHandles

LAnnProtractor::IsFixedInRect

LAnnPushPin::GetBitmap

LAnnPushPin::GetFixed

LAnnPushPin::GetRotateAngle

LAnnPushPin::GetSecondaryBitmap

LAnnPushPin::GetUserHandle

LAnnPushPin::GetUserHandles

LAnnPushPin::IsFixedInRect

LAnnRectangle::GetBackColor

LAnnRectangle::GetFillMode

LAnnRectangle::GetFillPattern

LAnnRectangle::GetFixed

LAnnRectangle::GetForeColor

LAnnRectangle::GetLineStyle

LAnnRectangle::GetLineWidth

LAnnRectangle::GetRotateAngle

LAnnRectangle::GetUserHandle

LAnnRectangle::GetUserHandles

LAnnRectangle::IsFixedInRect

LAnnRTF::GetFixed

LAnnRTF::GetText

LAnnRTF::GetTextLen

LAnnRTF::GetTextRTF

LAnnRTF::GetUserHandle

LAnnRTF::GetUserHandles

LAnnRTF::IsFixedInRect

LAnnRedact::GetBackColor

LAnnRedact::GetRotateAngle

LAnnRedact::GetUserHandle

LAnnRedact::GetUserHandles

LAnnRuler::GetDistance

LAnnRuler::GetDistance2

LAnnRuler::GetFixed

LAnnRuler::GetFontName

LAnnRuler::GetFontNameLen

LAnnRuler::GetFontSize

LAnnRuler::GetForeColor

LAnnRuler::GetGaugeLength

LAnnRuler::GetLineStyle

LAnnRuler::GetLineWidth

LAnnRuler::GetPoints

LAnnRuler::GetRotateAngle

LAnnRuler::GetShowFlags

LAnnRuler::GetText

LAnnRuler::GetTextLen

LAnnRuler::GetTicMarkLength

LAnnRuler::GetUnit

LAnnRuler::GetUnitLen

LAnnRuler::GetUserHandle

LAnnRuler::GetUserHandles

LAnnRuler::IsFixedInRect

LAnnRuler::IsFontBold

LAnnRuler::IsFontItalic

LAnnRuler::IsFontStrikeThrough

LAnnRuler::IsFontUnderline

LAnnStamp::GetBackColor

LAnnStamp::GetBitmap

LAnnStamp::GetFillMode

LAnnStamp::GetFillPattern

LAnnStamp::GetFixed

LAnnStamp::GetFontName

LAnnStamp::GetFontNameLen

LAnnStamp::GetFontSize

LAnnStamp::GetForeColor

LAnnStamp::GetLineStyle

LAnnStamp::GetLineWidth

LAnnStamp::GetMetafile

LAnnStamp::GetRotateAngle

LAnnStamp::GetSecondaryMetafile

LAnnStamp::GetText

LAnnStamp::GetTextLen

LAnnStamp::GetTransparent

LAnnStamp::GetTransparentColor

LAnnStamp::GetUserHandle

LAnnStamp::GetUserHandles

LAnnStamp::IsFixedInRect

LAnnStamp::IsFontBold

LAnnStamp::IsFontItalic

LAnnStamp::IsFontStrikeThrough

LAnnStamp::IsFontUnderline

LAnnText::GetBackColor

LAnnText::GetFillMode

LAnnText::GetFixed

LAnnText::GetFontName

LAnnText::GetFontNameLen

LAnnText::GetFontSize

LAnnText::GetForeColor

LAnnText::GetRotateAngle

LAnnText::GetText

LAnnText::GetTextLen

LAnnText::GetUserHandle

LAnnText::GetUserHandles

LAnnText::IsFixedInRect

LAnnText::IsFontBold

LAnnText::IsFontItalic

LAnnText::IsFontStrikeThrough

LAnnText::IsFontUnderline

LAnnTextPointer::GetFixed

LAnnTextPointer::GetRotateAngle

LAnnTextPointer::GetTextAlign

LAnnTextPointer::GetTextPointerFixed

LAnnTextPointer::GetTextRotate

LAnnTextPointer::GetUserHandle

LAnnTextPointer::GetUserHandles

LAnnTextPointer::IsFixedInRect

LAnnToolBar::GetToolBarButtons

LAnnToolBar::GetToolBarInfo

LAnnToolBar::GetToolChecked

LAnnToolBar::GetUserHandle

LAnnToolBar::GetUserHandles

LAnnToolBar::GetWndHandle

LAnnToolBar::IsButtonVisible

LAnnToolBar::IsCreated

LAnnVideo::GetFixed

LAnnVideo::GetRotateAngle

LAnnVideo::GetText

LAnnVideo::GetTextLen

LAnnVideo::GetUserHandle

LAnnVideo::GetUserHandles

LAnnVideo::IsFixedInRect

This final set of functions apply only to automation annotation objects.

LAnnAutomation::GetAutoContainer

LAnnAutomation::GetAutoCursor

LAnnAutomation::GetAutoOptions

LAnnAutomation::GetAutoText

LAnnAutomation::GetAutoTextLen

LAnnAutomation::GetAutoUndoEnable

LAnnAutomation::GetBackColor

LAnnAutomation::GetBitmapDpiX

LAnnAutomation::GetBitmapDpiY

LAnnAutomation::GetDistance

LAnnAutomation::GetDpiX

LAnnAutomation::GetDpiY

LAnnAutomation::GetEncryptOptions

LAnnAutomation::GetFillMode

LAnnAutomation::GetFillPattern

LAnnAutomation::GetFixed

LAnnAutomation::GetFontName

LAnnAutomation::GetFontNameLen

LAnnAutomation::GetFontSize

LAnnAutomation::GetForeColor

LAnnAutomation::GetGaugeLength

LAnnAutomation::GetLineStyle

LAnnAutomation::GetLineWidth

LAnnAutomation::GetNodes

LAnnAutomation::GetPointOptions

LAnnAutomation::GetPolyFillMode

LAnnAutomation::GetShowFlags

LAnnAutomation::GetText

LAnnAutomation::GetTextAlign

LAnnAutomation::GetTextExpandTokens

LAnnAutomation::GetTextLen

LAnnAutomation::GetTextPointerFixed

LAnnAutomation::GetTextRotate

LAnnAutomation::GetTextRTF

LAnnAutomation::GetTicMarkLength

LAnnAutomation::GetTool

LAnnAutomation::GetTransparentColor

LAnnAutomation::GetUndoDepth

LAnnAutomation::GetUnit

LAnnAutomation::GetUnitLen

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::IsAutoDrawEnabled

LAnnAutomation::IsAutoMenuEnabled

LAnnAutomation::IsFixedInRect

LAnnAutomation::IsFontBold

LAnnAutomation::IsFontItalic

LAnnAutomation::IsFontStrikeThrough


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 LAnnotation::SetOptions 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

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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

nRet = annAutomation.SetOptions( 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:

{bmc XPtoolbar.bmp]

For more information on toolbars, see the documentation for ANNBUTTON and the functions
 LAnnToolBar::FreeToolBarButtons,
 LAnnToolBar::GetToolBarButtons,
 LAnnToolBar::SetToolBarButtons

The new XP-style annotation toolbar can be enabled using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

nRet = annAutomation.SetOptions( 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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 LAnnotation::GetFillModeExt and LAnnotation::SetFillModeExt.

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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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 LAnnAutomation::SetAutoCursor and LAnnAutomation::GetAutoCursor functions.

The new annotation cursors can be enabled using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

   nRet = annAutomation.SetOptions(
 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:

LAnnRuler

LAnnPolyRuler

LAnnCrossProduct

LAnnProtractor

Any of these objects can be calibrated. To calibrate a ruler:

1. | Load desired image
2. | Draw an LAnnRuler 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 LAnnRuler 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

nRet = annAutomation.SetOptions( uOptions | OPTIONS_NEW_ CALIBRATE_RULER);

}

For more information on calibrating rulers, see the documentation for LAnnotation::CalibrateRuler, 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

nRet = annAutomation.SetOptions( 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:

It 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 LAnnotation::SetOptions.
 To use this feature, simply pass the flag ANNFMT_XML to the annotation
 save functions. For more information, see the documentation for LAnnContainer::Save,
 LAnnContainer::SaveOffset,
 LAnnContainer::SaveMemory,
 LAnnContainer::Load,
 LAnnContainer::LoadOffset,
 LAnnContainer::LoadMemory.

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.

LAnnText

LAnnTextPointer

LAnnStamp

LAnnNote

LAnnPushPin

For the following text based annotations, you can now optionally show or hide the border.

LAnnText

LAnnStamp

These properties can also be set for the following annotation objects for purposes of recursion:

LAnnContainer

LAnnAutomation

LAnnButton

To see these new features:

1. | Draw an LAnnText 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(LAnnAutomation& annAutomation)

{

L_UINT nRet, uOptions = 0;

nRet = annAutomation.GetOptions( &uOptions);

nRet = annAutomation.SetOptions( uOptions | OPTIONS_NEW_ TEXT_OPTIONS);

}

For more information, see the documentation for the LAnnotation::SetTextOptions, and LAnnotation::GetTextOptions functions.


Calibrating Annotation Ruler Objects

Calibrating a ruler means assigning a specific length to it. For example, on a digital X-ray of a hand, you may draw an annotation ruler object along one of the fingers. You know that this distance is supposed to be exactly 6.5 cm. Using the new 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 LAnnotation::CalibrateRuler to calibrate ruler objects.

In automated mode, calibration is accomplished as follows:

1. | Draw an LAnnRuler 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 have.
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, select the corresponding check box. If you select this option, all rulers, polyrulers, cross-products and protractors will adopt the new calibrated values.
9 | If you want the calibration to apply to all existing rulers, select the corresponding check box. 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 effect until you click the Apply button on the parent dialog.

Note that with Version 14.5, this function must be enabled by passing OPTIONS_NEW_ CALIBRATE_RULER to the LAnnotation::SetOptions function before calling LAnnotation::CalibrateRuler. For more information, refer to New Annotation Features of Version 14.5.

For information about using rulers in Automation, Crossproduct, Polyruler, Protractor, and Ruler objects, refer to Using Rulers in Annotation Objects.


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.

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 (transparent, translucent, or opaque) and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

Change the 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 Closed 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 (transparent, translucent, or opaque) 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.

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.


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 the LAnnContainer::EncryptApply function 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 LAnnEncrypt::SetMetafile function. The default image is shown in the figure below:

The decryptor metafile is changed with the Secondary Metafile option (in automation) or the LAnnEncrypt::SetMetafile 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 LAnnContainer::EncryptApply 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 LAnnContainer::EncryptApply 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 Encrypt 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.

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.


Ellipse Tool

Note:

This topic is for Document/Medical only.

The ellipse annotation object is a simple ellipse. In design mode, click and drag to specify the ellipse in the current window. Holding down the Shift key while drawing the ellipse will make the ellipse annotation circular.

In design mode, click on the object with the right mouse button to do the following:

Undo the last user action.

Cut or copy the object to the clipboard.

Delete the object.

Select all objects.

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the fill mode (transparent, translucent, or opaque) 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.


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.

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:

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

Bring the object to the front or send it to the back.

Lock and unlock annotation objects. See Password Dialog Box for Annotations.

Change the default Name properties. See Name Dialog Box for Annotations.

Change the line width and style properties. See Line Dialog Box for Annotations.

Change the binary raster operation (ROP2) code. See ROP2 Dialog Box for Annotations.

Change the foreground color. See Color Dialog Box for Annotations.

Change the fixed properties. See Fixed Dialog Box for Annotations.

Set and manage hyperlink properties for an object or group of objects. Note: The actual management of 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. This can be achieved programmatically by calling the LAnnotation::TextEdit function.

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.

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 (transparent, translucent, or opaque) and the fill pattern. See Fill Dialog Box for Annotations.

Change the polygonal fill mode, which controls which areas are filled when lines cross. See Fill Dialog Box for Annotations.

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

(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 fixed properties. See Fixed Dialog Box for Annotations.

Change the node properties. See Nodes 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 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 (transparent, translucent, or opaque) 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 (transparent, translucent, or opaque) 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 the LAnnPushPin::SetBitmap and the LAnnPushPin::GetBitmap) functions when the text is shown, and a secondary bitmap, manipulated using the LAnnPushPin::SetSecondaryBitmap and the LAnnPushPin::GetSecondaryBitmap functions. 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. This can be achieved programmatically by calling the LAnnotation::TextEdit function. 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.

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 (transparent, translucent, or opaque) 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.

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


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 (transparent, translucent, or opaque) 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.


Rich Text Tool

Note: This topic is for Document/Medical only.

The Rich Text annotation object is a rectangle containing containing text that supports Rich Text Format (RTF).

In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the text annotation square. A dialog box then lets the user enter the text. A menu also appears to allow further formatting of text. Formatting support includes:

Font

Font size

Bold

Italic

Underline

Foreground Color

Background Color

Bullets

Numbering

Indenting

Alignment

As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double-click on a text object to edit the text. This can be achieved programmatically by calling the LAnnotation::TextEdit function.

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.


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 (transparent, translucent, or opaque) 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 Tool

Note:

This topic is for Document/Medical only.

The text annotation object is a rectangle containing a character string with font properties. The text will wrap on word breaks within the object's specified rectangle. In design mode, click and drag to specify the rectangle in the current window. Holding down the Shift key while drawing the rectangle will make the text annotation square. A dialog box then lets the user enter the text.

As soon as the Text object is created, the text will be highlighted. The text may be edited immediately. While in design mode double-click on a text object to edit the text. This can be achieved programmatically by calling the LAnnotation::TextEdit function.

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.


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 the LAnnotation::TextEdit function.

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.


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:

ClassObject | Annotation Object | Constant
LAnnContainer | [0] Container Annotation Object | ANNOBJECT_CONTAINER
LAnnText | [15] Text Annotation Object | ANNOBJECT_TEXT
LAnnNote | [9] Note Annotation Object | ANNOBJECT_NOTE
LAnnLine | [8] Line Annotation Object | ANNOBJECT_LINE
LAnnPolyline | [11] Polyline Annotation Object | ANNOBJECT_POLYLINE
LAnnFreehand | [5] Freehand Line Annotation Object | ANNOBJECT_FREEHAND
LAnnRectangle | [12] Rectangle Annotation Object | ANNOBJECT_RECT
LAnnEllipse | [4] Ellipse Annotation Object | ANNOBJECT_ELLIPSE
LAnnPolygon | [10] Polygon Annotation Object | ANNOBJECT_POLYGON
LAnnPointer | [1] Pointer Annotation Object | ANNOBJECT_POINTER
LAnnButton | [3] Button Annotation Object | ANNOBJECT_BUTTON
LAnnStamp | [14] Stamp Annotation Object | ANNOBJECT_STAMP
LAnnHilite | [6] Highlight Annotation Object | ANNOBJECT_HILITE
LAnnRedact | [13] Redaction Annotation Object | ANNOBJECT_REDACT
LAnnAudioClip | [2] Audio Clip Annotation Object | ANNOBJECT_AUDIO
LAnnHotSpot | [7] Hot Spot Annotation Object | ANNOBJECT_HOTSPOT
LAnnAutomation | [16] Annotation Automation Object | ANNOBJECT_AUTOMATION
LAnnRuler | [17] Ruler Annotation Object | ANNOBJECT_RULER
LAnnCurve | [24] Curve Annotation Object | ANNOBJECT_CURVE
LAnnCurveClosed | [25] Closed Curve Annotation Object | ANNOBJECT_CURVECLOSED
LAnnEncrypt | [26] Encrypt Annotation Object | ANNOBJECT_ENCRYPT
LAnnTextPointer | [27] Text Pointer Annotation Object | ANNOBJECT_TEXTPOINTER
LAnnPolyruler | [28] Polyruler Annotation Object | ANNOBJECT_POLYRULER
LAnnRTF | [29] Rich Text Annotation Object | ANNOBJECT_RTF


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 LAnnAutomation::SetAutoContainer function.

The class for Automation Annotation objects is LAnnAutomation.

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 LAnnAutomation::SetTool function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnAutomation::SetLineWidth 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 LAnnAutomation::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the LAnnAutomation::SetTransparent function.
Transparent Color | Defaults to White. It can be changed using the LAnnAutomation::SetTransparent function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the LAnnAutomation::SetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnAutomation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnAutomation::SetBackColor function. The default does not affect highlight, redaction, or note objects.
Note Background Color | Defaults to yellow. It can be changed using the LAnnNote::SetBackColor function.
Redact Background Color | Defaults to black. It can be changed using the LAnnRedact::SetBackColor function.
Hilite Background Color | Defaults to yellow. It can be changed using the LAnnHilite::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnAutomation::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnAutomation::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnAutomation::SetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnAutomation::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnAutomation::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnAutomation::SetFontName 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 LAnnXXX::SetMetafile function.
Encrypt Metafile | Defaults to an image of a black skeleton key. It can be changed using the LAnnEncrypt::SetMetafile function.
Decrypt Metafile | Defaults to an image of a red skeleton key. It can be changed using the LAnnEncrypt::SetMetafile 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 LAnnRuler::SetShowFlags function, the LAnnRuler::SetGaugeLength function, the LAnnRuler::SetTicMarkLength, and the LAnnRuler::SetUnit function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes 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 LAnnProtractor::SetProtractorOptions and the LAnnAutomation::SetShowFlags function.
Point | Defaults to using a bitmap and not using transparent color. These options can be changed using the LAnnPoint::SetTransparent function, LAnnPoint::SetTransparentColor function, the LAnnPoint::SetPredefinedBitmap function, and the LAnnPoint::SetBitmap function.
Encrypt | Defaults to Encryptor. Set encryption options using the LAnnEncrypt::SetEncryptOptions function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Menus enabled | Defaults to TRUE. It can be changed using the LAnnAutomation::SetAutoMenuEnabled function.
Automation text strings | Default to hard-coded strings for menus and dialog boxes. Strings can be changed using the LAnnAutomation::SetAutoText function.
Highlight Pen Color | Defaults to white. It can be changed using the LAnnAutomation::SetAutoHilightPen function.

Additional automation properties can be set with the following functions. For details, see the corresponding documentation.

LAnnAutomation::SetAutoContainer

LAnnAutomation::SetAutoCursor

LAnnAutomation::SetAutoDialogFontSize

LAnnAutomation::SetAutoDrawEnabled

LAnnAutomation::SetAutoMenuEnabled

LAnnAutomation::SetAutoOptions

LAnnAutomation::SetAutoText

LAnnAutomation::SetAutoUndoEnable

LAnnAutomation::SetBitmapDpiX

LAnnAutomation::SetBitmapDpiY

LAnnAutomation::SetDpiX

LAnnAutomation::SetDpiY

LAnnAutomation::SetEncryptOptions

LAnnAutomation::SetFillPattern

LAnnAutomation::SetFixed

LAnnAutomation::SetGaugeLength

LAnnotation::SetHyperlink

LAnnAutomation::SetHyperlinkMenuEnabled

LAnnAutomation::SetLineStyle

LAnnAutomation::SetLineWidth

LAnnAutomation::SetNodes

LAnnAutomation::SetPointOptions

LAnnAutomation::SetPolyFillMode

LAnnAutomation::SetShowFlags

LAnnAutomation::SetTextAlign

LAnnAutomation::SetTextExpandTokens

LAnnAutomation::SetTextPointerFixed

LAnnAutomation::SetTextRotate

LAnnAutomation::SetTextRTF

LAnnAutomation::SetTicMarkLength

LAnnAutomation::SetTool

LAnnAutomation::SetTransparentColor

LAnnAutomation::SetUndoDepth

LAnnAutomation::SetUnit

LAnnContainer::SetGrouping

LAnnPushPin::SetSecondaryBitmap

LAnnContainer::SetUserMode

LAnnContainer::SetWnd

LAnnotation::SetActiveState

LAnnotation::SetAutoBackColor

LAnnotation::SetAutoDefaults

LAnnotation::SetAutoMenuItemEnable

LAnnotation::SetAutoMenuState

LAnnotation::SetBackColor

LAnnotation::SetFillMode

LAnnotation::SetFontBold

LAnnotation::SetFontItalic

LAnnotation::SetFontName

LAnnotation::SetFontSize

LAnnotation::SetFontStrikethrough

LAnnotation::SetFontUnderline

LAnnotation::SetForeColor

LAnnotation::SetNameOptions

LAnnotation::SetOffsetX

LAnnotation::SetOffsetY

LAnnotation::SetPredefinedMetafile

LAnnotation::SetRect

LAnnotation::SetRestrictToContainer

LAnnotation::SetROP2

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnotation::Rotate

LAnnotation::SetUser

LAnnotation::SetUserData

LAnnotation::SetVisible

LAnnPoint::SetPoints

LAnnPoint::SetPredefinedBitmap

LAnnProtractor::SetProtractorOptions

LAnnStamp::SetMetafile

LAnnToolBar::SetButtonVisible

LAnnToolBar::SetToolChecked

LAnnStamp::SetTransparent

LAnnotation::GetOptions

LAnnotation::SetOptions

LAnnotation::GetFillModeExt

LAnnotation::SetFillModeExt

LAnnotation::CalibrateRuler

LAnnotation::SetTextOptions

LAnnotation::GetTextOptions

LAnnotation::GetRotateOptions

LAnnotation::SetRotateOptions

LAnnotation::GetAutoSnapCursor

LAnnotation::SetAutoSnapCursor

Use the LAnnotation::SetOptions function and the LAnnotation::GetOptions 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 Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function.

Use the LAnnotation::SetFillMode and LAnnotation::GetFillMode functions to manage the fill mode used by annotation objects. The LAnnotation::SetFillModeExt and the LAnnotation::GetFillModeExt 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 LAnnotation::SetOptions function.

Related topics:

Implementing Annotations

Types of Annotations

Low-Level Coordinate System for Annotations.

Annotation Functions: Creating Custom Annotations

Fixed Annotations

Using Annotation Bitmap Objects

Using Rulers in Annotation 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.

The class for Audio Clip Annotation objects is LAnnAudioClip.

When you save this type of annotation, the WAV file is not saved. Only its path, specified in the text property, is saved.

You cannot flip, reverse, or rotate an audio clip. If you flip, reverse, or rotate a container that includes an audio clip, the object will move to the new position, but will retain its orientation.

With low-level functions, you must specify the defining rectangle. Other applicable properties have the following defaults, which you can change:

Active state | Defaults to disabled. It can be changed using LAnnotation::SetActiveState.
Visible | Defaults to FALSE. It can be changed using LAnnotation::SetVisible.
Selected | Defaults to FALSE. It can be changed using LAnnotation::SetSelected.
Text | Defaults to an empty string. It can be changed to the path of the WAV file using LAnnAudioClip::SetText.
Tag (identifier) | Defaults to 0. It can be changed using LAnnotation::SetTag.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.
Fixed State | Defaults to not fixed. It can be changed using LAnnXXX::SetFixed.
Name | Defaults to empty string. It can be changed using LAnnotation::SetNameOptions.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Button Annotation objects is LAnnButton.

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 LAnnotation::SetActiveState function.
Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Fill mode | Defaults to transparent. It can be changed using the LAnnAutomation::SetFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnButton::SetForeColorfunction.
Background color | Defaults to white. It can be changed using the LAnnAutomation::SetBackColor 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 LAnnotation::SetFontSize function, the LAnnotation::SetFontUnderline function, the LAnnotation::SetFontStrikethrough function, the LAnnotation::SetFontItalic function, the LAnnotation::SetFontBold function, and the LAnnotation::SetFontName function.
Button Font | Defaults to a regular MS Sans Serif red font at 10 points.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnButton::SetText function.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the LAnnAutomation::SetTextExpandTokens function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Container Annotation objects is LAnnContainer.

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 LAnnotation::SetVisible.
Selected | Defaults to FALSE. It can be changed using LAnnotation::SetSelected.
Foreground color | Defaults to black. It can be changed using LAnnContainer::SetForeColor.
Background color | Defaults to white. It can be changed using LAnnContainer::SetBackColor.
Line width | Defaults to 1. It can be changed using LAnnContainer::SetLineWidth. (Values equate to a minimum of 1 pixel when displayed.)
Line style | Defaults to NULL. It can be changed using LAnnContainer::SetLineStyle.
Fill pattern | Defaults to solid. It can be changed using LAnnContainer::SetFillPattern.
Fill mode | Defaults to transparent. It can be changed using LAnnContainer::SetFillMode.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Tag (identifier) | Defaults to 0. It can be changed using LAnnotation::SetTag.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.
Fixed State | Defaults to not fixed. It can be changed using LAnnXXX::SetFixed.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Use the LAnnotation::SetOptions function and the LAnnotation::GetOptions 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 Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function.

Use the LAnnotation::SetFillMode and LAnnotation::GetFillMode functions to manage the fill mode used by annotation objects. The LAnnotation::SetFillModeExt and the LAnnotation::GetFillModeExt 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 LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


Crossproduct Annotation Object

Note:

This topic is for Document/Medical only.

The CrossProduct annotation object (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.

The class for CrossProduct Annotation objects is LAnnCrossProduct.

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 points by calling the LAnnRuler::SetPoints function. The points are ordered as follows:

Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnRuler::SetLineWidth 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 LAnnRuler::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnotation::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnotation::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnotation::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnotation::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnotation::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnotation::SetFontName function.
Ruler show flags | Defaults to Show Length and Show Tic Marks. These options can be changed using the LAnnRuler::SetShowFlags function and the LAnnRuler::SetTicMarkLength function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects


Closed Curve Annotation Object

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.

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 LAnnCurveClosed::GetPoints and LAnnCurveClosed::SetPoints.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnAutomation::SetLineWidth 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 LAnnContainer::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the LAnnAutomation::SetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


Curve Annotation Object

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.

With the automated functions, each curve is formed with a mouse click, and the object is completed on a double click.

The class for Polygon Annotation objects is LAnnCurve.

You can change the points using LAnnCurve::GetPoints and LAnnCurve::SetPoints.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnAutomation::SetLineWidth 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 LAnnAutomation::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

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.

The class for Ellipse Annotation objects is LAnnEllipse.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnXXX::SetBackColor function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


Encrypt Annotation Object

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.

You must call the LAnnContainer::EncryptApply 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 LAnnContainer::EncryptApply 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 decryptor 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 LBitmap::Scramble 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 LBitmap::Scramble function can be used directly on a bitmap, and does not depend on annotations in any way.

Use the LAnnEncrypt::GetEncryptOptions function to get the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the LAnnEncrypt::SetEncryptOptions function to set the encrypt options of an Encrypt or a Decrypt object. These options are in an ANNENCRYPTOPTIONS structure.

Use the LAnnEncrypt::GetSecondaryMetafile function to retrieve the current metafile for an Encrypt object in a ‘decryptor’ state.

Use the LAnnEncrypt::GetMetafile function to retrieve the current metafile for an Encrypt object in an ‘encryptor’ state.

Use the LAnnEncrypt::SetMetafile 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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Metafile | Defaults to a black skeleton key. It can be changed using the LAnnEncrypt::SetMetafile function.
Secondary Metafile | Defaults to a red skeleton key. It can be changed using the LAnnEncrypt::SetMetafile function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

LAnnEncrypt::GetEncryptOptions

LAnnEncrypt::SetEncryptOptions

LAnnContainer::EncryptApply

LBitmap::Scramble

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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.

The class for Freehand Hot Spot Annotation objects is LAnnFreehandHotSpot.

You can change the points of a freehand object using LAnnFreehand::GetPoints and LAnnFreehand::AnnSetPoints.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Hotspot Metafile | Defaults to a campfire graphic. It can be changed using the LAnnXXX::SetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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.

The class for Freehand Line Annotation objects is LAnnFreehand.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Foreground color | Defaults to red. It can be changed using the LAnnXXX::SetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Highlight Annotation objects is LAnnHilite.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Background color | Defaults to Yellow – RGB (255, 255, 0) It can be changed using the LAnnHilite::SetBackColor function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Hot Spot Annotation objects is LAnnHotSpot.

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 LAnnotation::SetActiveState function.
Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Metafile | Defaults to a campfire graphic. It can be changed using the LAnnHotSpot::SetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Line Annotation objects is LAnnLine.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnLine::SetLineWidth 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 LAnnLine::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Foreground color | Defaults to red. It can be changed using the LAnnLine::SetForeColor function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Note Annotation objects is LAnnNote.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnNote::SetForeColor function.
Background color | Defaults to yellow - RGB(255, 555, 0). It can be changed using the LAnnotation::SetBackColor.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnNote::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnNote::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnNote::SetFontStrikeThrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnNote::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnNote::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnNote::SetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnNote::SetText function.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Text Alignment. | Defaults to left alignment. It can be changed using the LAnnNote::SetTextAlign function.
Text Rotate | Defaults to no rotation. It can be changed using the LAnnotation::Rotate function.
Expand Tokens | Defaults to expand tokens. It can be changed using the LAnnAutomation::SetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


Point Annotation Object

Note:

This topic is for Document/Medical only.

The Point annotation object (ANNOBJECT_POINT) is single point. With the automated functions, in design mode, each point is formed with a mouse click event.

The class for Point Annotation objects is LAnnPoint.

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 LAnnPoint::SetPoints. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Transparent option | Defaults to Use Transparent Color. It can be changed using the LAnnPoint::SetTransparent function.
Transparent Color | Defaults to White. It can be changed using the LAnnPoint::SetTransparentColor function.
Bitmap | Defaults to NULL. It can be changed using the LAnnXXX::SetBitmap function.
Point | Defaults to a bitmap of a cross inside a circle. It can be changed using the LAnnPoint::SetPredefinedBitmap function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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.

The class for Pointer Annotation objects is LAnnPointer.

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 of the object. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Foreground color | Defaults to red. It can be changed using the LAnnXXX::SetForeColor function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Polygon Annotation objects is LAnnPolygon.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Polygon fill mode | Defaults to winding. It can be changed using the LAnnPolygon::SetPolyFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnXXX::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnXXX::SetBackColor function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


Polyline Annotation Object

Note:

This topic is for Document/Medical only.

The Polyline annotation object (ANNOBJECT_POLYLINE) is an array of points that create a sequence of joined lines. With the automated functions, each line segment is formed with a mouse click, and the object is completed on a double click.

The class for Polyline Annotation objects is LAnnPolyline.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Foreground color | Defaults to red. It can be changed using the LAnnXXX::SetForeColor function.
Nodes | Defaults to displaying every node. It can be changed using the LAnnXXX::SetNodes function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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 class for Polyruler Annotation objects is LAnnPolyRuler.

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 LAnnPolyRuler::GetPointCount and the LAnnPolyRuler::SetPoints 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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor 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 LAnnotation::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnotation::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnotation::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnotation::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnotation::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnotation::SetFontName function.
Ruler show flags | Defaults to Show Length and Show Tic Marks. These options can be changed using the LAnnRuler::SetShowFlags function and the LAnnPolyRuler::SetTicMarkLength function.
Gauge length | Defaults to 30. It can be changed using the LAnnRuler::SetGaugeLength function.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the LAnnRuler::SetUnit function.
Unit abbreviation | Varies depending on the length shown. It can be changed using the LAnnRuler::SetUnit function.
Precision | Defaults to 2. It can be changed using the LAnnRuler::SetUnit function.
Tic Marks | Defaults to Show Tic Marks. It can be changed using the LAnnRuler::SetShowFlags function.
Tic Mark Length | Defaults to 30. Can be changed using the LAnnPolyRuler::SetTicMarkLength function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects


Protractor Annotation Object

Note:

This topic is for Document/Medical only.

The protractor annotation object (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.

The class for Protractor Annotation objects is LAnnProtractor.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnRuler::SetLineWidth 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 LAnnRuler::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor function.
Ruler show flags | Defaults to not Show Length and not Show Tic Marks. These options can be changed using the LAnnRuler::SetShowFlags function and the LAnnRuler::SetTicMarkLength 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 LAnnProtractor::SetProtractorOptions function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features

Using Rulers in Annotation Objects


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.

The class for PushPin Annotation objects is LAnnPushPin.

A PushPin object has a primary bitmap, (manipulated using the LAnnPushPin::SetBitmap and the LAnnPushPin::GetBitmap functions) when the text is shown, and a secondary bitmap, changed using the LAnnPushPin::SetSecondaryBitmap functions. 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 can respond to activation events (this ability can be manipulated using the LAnnotation::SetActiveState and the LAnnotation::GetActiveState 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.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to yellow. It can be changed using the LAnnotation::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnotation::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnotation::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnotation::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnotation::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnotation::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnotation::SetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnNote::SetText.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Bitmap | Defaults to NULL. It can be changed using the LAnnXXX::SetBitmap function.
SecondaryBitmap | Defaults to a PushPin bitmap. It can be changed using the LAnnPushPin::SetSecondaryBitmap function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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.

The class for Rectangle Annotation objects is LAnnRectangle.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnXXX::SetBackColor function. The default does not affect highlight, redaction, or note objects.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Redaction Annotation objects is LAnnRedact.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Background color | Defaults to black. It can be changed using the LAnnXXX::SetBackColor function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Rich Text Annotation objects is LAnnRTF.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnXXX::SetForeColor function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnRTF::SetTextRTF function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

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 LAnnAutomation::SetTool function. The Rubber Stamp tools use the ANNTOOL_STAMP_XXX values.

Related topics:

Using Annotation Bitmap Objects.


Ruler Annotation Object

Note:

This topic is for Document/Medical only.

The ruler annotation object (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.

The class for Ruler Annotation objects is LAnnRuler.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillMode function.
Foreground color | Defaults to red. It can be changed using the LAnnRuler::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnXXX::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnXXX::SetFontName function.
Ruler | Defaults to Show Length and Show Tic Marks. These options can be changed using the LAnnRuler::SetShowFlags function and the LAnnRuler::SetTicMarkLength function.
Gauge length | Defaults to 30. It can be changed using the LAnnRuler::SetGaugeLength function.
Unit | Defaults to ANNUNIT_SMART_ENGLISH. It can be changed using the LAnnRuler::SetUnit function.
Unit abbreviation | Varies depending on the length shown. It can be changed using the LAnnRuler::SetUnit function.
Precision | Defaults to 2. It can be changed using the LAnnRuler::SetUnit function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Using Rulers in Annotation Objects


Stamp Annotation Object

Note:

This topic is for Document/Medical only.

The Stamp annotation object (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.

The class for Stamp Annotation objects is LAnnStamp.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnXXX::SetLineWidth 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 LAnnXXX::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Transparent option | Defaults To Do Not Use Transparent Color. It can be changed using the LAnnStamp::SetTransparent function.
Transparent Color | Defaults to White. It can be changed using the LAnnStamp::SetTransparentColor function.
Fill pattern | Defaults to solid. It can be changed using the LAnnAutomation::SetFillPattern function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnXXX::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnXXX::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnXXX::SetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnStamp::SetText function.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using LAnnotation::SetTextOptions.
Expand Tokens | Defaults to expand tokens. It can be changed using the LAnnAutomation::SetTextExpandTokens function.
Bitmap | Defaults to Empty. It can be changed using the LAnnStamp::SetBitmap function.
Metafile | Defaults to Empty. It can be changed using the LAnnStamp::SetMetafile function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

The class for Text Annotation objects is LAnnText.

You cannot flip or reverse a text object. If you flip or reverse a container that includes a text object, the text will move to the new position, but will retain its orientation.

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 LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnXXX::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnXXX::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnXXX::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnXXX::SetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnText::SetText function.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Text Border* | Defaults to show the Border. It can be changed using LAnnotation::SetTextOptions.
Text Alignment. | Defaults to left alignment. It can be changed using the LAnnText::SetTextAlign function.
Expand Tokens | Defaults to expand tokens. It can be changed using the LAnnAutomation::SetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using LAnnXXX::SetFixed function.
Hyperlink | Defaults to ANNLINK_NONE. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container.
User mode | Defaults to design mode or the mode inherited from the container.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.


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.

You can flip or reverse a text pointer object, but you cannot rotate it. If you flip or reverse the text pointer object, the text orientation does not change. To change the text orientation, see Text Dialog Box for Annotations.

To change the text orientation of a Text Pointer object, see Text Dialog Box for Annotations.

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 LAnnPoint::SetPoints for more details. Other applicable properties have the following defaults, which you can change:

Visible | Defaults to FALSE. It can be changed using the LAnnotation::SetVisible function.
Selected | Defaults to FALSE. It can be changed using the LAnnotation::SetSelected function.
Name | Defaults to an empty string. It can be changed using the LAnnotation::SetNameOptions function.
Line width | Defaults to 0.75 points. It can be changed using the LAnnAutomation::SetLineWidth 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 LAnnAutomation::SetLineStyle function.
ROP2 code | Defaults to ANNROP2_COPY. It can be changed using the LAnnotation::SetROP2 function.
Fill mode | Defaults to transparent. It can be changed using the LAnnotation::SetFillModeExt function. For version 14.5, before calling this function enable the alpha background fill mode by calling the LAnnotation::SetOptions function.
Foreground color | Defaults to red. It can be changed using the LAnnotation::SetForeColor function.
Background color | Defaults to white. It can be changed using the LAnnotation::SetBackColor function.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using the LAnnotation::SetFontSize function.
Font underline | Defaults to FALSE. It can be changed using the LAnnotation::SetFontUnderline function.
Font strikethrough | Defaults to FALSE. It can be changed using the LAnnotation::SetFontStrikethrough function.
Font italic | Defaults to FALSE. It can be changed using the LAnnotation::SetFontItalic function.
Font bold | Defaults to FALSE. It can be changed using the LAnnotation::SetFontBold function.
Font name | Defaults to "Arial". It can be changed using the LAnnotation::SetFontName function.
Text | Defaults to "AaBbYyZz". It can be changed using the LAnnAutomation::SetText function.
Text Displayed* | Defaults to Show text. It can be changed using LAnnotation::SetTextOptions.
Text Color* | Defaults to red (RGB(255,0,0). It can be changed using LAnnotation::SetTextOptions.
Text Alignment | Defaults to left alignment. It can be changed using the LAnnTextPointer::SetTextAlign function.
Text Rotate | Defaults to no rotation. It can be changed using the LAnnTextPointer::SetTextRotate function.
Text Pointer | The pointer part of the text pointer does not move when the object moves. It can be changed using the LAnnTextPointer::SetTextPointerFixed function.
Expand Tokens | Defaults to expand tokens. It can be changed using the LAnnAutomation::SetTextExpandTokens function.
Fixed State | Defaults to not fixed. It can be changed using the LAnnTextPointer::SetFixed function.
Hyperlink | Defaults to None. It can be changed using the LAnnotation::SetHyperlink function.
Tag (identifier) | Defaults to 0. It can be changed using the LAnnotation::SetTag function.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using the LAnnContainer::SetWnd function.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using the LAnnContainer::SetUserMode function.

* Note that in version 14.5, these features must be enabled using the LAnnotation::SetOptions function.

Related topics:

Implementing Annotations.

Types of Annotations.

Low-Level Coordinate System for Annotations.

Annotation Objects - Automated Features


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 LAnnotation::SetVisible.
Selected | Defaults to FALSE. It can be changed using LAnnotation::SetSelected.
Name | Defaults to show the name, with the name as the empty string. It can be changed using LAnnotation::SetNameOptions.
Foreground color | Defaults to black. It can be changed using LAnnotation::SetForeColor.
Background color | Defaults to white. It can be changed using LAnnotation::SetBackColor.
Font size | Defaults to 10 point, translated with a scaling factor of 1. It can be changed using LAnnotation::SetFontSize.
Font underline | Defaults to FALSE. It can be changed using LAnnotation::SetFontUnderline.
Font strikethrough | Defaults to FALSE. It can be changed using LAnnotation::SetFontStrikethrough.
Font italic | Defaults to FALSE. It can be changed using LAnnotation::SetFontItalic.
Font bold | Defaults to FALSE. It can be changed using LAnnotation::SetFontBold.
Font name | Defaults to "Arial". It can be changed using LAnnotation::SetFontName.
Fill mode | Defaults to transparent. It can be changed using LAnnotation::SetFillMode.
File | Defaults to the empty string. This can be changed using LAnnVideo::SetText.
Tag (identifier) | Defaults to 0. It can be changed using LAnnotation::SetTag.
Window handle | Defaults to NULL or the handle inherited from the container. It can be changed for all objects using LAnnContainer::SetWnd.
User mode | Defaults to design mode or the mode inherited from the container. It can be changed for all objects using LAnnContainer::SetUserMode.
Fixed State | Defaults to not fixed. It can be changed using LAnnXXX::SetFixed.
Name | Defaults to empty string. It can be changed using LAnnotation::SetNameOptions.

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.


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.


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 LAnnotation::SetOptions 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 LAnnotation::GetFillModeExt and LAnnotation::SetFillModeExt.


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.


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 LAnnotation::SetOptions 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 LAnnotation::GetFillModeExt and LAnnotation::SetFillModeExt.

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.


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.


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.


Encrypt Metafile Dialog Box for Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when you specify the metafile or secondary metafile for an encryptor or decryptor annotation object. It is implemented using the Windows common dialog box.


Decrypt Metafile Dialog Box for Annotations

Note:

This topic is for Document/Medical only.

The following dialog box appears in automation mode when the Decrypt Metafile item on the Default Properties menu is selected. It is implemented using the Windows common dialog box.


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.


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.


Annotation Automation Audio Dialog Strings

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 Encrypt Dialog Strings

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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_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 | "&Hilite Background Color..."
ANNAUTOTEXT_MENU_HILITEBACKGROUNDCOLOR | "&Redact Background Color..."
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_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_HOTSPOTMETAFILE | "&Hotspot Metafile...
ANNAUTOTEXT_MENU_ENCRYPTMETAFILE | "Encrypt Metafile..."
ANNAUTOTEXT_MENU_DECRYPTMETAFILE | "Decrypt Metafile..."
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..."


Annotation Automation Miscellaneous Strings

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText function.

Constant | Default String
ANNAUTOTEXT_ITEM_DEFAULTTEXT | "AaBbYyZz"


Annotation Automation Name Dialog Strings

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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

32-bit only object.

For playing the video, you must have LEADTOOLS Multimedia Features support and have DirectX installed.

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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_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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText function.

Constant | Default String
ANNAUTOTEXT_TEXT_CAPTION | "Text"
ANNAUTOTEXT_TEXT_OK | "OK"
ANNAUTOTEXT_TEXT_CANCEL | "Cancel"
ANNAUTOTEXT_TEXT_IMPORT | "From &Text File..."
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_APPLY | "Apply"


Annotation Automation ToolTip Dialog Strings

The following are constants and their default values. You can get the current value using the LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText 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 LAnnAutomation::GetAutoTextLen and LAnnAutomation::GetAutoText functions. You can modify the string using the LAnnAutomation::SetAutoText function.

Constant | Default String
ANNAUTOTEXT_VIDEOFILE_CAPTION | "Video File"
ANNAUTOTEXT_VIDEOFILE_FILTER | "AVI Files (*.avi)|*.avi|Wave Files (*.wav)|*.wav|All Files (*.*)|*.*|"


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_USER | [0x0100] First user defined tool
ANNTOOL_USERLAST | [0x0200] Last allowed user defined tools


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 and LTWVC are required for ALL Class Library 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. | DLL: LTANN14N.DLL | DLL: LTANN14NU.DLL | DLL: LTANN14E.DLL | DLL: LTANN14EU.DLL
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 | DLL: LTCLR14NU.DLL | DLL: LTCLR14E.DLL | DLL: LTCLR14EU.DLL
LTDIC | (Medical Imaging editions only) DICOM file support. Note: LFDIC14N.DLL is no longer shipped. All Dicom support is provided in the LTDIC DLL. | DLL: LTDIC14N.DLL | Unicode is not supported. | DLL: LTDIC14E.DLL | Unicode is not supported.
LTDIS | Display support, required for most applications. The header file is LTDIS.H. | DLL: LTDIS14N.DLL | DLL: LTDIS14NU.DLL | DLL: LTDIS14E.DLL | DLL: LTDIS14EU.DLL
LTEFX | Paint effects support. The header file is LTEFX.H. | DLL: LTEFX14N.DLL | DLL: LTEFX14NU.DLL | DLL: LTEFX14E.DLL | DLL: LTEFX14EU.DLL
LTFIL | File read and write support. The header file is LTFIL.H. | DLL: LTFIL14N.DLL | DLL: LTFIL14NU.DLL | DLL: LTFIL14E.DLL | DLL: LTFIL14EU.DLL
LTIMG | Image processing support. The header file is LTIMG.H. Also requires LTEFX, LTDIS and LTFIL. | DLL: LTIMG14N.DLL | DLL: LTIMG14NU.DLL | DLL: LTIMG14E.DLL | DLL: LTIMG14EU.DLL
LTIVW | LEADTOOLS Medical Image Viewer support. | DLL: LTIVW14N.DLL | DLL: LTIVW14NU.DLL | DLL: LTIVW14E.DLL | DLL: LTIVW14EU.DLL
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 | Unicode is not supported. | DLL: LTISI14E.DLL | 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 | DLL: LTKRN14NU.DLL | DLL: LTKRN14E.DLL | DLL: LTKRN14EU.DLL
LTLST | ImageList Control. Also requires LTKRN and LTDIS. | DLL: LTLST14N.DLL | DLL: LTLST14NU.DLL | DLL: LTLST14E.DLL | DLL: LTLST14EU.DLL
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 | DLL: LTNET14NU.DLL | DLL: LTNET14E.DLL | DLL: LTNET14EU.DLL
LTSCR | Screen Capture. The header file is LTSCR.H. | DLL: LTSCR14N.DLL | DLL: LTSCR14NU.DLL | DLL: LTSCR14E.DLL | DLL: LTSCR14EU.DLL
LTTMB | Thumbnail Browser Control. Also requires LTKRN, LTFIL, LTDIS, and LTIMG. | DLL: LTTMB14N.DLL | DLL: LTTMB14NU.DLL | DLL: LTTMB14E.DLL | DLL: LTTMB14EU.DLL
LTTWN | TWAIN support. The header file is LTTWN.H. | DLL: LTTWN14N.DLL | DLL: LTTWN14NU.DLL | DLL: LTTWN14E.DLL | DLL: LTTWN14EU.DLL
LTWND | Windows registered class support. The header file is LTWND.H. The only function in the DLL is L_UseBitmapClass. | DLL: LTWND14N.DLL | DLL: LTWND14NU.DLL | DLL: LTWND14E.DLL | DLL: LTWND14EU.DLL
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.
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 | DLL: LVKRN14NU.DLL LVDLG14NU.DLL LVGL14NU.DLL | DLL: LVKRN14E.DLL LVDLG14E.DLL LVGL14E.DLL | DLL: LVKRN14EU.DLL LVDLG14EU.DLL LVGL14EU.DLL
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 the DWG filter 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 the DWF filter 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\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
IMPORTANT FORMS | Contracts, Pricing Schedules, Runtime Agreements, etc.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
INCLUDE\CLASSLIB | Header files for the Class Library
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.
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.


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.


Summary of All Supported Image File Formats

Raster Color and Grayscale

ABIC - ABIC Format

AFP - AFP Format

ANI - Windows Animated Cursor

AVI - Windows AVI Format

BMP - Windows Bitmap Formats

CIN - Cineon Format

CLP - Microsoft Windows Clipboard Format

CMP - LEAD Compressed

CMW - LEAD Wavelet Compressed

CRW - Canon RAW Format

CUR - Windows Cursors

CUT - Dr. Halo Format

DCR - Kodak Professional Digital Camera Format

DCS - Kodak Professional Digital Camera System Format

DCX - DCX Format

DICOM - DICOM Format

DJVU - DjVu Format

ECW - Enhanced Compressed Wavelet Format

EMF - Windows Metafile Formats

EPS - Encapsulated PostScript Format

EXIF - Exif Formats

FIT - FITS Format

FLC - Flic Animation Format

FPX - Kodak Format

GIF - Compuserve GIF Format

ICO - Windows Icons

IFF - Interchange File Formats

JBG - JBIG Format

JPG - JPEG Compressed

JP2 - JPEG 2000 Compressed

KDC - Kodak Digital Camera Format

MRC - Mixed Raster Content

MPG - MPEG Video Format

PBM - Portable Bitmap Utilities Format

PCD - Kodak Format

PCT - Macintosh Pict Format

PCX - PCX Format

PDF - Portable Document Format

PNG - Portable Network Graphics Format

PSD - PhotoShop 3.0 Format

PSP - Paint Shop Pro Format

PTK - PTOCA Format

RAS - SUN Raster Format

SCT - Scitex Continuous Tone Format

SFF - Structured Fax File Format

SGI - Silicon Graphics Image Format

SID - MrSid Format

TGA - Truevision TARGA Format

TIFF - Tagged Image File Format

TXT - Text Format

WBMP - Wireless Bitmap Format

WMF - Windows Metafile Formats

WPG - WordPerfect Format

XPM - XPicMap

XWD - X WindowDump

Raster Bitonal (1-Bit)

ABC - ABC Format

AWD - Microsoft FAX Format

CAL - CALS Raster Format

CMP - LEAD 1-Bit Format

FAX - Raw Fax Format

FAX - LaserView LaserData Format

ICA - Image Object Content Architecture (IOCA/MODCA)

IMG - GEM Image Format

ITG - Intergraph Format

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 LFile::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


LEAD Image Optimizer Supported Formats

The following formats are currently supported by the Image Optimizer 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 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 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).


File Formats: ABIC Format (ABIC, ICA)

ABIC Format (ABIC, ICA)

LEADTOOLS reads and writes ABIC files.

The ABIC file format is a raster file format created by IBM. This file format consists of ABIC compression/decompression algorithms that uses an arithmetic coding technique to produce lossless data compression, these algorithms called ABIC (Bi-level Q-Coder) compression algorithm and Concatenated ABIC (Grayscale) compression algorithm.

LEADTOOLS can Load/Save (compression/decompression) ABIC Raw data separately.

The default extension used by this format is: ICA, ABIC (for raw data).

This file format does not support progressive loads and saves, multi-page files, stamps, or Lossless JPEG compression.

Support for this file format can be unlocked using the following support constant: L_KEY_ABIC_READ, L_KEY_ABIC_SAVE.

The file constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_ABIC | 1, 4 BPP | 1, 4 BPP | [185] Raw ABIC compressed data

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

Related Formats: IOCA/MODCA - Image Object Content Architecture Format


File Formats: AFP (AFP)

AFP Format (AFP)

The AFP format is part of IBM's document imaging system. It is a raster format, created to add enhanced formatting and indexing capabilities to documents for print applications in finance, retail, insurance and other industries. LEAD provides support for the user to open MODCA/PTOCA or AFP/PTOCA documents.

The default extension used by this format is: AFP.

This format is used by the IBM plug in.

This file format does not support stamps or Lossless JPEG compression, but it does support multi-page files.

LEADTOOLS supports functions that let you set the DPI for the opened image file. Please refer to the PTK Options functions.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_AFP | 24 BPP | None | [252] IBM This format is part of IBM's document imaging system.
FILE_AFPICA_G3_1D | 1 BPP | 1 BPP | [309] IOCA, G3 1D compressed.
FILE_AFPICA_G3_2D | 1 BPP | 1 BPP | [310] IOCA, G3 2D compressed.
FILE_AFPICA_G4 | 1 BPP | 1 BPP | [311] IOCA, G4 compressed.
FILE_AFPICA_UNCOMPRESSED | 1 BPP | 1 BPP | [312] IOCA, uncompressed.
FILE_AFPICA_IBM_MMR | 1 BPP | 1 BPP | [313] IOCA, IBM MMR compressed.

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

Currently, LEAD does not save AFP files, but these files can be saved to IOCA.

Related Formats: FAX - Raw Fax Format, ICA - Image Object Content Architecture (IOCA/MODCA), PTK - PTOCA Format, TIFF - Tagged Image File Format / CCITT.


File Formats: BMP Formats

BMP Formats

LEADTOOLS reads and writes the following BMP formats:

Windows Bitmap (BMP). This is a file format created by Microsoft. Some BMP images are compressed with an RLE-type compression.

OS/2 Bitmap (OS/2 BMP). These are files created on an OS/2 operating system. LEADTOOLS supports both 1.x and 2.x formats.

File constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_BMP | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [6] Windows BMP, with no compression.
FILE_BMP_RLE | 4, 8 BPP | 4, 8 BPP | [84] Windows BMP, with RLE compression.
FILE_OS2 | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [14] OS/2 BMP version 1.x.
FILE_OS2_2 | 1, 4, 8, 24 BPP | 1, 4, 8, 24 BPP | [74] OS/2 BMP version 2.x.

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

Related Formats: PBM - Portable Bitmap Utilities Format, PCX - PCX Format, WBMP - Wireless Bitmap Format, XPM - XPicMap, XBM - XBitMap Format.


Canon RAW Format (CRW)

The Canon Raw file format is a raster file format created by Canon digital cameras. It is a raw dump of CCD pixels with no compression. This format is supported by POLYVIEW.

LEADTOOLS can read and view, using the Canon Digital Camera SDK (CD-SDK), CRW files generated by the following digital cameras:

Power Shot | IXY DIGITAL | DIGITAL IXUS | EOS
Power Shot A10 Power Shot A20 Power Shot A30 Power Shot A40 Power Shot A100 Power Shot S10 Power Shot S20 Power Shot S30 Power Shot S40 Power Shot S100 Power Shot S110 Power Shot S200 Power Shot S300 Power Shot S330 Power Shot G1 Power Shot G2 Power Shot Pro90 IS | IXY DIGITAL IXY DIGITAL 200 IXY DIGITAL 200a IXY DIGITAL 300 IXY DIGITAL 300a | DIGITAL IXUS DIGITAL IXUS v DIGITAL IXUS v2 DIGITAL IXUS 300 DIGITAL IXUS 300 | EOS D30 EOS D60 EOS-1D

The default extension used by this format is: CRW.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CRW | 24 BPP | None | [296] Cannon raw format.

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

Related Formats: DCR - Kodak Professional Digital Camera Format, DCS - Kodak Professional Digital Camera System Format, EXIF - Exif Formats, FPX - Kodak Format, KDC - Kodak Digital Camera Format, PCD - Kodak Format.


File Formats: Cineon Format (CIN)

Cineon Format (CIN)

KODAK Cineon Format (CIN) files are raster format files created by Kodak and supported by XnView and PixEdit. They are designed to better represent film imagery in a digital format. Cineon files store data in a 10-bit logarithmic scale. Therefore, each color component has a range of 0 to 1023. LEADTOOLS supports version 4.5 of this format.

The default extension used by this format is: CIN.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_CIN | 24 BPP | 24 BPP | [298] Kodak Cineon Format.

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


File Formats: Compressed Windows Metafile Format (WMZ)

Compressed Windows Metafile Format (WMZ)

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

The default extension used by this format is: WMZ.

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

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

File constants associated with this file format are:

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

When WMZ files are rasterized, they are 24 BPP.

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

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 LFile::ReadComment function to read comments in an existing file. Before writing a file, you can use the LFileSettings::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 LFileSettings::SetDJVOptions and LFileSettings::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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 .

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 LFile::ReadComment function to read comments in an existing file. Before writing a file, you can use the LFileSettings::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 LFile::GetCompressStamp 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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 LFile::ReadComment function to read comments in an existing file. Before writing a file, you can use the LFileSettings::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 Formats (PCD and FPX)

Kodak Formats (PCD and FPX)

LEADTOOLS supports the following Kodak formats:

PhotoCD (PCD). This is a common high-resolution format for images on CD-ROM. An image file can contain one or more physical resolutions, with fixed dimensions. You can choose which resolution to load, and thus control the size of the resulting bitmap.

You cannot write PhotoCD files. They are read-only.

FlashPix (FPX). The FlashPix file format was developed through the combined efforts of Eastman Kodak Company, Microsoft Corporation, Hewlett-Packard Company, and Live Picture Inc. It combines the best features of existing formats with object orientation to make the use of digital color images easier.

The format of a FlashPix file is based on compound object storage, which allows storage of various kinds of data. A FlashPix file may consist of several "pages" where each "page" has storage for a source image, non-image data in the form of comments, transform data, and a stamp or thumbnail. Each image is stored as an entire multi-resolution hierarchy where each resolution in the hierarchy differs from the next highest resolution by a factor of 2 in the x dimension and in the y dimension. Non-image data are treated as comments in FlashPix file format. Comments are used to store information pertaining to the image, not actual pixel data. This information may include image title, image subject, camera manufacturer, scan software version number, and so forth. In addition to the image itself, FlashPix files store transform information. This data indicates transformations which may be performed on the source image. By storing the transforms, the source image may be stored in its original state and transformed, using the stored transforms, at your discretion. A stamp, or thumbnail, provides a small bitmap representation of a FlashPix image.

File constants associated with these file formats are:

Constant | Read Support | Write Support | Description
FILE_PCD | 8, 24 BPP | None | [57] Kodak PhotoCD.
FILE_FPX | 8, 24 BPP | 8, 24 BPP | [80] FlashPix, with no compression.
FILE_FPX_SINGLE_COLOR | 8, 24 BPP | 8, 24 BPP | [81] FlashPix, compressed with the single color method.
FILE_FPX_JPEG | 8, 24 BPP | 8, 24 BPP | [82] FlashPix, compressed with JPEG, using the default Q factor.
FILE_FPX_JPEG_QFACTOR | 8, 24 BPP | 8, 24 BPP | [83] FlashPix, compressed with JPEG, using a specified Q factor.

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

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 Digital Camera Format (KDC)

Kodak Digital Camera Format (KDC)

The Kodak Digital Camera format files are raster files created by Kodak digital cameras. This format was developed by Kodak and is supported by PaintShop Pro and ACDSee. LEADTOOLS can read and view, using the Kodak SDK, the full image of KDC files of type 40, 50 and 120, which are generated by the Kodak DC40, DC50 and DC120 digital cameras. LEADTOOLS can load all versions of the KDC 40, KDC 50 and KDC 120 files. LEADTOOLS does not save KDC files.

The default extension used by this format is: KDC.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_KDC_120 | 24 BPP | None | [263] KDC DC120.
FILE_KDC_40 | 24 BPP | None | [264] KDC DC40.
FILE_KDC_50 | 24 BPP | None | [265] KDC DC50.

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

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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 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 Format (MRC)

Mixed Raster Content Format (MRC)

The Mixed Raster Content format was defined for use of color and grayscale fax as part of the RFC-2301, File Format for Internet Fax. The Mixed Raster Content mode (T.44) enables different coding methods and resolutions to be used within a single page by defining a 3-layer image model for structuring and combining the scanned image data. The image is segmented and each segment assigned a type based on the number of colors used in that segment. Segments can be combined and compressed using different compression schemes to create a file that balances quality with compression.

The default extension used by this format is: MRC.

LEADTOOLS supports Load and save for this format.

Keys that must be unlocked to enable this format support:

L_SUPPORT_DOCUMENT

Multi-page is supported through TIFF format.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MRC | 24 BPP | N/A (see note below) | [168] Mixed Raster Content.

NOTE: MRC is made up of different segments, which can be of various BitsPerPixel. When you request file information on an MRC file, it will be reported as 24-bit. When you save MRC files, various segments will be saved with different BitsPerPixel, based on the content.

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

Related Formats: LEAD MRC Format, TIFF - Tagged Image File Format.


File Formats: MPEG Video Format (MPG)

MPEG Video Format (MPG)

MPEG Video Format (MPG) is a file format used for multimedia files. These files store both audio and video data.

File constants associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MPEG1 | 24 BPP | None | [243] MPEG-1 (video) file.
FILE_MPEG2 | 24 BPP | None | [246] MPEG-2 (video) file.

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

Related Formats: AVI - Windows AVI Format.


File Formats: MrSid Format (SID)

MrSid Format (SID)

The MrSid file format is a raster format developed by LizardTech and supported by the MrSid Viewer from LizardTech. LEADTOOLS can read and view the full image using the MrSID SDK V 3.1.4. Various levels of the MrSid file can be loaded using LFileSettings::GetLoadResolution, LFile::ReadLoadResolutions and LFileSettings::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 LFile::LoadLayer, or all at once, using LFile::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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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.
FILE_RAS_PDF_JBIG2 | N/A* | 1 BPP | [188] Raster PDF with JBIG2 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 LFile::ReadComment function to read comments in an existing file. Before writing a file, you can use the LFileSettings::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 the 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: Miscellaneous 1-Bit Formats (MAC, IMG, and MSP)

Miscellaneous 1-Bit Formats (MAC, IMG, and MSP)

LEADTOOLS supports reading and writing of the following 1-bit formats:

MacPaint (MAC). These Macintosh Paint files are commonly used for monochrome clip art.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MAC | 1 BPP | 1 BPP | [51] MacPaint - Macintosh Paint.

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

GEM Image (IMG). These files are native to the Graphical Environment Manager developed by Digital Research.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_IMG | 1 BPP | 1 BPP | [52] GEM Image.

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

Microsoft Paint (MSP). These files from early versions of Windows are used for black-and-white drawings and clip art.

File constant associated with this file format are:

Constant | Read Support | Write Support | Description
FILE_MSP | 1 BPP | 1 BPP | [53] Microsoft Paint.

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


File Formats: 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.

This format does not support LEAD's redirected IO feature, therefore
 it cannot be used with LMemoryFile::LoadMemory,
 LMemoryFile::SaveBitmap,
 or LFile::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.


Class Hierarchy Chart

Note:

LEADTOOLS also offers DICOM Classes in selected products. For information about the DICOM classes, refer to Ltdiclibn.chm in the LEAD\HELP\ directory.

Wrapper Macros

Bitmap Class Map Macros


LAnimationWindow

Description

The LAnimationWindow class is derived from the LBitmapWindow class, and extends it by adding LEAD Animation functionality. LBitmapWindow controls bitmap settings, loading, saving, rotation, zooming and scrolling, whereas the LAnimationWindow class adds a playback mechanism for bitmap lists (For more information about bitmap lists and animation playbacks, see LBitmapList and LPlayBack). LAnimationWindow can be used to playback animated GIF and AVI files, as well as any LEAD bitmap list. The class maintains an internal bitmap list to keep track of the loaded bitmaps. You must unlock support for GIF files. For more information on unlocking GIF support, see LSettings::UnlockSupport.

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

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

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

Using command notification messages, the LAnimationWindow object can be used in a manner similar to standard Windows controls for dialogs. By overriding the virtual functions provided by LAnimationWindow and the base class LBitmapWindow, you can use LAnimationWindow objects as a regular window, which handles most messages for you. For more information on the two ways in which LBitmapWindow objects can be used, refer to LAnimationWindow:Window vs Control.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTDIS
LTDLGKRN
LTDLGIMG
LTDLGEFX
LTDLGWEB
LTDLGFILE
LTDLGIMGEFX
LTDLGCLR
LTDLGIMGDOC
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LAnimationWindow::Class Members

Member Functions

Return to LAnimation


LAnimationWindow::Member Functions

Constructors / Destructors

Loading/Saving Animations

Animation Properties

Playing Animations

Animation Frames

Miscellaneous

Overridables

Constructors / Destructors

LAnimationWindow::LAnimationWindow

LAnimationWindow::~LAnimationWindow

Loading/Saving Animations

LAnimationWindow::IsValidAnimation

LAnimationWindow::Load

LAnimationWindow::Save

LAnimationWindow::SetBitmapList

Animation Properties

LAnimationWindow::EnableAutoLoop

LAnimationWindow::EnableLoop

LAnimationWindow::EnableTransparency

LAnimationWindow::GetAnimationBitsPerPixel

LAnimationWindow::GetAnimationColorOrder

LAnimationWindow::GetAnimationHeight

LAnimationWindow::GetAnimationWidth

LAnimationWindow::GetAnimationWindow

LAnimationWindow::GetBackgroundColor

LAnimationWindow::GetDelay

LAnimationWindow::GetDisposalMethod

LAnimationWindow::GetPosition

LAnimationWindow::GetRemainingDelay

LAnimationWindow::IsAutoLoopEnabled

LAnimationWindow::IsLoopEnabled

LAnimationWindow::IsTransparencyEnabled

LAnimationWindow::IsWaitingForUserInput

LAnimationWindow::SetBackgroundColor

LAnimationWindow::SetDelay

LAnimationWindow::SetDisposalMethod

LAnimationWindow::SetPosition

LAnimationWindow::WaitForUserInput

Playing Animations

LAnimationWindow::IsAutoAnimateEnabled

LAnimationWindow::EnableAutoAnimate

LAnimationWindow::EnableAnimateEvent

LAnimationWindow::PlayAnimation

LAnimationWindow::StopAnimation

LAnimationWindow::IsPlaying

LAnimationWindow::DoEvents

LAnimationWindow::EnablePlayWhileLoad

LAnimationWindow::IsPlayWhileLoadEnabled

LAnimationWindow::CancelWait

Animation Frames

LAnimationWindow::MoveFirstFrame

LAnimationWindow::MoveLastFrame

LAnimationWindow::MovePreviousFrame

LAnimationWindow::MoveNextFrame

LAnimationWindow::MoveToFrame

LAnimationWindow::GetCurrentIndex

LAnimationWindow::GetCount

LAnimationWindow::IsNextFrameAvailable

LAnimationWindow::IsPreviousFrameAvailable

LAnimationWindow::IsFirstFrame

LAnimationWindow::IsLastFrame

Miscellaneous

LAnimationWindow::ColorResItems

LAnimationWindow::DoModalColorResItems

Overridables

LAnimationWindow::AnimateEvent

LAnimationWindow::EndChanging

LAnimationWindow::StartChanging


LAnnAudioClip

Description

The LAnnAudioClip class is derived from LAnnotation. This class contains the support for creating, and managing Audio Clip annotation objects. You can use objects created from this class to set/get the different properties of an AudioClip annotation object.

For more information about the Audio Clip annotation object, refer to AudioClip Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnAudioClip::Class Members

Member Functions

Return to LAnnAudioClip


LAnnAudioClip::Member Functions

Constructors / Destructors

Creating Audio Clip Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnAudioClip::LAnnAudioClip

LAnnAudioClip::~LAnnAudioClip

Creating Audio Clip Objects

LAnnAudioClip::Create

LAnnAudioClip::AddUserHandle

LAnnAudioClip::GetUserHandle

LAnnAudioClip::GetUserHandles

LAnnAudioClip::ChangeUserHandle

LAnnAudioClip::DeleteUserHandle

LAnnAudioClip::EnumerateHandles

LAnnAudioClip::EnumHandleCallBack

LAnnAudioClip::GetRotateAngle

LAnnAudioClip::GetFixed

LAnnAudioClip::SetFixed

LAnnAudioClip::PushFixedState

LAnnAudioClip::PopFixedState

LAnnAudioClip::IsFixedInRect

Getting/Setting Object Properties

LAnnAudioClip::GetText

LAnnAudioClip::GetTextLen

LAnnAudioClip::SetText


LAnnAutomation

Description

The LAnnAutomation class is derived from LAnnotation. This class contains the support for creating, and managing Automation annotation objects. You can use objects created from this class to set/get the different properties of an Automation annotation object.

Setting the properties of the Automation annotation object, controls the default properties of the user interface and the objects in the container.

For more information about the Automation Clip annotation object, refer to Annotation Automation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnAutomation::Class Members

Member Functions

Return to LAnnAutomation


LAnnAutomation::Member Functions

Constructors / Destructors

Creating and Destroying Automation Objects

Managing the Automation Object

Getting/Setting Default Object Properties

Constructors / Destructors

LAnnAutomation::LAnnAutomation

LAnnAutomation::~LAnnAutomation

Creating and Destroying Automation Objects

LAnnAutomation::Create

Managing the Automation Object

LAnnAutomation::GetAutoContainer

LAnnAutomation::GetAutoContainer

LAnnAutomation::GetAutoText

LAnnAutomation::GetAutoTextLen

LAnnAutomation::GetBitmapDpiX

LAnnAutomation::GetBitmapDpiY

LAnnAutomation::GetDpiX

LAnnAutomation::GetDpiY

LAnnAutomation::GetTool

LAnnAutomation::IsAutoDrawEnabled

LAnnAutomation::IsAutoMenuEnabled

LAnnAutomation::IsHyperlinkMenuEnabled

LAnnAutomation::SetAutoContainer

LAnnAutomation::SetAutoContainer

LAnnAutomation::SetAutoDrawEnabled

LAnnAutomation::SetAutoMenuEnabled

LAnnAutomation::SetAutoText

LAnnAutomation::SetBitmapDpiX

LAnnAutomation::SetBitmapDpiY

LAnnAutomation::SetDpiX

LAnnAutomation::SetDpiY

LAnnAutomation::SetHyperlinkMenuEnabled

LAnnAutomation::SetTool

LAnnAutomation::SetUndoDepth

LAnnAutomation::Undo

LAnnAutomation::SetEncryptOptions

LAnnAutomation::GetEncryptOptions

LAnnAutomation::GetPointOptions

LAnnAutomation::SetPointOptions

LAnnAutomation::GetTextAlign

LAnnAutomation::SetTextAlign

LAnnAutomation::SetTextRotate

LAnnAutomation::GetTextRotate

LAnnAutomation::SetTextPointerFixed

LAnnAutomation::GetTextPointerFixed

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::EnumerateTextTokenTable

LAnnAutomation::EnumTextTokenTableCallBack

LAnnAutomation::DeleteTextTokenTable

LAnnAutomation::ClearTextTokenTable

LAnnAutomation::GetTextExpandTokens

LAnnAutomation::SetTextExpandTokens

LAnnAutomation::GetFixed

LAnnAutomation::SetFixed

LAnnAutomation::PushFixedState

LAnnAutomation::PopFixedState

LAnnAutomation::IsFixedInRect

LAnnAutomation::SetAutoCursor

LAnnAutomation::GetAutoCursor

LAnnAutomation::SetTextRTF

LAnnAutomation::GetTextRTF

LAnnAutomation::GetTicMarkLength

LAnnAutomation::SetTicMarkLength

LAnnAutomation::SetAutoDialogFontSize

LAnnAutomation::GetAutoDialogFontSize

LAnnAutomation::SetAutoUndoEnable

LAnnAutomation::GetAutoUndoEnable

LAnnAutomation::AddUndoNode

LAnnAutomation::SetAutoHilightPen

Getting/Setting Default Object Properties

LAnnAutomation::GetBackColor

LAnnAutomation::GetDistance

LAnnAutomation::GetFillMode

LAnnAutomation::GetFillPattern

LAnnAutomation::GetFontName

LAnnAutomation::GetFontNameLen

LAnnAutomation::GetFontSize

LAnnAutomation::GetForeColor

LAnnAutomation::GetGaugeLength

LAnnAutomation::GetLineStyle

LAnnAutomation::GetLineWidth

LAnnAutomation::GetPolyFillMode

LAnnAutomation::GetText

LAnnAutomation::GetTextLen

LAnnAutomation::GetUnit

LAnnAutomation::GetUnitLen

LAnnAutomation::IsFontBold

LAnnAutomation::IsFontItalic

LAnnAutomation::IsFontStrikeThrough

LAnnAutomation::IsFontUnderline

LAnnAutomation::SetBackColor

LAnnAutomation::SetFillMode

LAnnAutomation::SetFillPattern

LAnnAutomation::SetFontBold

LAnnAutomation::SetFontItalic

LAnnAutomation::SetFontName

LAnnAutomation::SetFontSize

LAnnAutomation::SetFontStrikeThrough

LAnnAutomation::SetFontUnderline

LAnnAutomation::SetForeColor

LAnnAutomation::SetGaugeLength

LAnnAutomation::SetLineStyle

LAnnAutomation::SetLineWidth

LAnnAutomation::SetPolyFillMode

LAnnAutomation::SetText

LAnnAutomation::SetTransparent

LAnnAutomation::SetUnit


LAnnButton

Description

The LAnnButton class is derived from LAnnotation. This class contains the support for creating, and managing Button annotation objects. You can use objects created from this class to set/get the different properties of a Button annotation object.

For more information about the Button annotation object, refer to Button Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnButton::Class Members

Member Functions

Return to LAnnButton


LAnnButton::Member Functions

Constructors / Destructors

Creating Button Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnButton::LAnnButton

LAnnButton::~LAnnButton

Creating Button Objects

LAnnButton::Create

Getting/Setting Object Properties

LAnnButton::AddUserHandle

LAnnButton::GetUserHandle

LAnnButton::GetUserHandles

LAnnButton::ChangeUserHandle

LAnnButton::DeleteUserHandle

LAnnButton::EnumerateHandles

LAnnButton::EnumHandleCallBack

LAnnButton::GetRotateAngle

LAnnButton::GetFixed

LAnnButton::SetFixed

LAnnButton::PushFixedState

LAnnButton::PopFixedState

LAnnButton::IsFixedInRect

LAnnButton::GetForeColor

LAnnButton::GetText

LAnnButton::GetTextLen

LAnnButton::SetForeColor

LAnnButton::SetText


LAnnContainer

Description

The LAnnContainer class is derived from LAnnotation. This class provides the necessary functionality for creating and managing Container objects, in addition to managing other annotation objects by providing the functionality of inserting, removing, and enumerating the different annotation objects contained by Container objects.

For more information about the Container annotation object, refer to Container Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnContainer::Class Members

Member Functions

Return to LAnnContainer


LAnnContainer::Member Functions

Constructors / Destructors

Creating a Container Object

Enumerating Objects

Getting/Setting Container Properties

Loading Annotation Objects

Miscellaneous

Overridables

Realizing Annotation Objects

Saving Annotation Objects

Constructors / Destructors

LAnnContainer::LAnnContainer

LAnnContainer::~LAnnContainer

Creating a Container Object

LAnnContainer::Create

Enumerating Objects

LAnnContainer::Enumerate

LAnnContainer::EnumerateCallBack

Getting/Setting Container Properties

LAnnContainer::EncryptApply

LAnnContainer::RestrictCursor

LAnnContainer::HitTestExt

LAnnContainer::Convert

LAnnContainer::SetGrouping

LAnnContainer::GetGrouping

LAnnContainer::GetBackColor

LAnnContainer::GetFillMode

LAnnContainer::GetFillPattern

LAnnContainer::GetForeColor

LAnnContainer::GetItem

LAnnContainer::GetLineStyle

LAnnContainer::GetLineWidth

LAnnContainer::GetSelectCount

LAnnContainer::GetSelectItems

LAnnContainer::GetSelectRect

LAnnContainer::HitTest

LAnnContainer::SetBackColor

LAnnContainer::SetBitmap

LAnnContainer::SetDpiX

LAnnContainer::SetDpiY

LAnnContainer::SetFillMode

LAnnContainer::SetFillPattern

LAnnContainer::SetFontBold

LAnnContainer::SetFontItalic

LAnnContainer::SetFontName

LAnnContainer::SetFontSize

LAnnContainer::SetFontStrikeThrough

LAnnContainer::SetFontUnderline

LAnnContainer::SetForeColor

LAnnContainer::SetLineStyle

LAnnContainer::SetLineWidth

LAnnContainer::SetPolyFillMode

LAnnContainer::SetText

LAnnContainer::SetTransparent

LAnnContainer::SetUserMode

LAnnContainer::SetWnd

Loading Annotation Objects

LAnnContainer::Load

LAnnContainer::LoadMemory

LAnnContainer::LoadOffset

LAnnContainer::DeletePage

LAnnContainer::DeletePageMemory

LAnnContainer::DeletePageOffset

LAnnContainer::FileInfo

LAnnContainer::FileInfoMemory

LAnnContainer::FileInfoOffset

Miscellaneous

LAnnContainer::CopyFromClipboard

LAnnContainer::Insert

Overridables

LAnnContainer::EnumerateCallBack

Realizing Annotation Objects

LAnnContainer::Realize

LAnnContainer::Unrealize

Saving Annotation Objects

LAnnContainer::Save

LAnnContainer::SaveMemory

LAnnContainer::SaveOffset

LAnnContainer::SaveTag


LAnnCrossProduct

Description

The LAnnCrossProduct class is derived from LAnnRuler. This class provides the necessary functionality for creating and managing Cross product objects. You can use the objects created from this class to set/get the different properties of a Cross product annotation object.

For more information about the Container annotation object, refer to Cross product Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class

New Annotation Features of Version 14.5


LAnnCrossProduct::Class Members

Constructors / Destructors

Creating Ruler Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnCrossProduct::LAnnCrossProduct

LAnnCrossProduct::~LAnnCrossProduct

Creating Ruler Objects

LAnnCrossProduct::Create

Getting/Setting Object Properties

LAnnCrossProduct::AddUserHandle

LAnnCrossProduct::GetUserHandle

LAnnCrossProduct::GetUserHandles

LAnnCrossProduct::ChangeUserHandle

LAnnCrossProduct::DeleteUserHandle

LAnnCrossProduct::EnumerateHandles

LAnnCrossProduct::EnumHandleCallBack

LAnnCrossProduct::GetFixed

LAnnCrossProduct::SetFixed

LAnnCrossProduct::PushFixedState

LAnnCrossProduct::PopFixedState

LAnnCrossProduct::IsFixedInRect

LAnnCrossProduct::GetDistance2

LAnnCrossProduct::GetDistance

LAnnCrossProduct::GetLineStyle

LAnnCrossProduct::GetLineWidth

LAnnCrossProduct::GetPointCount

LAnnCrossProduct::GetPoints

LAnnCrossProduct::SetLineStyle

LAnnCrossProduct::SetLineWidth

LAnnCrossProduct::SetPoints

Return to LAnnCrossProduct


LAnnCurve

Description

The LAnnCurve class is derived from LAnnotation. This class contains the support for creating and managing Curve annotation objects. You can use objects created from this class to set/get the different properties of a Curve annotation object.

For more information about the Curve annotation object, refer to Curve Annotation Object.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LAnnCurve::Class Members

Member Functions

Return to LAnnCurve


LAnnCurve::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnCurve::LAnnCurve

LAnnCurve::~LAnnCurve

Miscellaneous

LAnnCurve::Create

LAnnCurve::AddUserHandle

LAnnCurve::GetUserHandle

LAnnCurve::GetUserHandles

LAnnCurve::ChangeUserHandle

LAnnCurve::DeleteUserHandle

LAnnCurve::EnumerateHandlest

LAnnCurve::EnumHandleCallBack

LAnnCurve::GetFixed

LAnnCurve::SetFixed

LAnnCurve::PushFixedState

LAnnCurve::PopFixedState

LAnnCurve::IsFixedInRect

LAnnCurve::GetPointCount

LAnnCurve::GetPoints

LAnnCurve::SetPoints


LAnnCurveClosed

Description

The LAnnCurveClosed class is derived from LAnnotation. This class contains the support for creating and managing Closed Curve annotation objects. You can use objects created from this class to set/get the different properties of a Closed Curve annotation object.

For more information about the Closed Curve annotation object, refer to Closed Curve Annotation Object.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LAnnCurveClosed::Class Members

Member Functions

Return to LAnnCurveClosed


LAnnCurveClosed::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnCurveClosed::LAnnCurveClosed

LAnnCurveClosed::~LAnnCurveClosed

Miscellaneous

LAnnCurveClosed::Create

LAnnCurveClosed::AddUserHandle

LAnnCurveClosed::GetUserHandle

LAnnCurveClosed::GetUserHandles

LAnnCurveClosed::ChangeUserHandle

LAnnCurveClosed::DeleteUserHandle

LAnnCurveClosed::EnumerateHandles

LAnnCurveClosed::EnumHandleCallBack

LAnnCurveClosed::GetFixed

LAnnCurveClosed::SetFixed

LAnnCurveClosed::PushFixedState

LAnnCurveClosed::PopFixedState

LAnnCurveClosed::IsFixedInRect

LAnnCurveClosed::GetPointCount

LAnnCurveClosed::GetPoints

LAnnCurveClosed::SetPoints


LAnnEllipse

Description

The LAnnEllipse class is derived from LAnnotation class. This class contains the support for creating, and managing Ellipse annotation objects. You can use the objects created from this class to set/get the different properties of an Ellipse annotation object.

For more information about the Ellipse annotation object, refer to Ellipse Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnEllipse::Class Members

Member Functions

Return to LAnnEllipse


LAnnEllipse::Member Functions

Constructors / Destructors

Creating Ellipse Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnEllipse::LAnnEllipse

LAnnEllipse::~LAnnEllipse

Creating Ellipse Objects

LAnnEllipse::Create

Getting/Setting Object Properties

LAnnEllipse::AddUserHandle

LAnnEllipse::GetUserHandle

LAnnEllipse::GetUserHandles

LAnnEllipse::ChangeUserHandle

LAnnEllipse::DeleteUserHandle

LAnnEllipse::EnumerateHandles

LAnnEllipse::EnumHandleCallBack

LAnnEllipse::GetRotateAngle

LAnnEllipse::GetFixed

LAnnEllipse::SetFixed

LAnnEllipse::PushFixedState

LAnnEllipse::PopFixedState

LAnnEllipse::IsFixedInRect

LAnnEllipse::GetBackColor

LAnnEllipse::GetFillMode

LAnnEllipse::GetFillPattern

LAnnEllipse::GetForeColor

LAnnEllipse::GetLineStyle

LAnnEllipse::GetLineWidth

LAnnEllipse::SetBackColor

LAnnEllipse::SetFillMode

LAnnEllipse::SetFillPattern

LAnnEllipse::SetForeColor

LAnnEllipse::SetLineStyle

LAnnEllipse::SetLineWidth


LAnnEncrypt

Description

The LAnnEncrypt class is derived from LAnnotation. This class contains the support for creating and managing Encrypt annotation objects. You can use objects created from this class to set/get the different properties of an Encrypt annotation object.

For more information about the Encrypt annotation object, refer to Encrypt Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LAnnEncrypt::Class Members

Member Functions

Return to LAnnEncrypt


LAnnEncrypt::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnEncrypt::LAnnEncrypt

LAnnEncrypt::~LAnnEncrypt

Miscellaneous

LAnnEncrypt::Create

LAnnEncrypt::AddUserHandle

LAnnEncrypt::GetUserHandle

LAnnEncrypt::GetUserHandles

LAnnEncrypt::ChangeUserHandle

LAnnEncrypt::DeleteUserHandle

LAnnEncrypt::EnumerateHandles

LAnnEncrypt::EnumHandleCallBack

LAnnEncrypt::SetEncryptOptions

LAnnEncrypt::GetEncryptOptions

LAnnEncrypt::GetSecondaryMetafile

LAnnEncrypt::SetMetafile

LAnnEncrypt::GetMetafile

LAnnEncrypt::GetRotateAngle

LAnnEncrypt::GetLineStyle

LAnnEncrypt::GetLineWidth

LAnnEncrypt::SetLineStyle

LAnnEncrypt::SetLineWidth


LAnnFreehand

Description

The LAnnFreehand class is derived from LAnnotation. This class contains the support for creating, and managing Freehand annotation objects. You can use objects created from this class to set/get the different properties of a Freehand annotation object..

For more information about the Freehand annotation object, refer to Freehand Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class, Derived Classes


LAnnFreeHand::Class Members

Member Functions

Return to LAnnFreeHand


LAnnFreehand::Member Functions

Constructors / Destructors

Creating Freehand Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnFreehand::LAnnFreehand

LAnnFreehand::~LAnnFreehand

Creating Freehand Objects

LAnnFreehand::Create

LAnnFreehand::Define

Getting/Setting Object Properties

LAnnFreehand::AddUserHandle

LAnnFreehand::GetUserHandle

LAnnFreehand::GetUserHandles

LAnnFreehand::ChangeUserHandle

LAnnFreehand::DeleteUserHandle

LAnnFreehand::EnumerateHandles

LAnnFreehand::EnumHandleCallBack

LAnnFreehand::GetFixed

LAnnFreehand::SetFixed

LAnnFreehand::PushFixedState

LAnnFreehand::PopFixedState

LAnnFreehand::IsFixedInRect

LAnnFreehand::GetForeColor

LAnnFreehand::GetLineStyle

LAnnFreehand::GetLineWidth

LAnnFreehand::GetPointCount

LAnnFreehand::GetPoints

LAnnFreehand::SetForeColor

LAnnFreehand::SetLineStyle

LAnnFreehand::SetLineWidth

LAnnFreehand::SetPoints


LAnnFreehand::Derived Classes

The following classes are derived directly from LAnnFreehand:

LAnnFreehandHotSpot


LAnnFreehandHotSpot

Description

The LAnnFreehandHotSpot class is derived from LAnnFreehand. This class contains the support for creating, and managing FreehandHotSpot annotation objects. You can use objects created from this class to set/get the different properties of a FreehandHotSpot annotation object..

For more information about the FreehandHotSpot annotation object, refer to FreehandHotSpot Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnFreehandHotSpot::Class Members

Constructors / Destructors

Creating Freehand Objects

Constructors / Destructors

LAnnFreehandHotSpot::LAnnFreehandHotSpot

LAnnFreehandHotSpot::~LAnnFreehandHotSpot

Creating FreehandHotSpot Objects

LAnnFreehandHotSpot::AddUserHandle

LAnnFreehandHotSpot::GetUserHandle

LAnnFreehandHotSpot::GetUserHandles

LAnnFreehandHotSpot::ChangeUserHandle

LAnnFreehandHotSpot::DeleteUserHandle

LAnnFreehandHotSpot::EnumerateHandles

LAnnFreehandHotSpot::EnumHandleCallBack

LAnnFreehandHotSpot::GetFixed

LAnnFreehandHotSpot::SetFixed

LAnnFreehandHotSpot::PushFixedState

LAnnFreehandHotSpot::PopFixedState

LAnnFreehandHotSpot::IsFixedInRect

LAnnFreehandHotSpot::Create

Return to LAnnFreeHandHotSpot


LAnnHilite

Description

The LAnnHilite class is derived from LAnnotation. This class contains the support for creating, and managing HILITE annotation object, you can use the objects created from this class to set/get the different properties of a HILITE annotation object.

For more information about the Highlight annotation object, refer to Highlight Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnHilite::Class Members

Member Functions

Return to LAnnHilite


LAnnHilite::Member Functions

Constructors / Destructors

Creating Hilite Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnHilite::LAnnHilite

LAnnHilite::~LAnnHilite

Creating Hilite Objects

LAnnHilite::Create

Getting/Setting Object Properties

LAnnHilite::AddUserHandle

LAnnHilite::GetUserHandle

LAnnHilite::GetUserHandles

LAnnHilite::ChangeUserHandle

LAnnHilite::DeleteUserHandle

LAnnHilite::EnumerateHandles

LAnnHilite::EnumHandleCallBack

LAnnHilite::GetRotateAngle

LAnnHilite::GetFixed

LAnnHilite::SetFixed

LAnnHilite::PushFixedState

LAnnHilite::PopFixedState

LAnnHilite::IsFixedInRect

LAnnHilite::GetBackColor

LAnnHilite::SetBackColor


LAnnHotSpot

Description

The LAnnHotSpot class is derived from LAnnotation. This class contains the support for creating, and managing HotSpot annotation objects. You can use objects created from this class to set/get the different properties of a HotSpot annotation object.

For more information about the HotSpot annotation object, refer to HotSpot Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnHotSpot::Class Members

Member Functions

Return to LAnnHotSpot


LAnnHotSpot::Member Functions

Constructors / Destructors

Creating Hilite Objects

Constructors / Destructors

LAnnHotSpot::LAnnHotSpot

LAnnHotSpot::~LAnnHotSpot

Creating HotSpot Objects

LAnnHotSpot::AddUserHandle

LAnnHotSpot::GetUserHandle

LAnnHotSpot::GetUserHandles

LAnnHotSpot::ChangeUserHandle

LAnnHotSpot::DeleteUserHandle

LAnnHotSpot::EnumerateHandles

LAnnHotSpot::EnumHandleCallBack

LAnnHotSpot::GetRotateAngle

LAnnHotSpot::GetFixed

LAnnHotSpot::SetFixed

LAnnHotSpot::PushFixedState

LAnnHotSpot::PopFixedState

LAnnHotSpot::IsFixedInRect

LAnnHotSpot::Create


LAnnLine

Description

The LAnnLine class is derived from LAnnotation. This class contains the support for creating and managing Line annotation objects. You can use objects created from this class to set/get the different properties of a Line annotation object..

For more information about the Line annotation object, refer to Line Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnLine::Class Members

Member Functions

Return to LAnnLine


LAnnLine::Member Functions

Constructors / Destructors

Creating Line Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnLine::LAnnLine

LAnnLine::~LAnnLine

Creating Line Objects

LAnnLine::AddUserHandle

LAnnLine::GetUserHandle

LAnnLine::GetUserHandles

LAnnLine::ChangeUserHandle

LAnnLine::DeleteUserHandle

LAnnLine::EnumerateHandles

LAnnLine::EnumHandleCallBack

LAnnLine::GetRotateAngle

LAnnLine::GetFixed

LAnnLine::SetFixed

LAnnLine::PushFixedState

LAnnLine::PopFixedState

LAnnLine::IsFixedInRect

LAnnLine::Create

Getting/Setting Object Properties

LAnnLine::GetForeColor

LAnnLine::SetForeColor

LAnnLine::GetLineStyle

LAnnLine::SetLineStyle

LAnnLine::GetLineWidth

LAnnLine::SetLineWidth


LAnnNote

Description

The LAnnNote class is derived from LAnnotation. This class contains the support for creating, and managing Note annotation objects. You can use objects created from this class to set/get the different properties of a Note annotation object.

For more information about the Note annotation object, refer to Note Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class, Derived Classes


LAnnNote::Class Members

Member Functions

Return to LAnnNote


LAnnNote::Member Functions

Constructors / Destructors

Creating Note Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnNote::LAnnNote

LAnnNote::~LAnnNote

Creating Note Objects

LAnnNote::Create

Getting/Setting Object Properties

LAnnNote::AddUserHandle

LAnnNote::GetUserHandle

LAnnNote::GetUserHandles

LAnnNote::ChangeUserHandle

LAnnNote::DeleteUserHandle

LAnnNote::EnumerateHandles

LAnnNote::EnumHandleCallBack

LAnnNote::GetRotateAngle

LAnnNote::GetTextAlign

LAnnNote::SetTextAlign

LAnnNote::SetTextRotate

LAnnNote::GetTextRotate

LAnnNote::GetFixed

LAnnNote::SetFixed

LAnnNote::PushFixedState

LAnnNote::PopFixedState

LAnnNote::IsFixedInRect

LAnnNote::GetBackColor

LAnnNote::GetFontName

LAnnNote::GetFontNameLen

LAnnNote::GetFontSize

LAnnNote::GetForeColor

LAnnNote::GetText

LAnnNote::GetTextLen

LAnnNote::IsFontBold

LAnnNote::IsFontItalic

LAnnNote::IsFontStrikeThrough

LAnnNote::IsFontUnderline

LAnnNote::SetBackColor

LAnnNote::SetFontBold

LAnnNote::SetFontItalic

LAnnNote::SetFontName

LAnnNote::SetFontSize

LAnnNote::SetFontStrikeThrough

LAnnNote::SetFontUnderline

LAnnNote::SetForeColor

LAnnNote::SetText


LAnnNote::Derived Classes

The following classes are derived directly from LAnnNote:

LAnnPushPin


LAnnotation

Description

The LAnnotation class is derived from the LBase class. This class contains base functionality for creating, and managing LEAD annotation objects. This class provides the main functionality for other derived annotation classes like creation, drawing, scaling, realizing, copying, and setting/getting properties that are common to all annotation objects. LAnnotation also has functions for copying annotations to and from the clipboard.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LAnnotation::Class Members

Member Functions

Return to LAnnotation


LAnnotation::Member Functions

Constructors / Destructors

Creating and Destroying Annotation Objects

Copying Annotation Objects

Working with the Clipboard

Displaying Annotation Objects

Printing Annotation Objects

Manipulating Annotation Objects

Managing Annotation Objects Within a Container

Getting/Setting Object Properties

Locking/Unlocking Annotation Objects

Realizing Annotation Objects to a Bitmap

Use the LAnnotation::SetOptions function and the LAnnotation::GetOptions 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 Multi-select

Annotation Cursors

ESC to Cancel

Calibrate Ruler Feature

Dot Dash Lines

Text Annotation Options

For more information about these features, refer to New Annotation Features of Version 14.5.

If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function.

Use the LAnnotation::SetFillMode and LAnnotation::GetFillMode functions to manage the fill mode used by annotation objects. The LAnnotation::SetFillModeExt and the LAnnotation::GetFillModeExt 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 LAnnotation::SetOptions function.

Constructors / Destructors

LAnnotation::LAnnotation

LAnnotation::~LAnnotation

Creating and Destroying Annotation Objects

LAnnotation::IsCreated

LAnnotation::IsValid

LAnnotation::GetHandle

LAnnotation::SetHandle

LAnnotation::CreateAnnObject

LAnnotation::Destroy

Copying Annotation Objects

LAnnotation::Copy

LAnnotation::operator=

Working with the Clipboard

LAnnotation::IsClipboardReady

LAnnotation::CopyToClipboard

LAnnotation::CutToClipboard

Displaying Annotation Objects

LAnnotation::CalibrateRuler

LAnnotation::Draw

LAnnotation::GetAutoSnapCursor

LAnnotation::GetBoundingRect

LAnnotation::GetFillModeExt

LAnnotation::GetOffsetX

LAnnotation::GetOffsetY

LAnnotation::GetOptions

LAnnotation::GetRect

LAnnotation::GetRotateOptions

LAnnotation::GetScalarX

LAnnotation::GetScalarY

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillModeExt

LAnnotation::SetOffsetX

LAnnotation::SetOffsetY

LAnnotation::SetOptions

LAnnotation::SetRect

LAnnotation::SetRotateOptions

LAnnotation::SetScalarX

LAnnotation::SetScalarY

LAnnotation::SetTextOptions

LAnnotation::TextEdit

Printing Annotation Objects

LAnnotation::Print

Manipulating Annotation Objects

LAnnotation::Flip

LAnnotation::Move

LAnnotation::Resize

LAnnotation::Reverse

LAnnotation::Rotate

Managing Annotation Objects Within a Container

LAnnotation::GetActiveState

LAnnotation::GetContainer

LAnnotation::GetContainer

LAnnotation::IsSelected

LAnnotation::GetTopContainer

LAnnotation::GetUserMode

LAnnotation::GetWnd

LAnnotation::Remove

LAnnotation::SendToBack

LAnnotation::BringToFront

LAnnotation::SetActiveState

LAnnotation::SetSelected

LAnnotation::SetVisible

Getting/Setting Object Properties

LAnnotation::GetNameOptions

LAnnotation::SetNameOptions

LAnnotation::SetRestrictToContainer

LAnnotation::GetRestrictToContainer

LAnnotation::Define2

LAnnotation::SetUserData

LAnnotation::GetUserData

LAnnotation::GetAutoBackColor

LAnnotation::SetAutoBackColor

LAnnotation::AdjustPoint

LAnnotation::GetHyperlink

LAnnotation::GetHyperlinkLen

LAnnotation::GetROP2

LAnnotation::GetTag

LAnnotation::GetType

LAnnotation::IsVisible

LAnnotation::SetHyperlink

LAnnotation::SetROP2

LAnnotation::SetTag

LAnnotation::CalibrateRuler

LAnnotation::GetAutoSnapCursor

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetRotateOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetRotateOptions

LAnnotation::SetTextOptions

LAnnotation::TextEdit

Locking/Unlocking Annotation Objects

LAnnotation::IsLocked

LAnnotation::Lock

LAnnotation::ShowLockedIcon

LAnnotation::Unlock

Realizing Annotation Objects to a Bitmap

LAnnotation::Realize


LAnnotation::Derived Classes

The following classes are derived directly from LAnnotation:

LAnnAudioClip | LAnnAutomation
LAnnButton | LAnnContainer
LAnnEllipse | LAnnFreeHand
LAnnHilite | LAnnHotSpot
LAnnLine | LAnnNote
LAnnPointer | LAnnPolygon
LAnnPolyline | LAnnRectangle
LAnnRedact | LAnnRuler
LAnnStamp | LAnnText
LAnnPoint | LAnnVideo


LAnnotationWindow

Description

The LAnnotationWindow class is derived from the LBitmapWindow class. You can consider this class as a full windowed control that is capable of displaying bitmaps with annotations. LAnnotationWindow extends LBitmapWindow by adding functionality for displaying Annotations through an automated interface with an easy to use Annotation toolbar.

Annotations, which are based on vectored drawing functions, are associated with a bitmap only as an overlay of the displayed image. Ordinarily, your application code is responsible for maintaining the relationships between images and annotations.

The LAnnotationWindow class implements annotations by turning on automated features.

Using command notification messages, the LAnnotationWindow object can be used in a manner similar to standard Windows controls for dialogs. By overriding the virtual functions provided by LAnnotationWindow and the base class LBitmapWindow, you can use LAnnotationWindow objects as a regular window, which handles most messages for you. For more information on the two ways in which LAnnotationWindow objects can be used, refer to LAnnotationWindow:Window vs Control.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTANN
LTDIS
LTDLGKRN
LTDLGIMG
LTDLGEFX
LTDLGWEB
LTDLGFILE
LTDLGIMGEFX
LTDLGCLR
LTDLGIMGDOC
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LAnnotationWindow::Class Members

Member Functions

Return to LAnnotationWindow


LAnnotationWindow::Member Functions

Constructors / Destructors

Creating the Annotation Window

Loading/Saving Annotations

Printing Annotations

Automation, Container and Toolbar Objects

Working with the Clipboard

Overridables

Constructors / Destructors

LAnnotationWindow::LAnnotationWindow

LAnnotationWindow::~LAnnotationWindow

Creating the Annotation Window

LAnnotationWindow::CreateWnd

LAnnotationWindow::SetWndHandle

Loading/Saving Annotations

LAnnotationWindow::AnnLoad

LAnnotationWindow::AnnSave

Printing Annotations

LAnnotationWindow::AnnPrint

Automation, Container and Toolbar Objects

LAnnotationWindow::GetAutomationObject

LAnnotationWindow::GetContainerObject

LAnnotationWindow::GetToolBar

Working with the Clipboard

LAnnotationWindow::CopyFromClipboard

LAnnotationWindow::CopyToClipboard

Overridables

LAnnotationWindow::EndChanging

LAnnotationWindow::MsgProcCallBack

LAnnotationWindow::OnDraw

LAnnotationWindow::OnZoom

LAnnotationWindow::PanWndcallBack

LAnnotationWindow::StartChanging


LAnnPoint

Description

The LAnnPoint class is derived from LAnnotation. This class contains the support for creating, and managing Point annotation objects. You can use objects created from this class to set/get the different properties of a Point annotation object.

For more information about the Point annotation object, refer to Point Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnPoint::Class Members

Constructors / Destructors

Creating Stamp Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnPoint::LAnnPoint

LAnnPoint::~LAnnPoint

Creating Stamp Objects

LAnnPoint::Create

Getting/Setting Object Properties

LAnnPoint::SetPredefinedBitmap

LAnnPoint::GetPredefinedBitmap

LAnnPoint::GetPointOptions

LAnnPoint::SetPointOptions

LAnnPoint::AddUserHandle

LAnnPoint::GetUserHandle

LAnnPoint::GetUserHandles

LAnnPoint::ChangeUserHandle

LAnnPoint::DeleteUserHandle

LAnnPoint::EnumerateHandles

LAnnPoint::EnumHandleCallBack

LAnnPoint::GetFixed

LAnnPoint::SetFixed

LAnnPoint::PushFixedState

LAnnPoint::PopFixedState

LAnnPoint::IsFixedInRect

LAnnPoint::GetBitmap

LAnnPoint::GetPoints

LAnnPoint::GetTransparent

LAnnPoint::GetTransparentColor

LAnnPoint::SetBitmap

LAnnPoint::SetPoints

LAnnPoint::SetTransparent

LAnnPoint::SetTransparentColor

Return to LAnnPoint


LAnnPointer

Description

The LAnnPointer class is derived from LAnnotation. This class contains the support for creating, and managing Pointer annotation objects. You can use objects created from this class to set/get the different properties of a Pointer annotation object.

For more information about the Pointer annotation object, refer to Pointer Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnPointer::Class Members

Member Functions

Return to LAnnPointer


LAnnPointer::Member Functions

Constructors / Destructors

Creating Pointer Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnPointer::LAnnPointer

LAnnPointer::~LAnnPointer

Creating Pointer Objects

LAnnPointer::Create

Getting/Setting Object Properties

LAnnPointer::AddUserHandle

LAnnPointer::GetUserHandle

LAnnPointer::GetUserHandles

LAnnPointer::ChangeUserHandle

LAnnPointer::DeleteUserHandle

LAnnPointer::EnumerateHandles

LAnnPointer::EnumHandleCallBack

LAnnPointer::GetRotateAngle

LAnnPointer::GetFixed

LAnnPointer::SetFixed

LAnnPointer::PushFixedState

LAnnPointer::PopFixedState

LAnnPointer::IsFixedInRect

LAnnPointer::GetForeColor

LAnnPointer::SetForeColor

LAnnPointer::GetLineStyle

LAnnPointer::SetLineStyle

LAnnPointer::GetLineWidth

LAnnPointer::SetLineWidth


LAnnPolygon

Description

The LAnnPolygon class is derived from LAnnotation. This class contains the support for creating, and managing Polygon annotation objects. You can use objects created from this class to set or get the different properties of a Polygon annotation object.

For more information about the Polygon annotation object, refer to Polygon Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnPolygon::Class Members

Member Functions

Return to LAnnPolygon


LAnnPolygon::Member Functions

Constructors / Destructors

Creating Polygon Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnPolygon::LAnnPolygon

LAnnPolygon::~LAnnPolygon

Creating Polygon Objects

LAnnPolygon::Create

Getting/Setting Object Properties

LAnnPolygon::AddUserHandle

LAnnPolygon::GetUserHandle

LAnnPolygon::GetUserHandles

LAnnPolygon::ChangeUserHandle

LAnnPolygon::DeleteUserHandle

LAnnPolygon::EnumerateHandles

LAnnPolygon::EnumHandleCallBack

LAnnPolygon::GetFixed

LAnnPolygon::SetFixed

LAnnPolygon::PushFixedState

LAnnPolygon::PopFixedState

LAnnPolygon::IsFixedInRect

LAnnPolygon::GetForeColor

LAnnPolygon::SetForeColor

LAnnPolygon::GetBackColor

LAnnPolygon::SetBackColor

LAnnPolygon::GetPolyFillMode

LAnnPolygon::SetPolyFillMode

LAnnPolygon::GetFillMode

LAnnPolygon::SetFillMode

LAnnPolygon::GetFillPattern

LAnnPolygon::SetFillPattern

LAnnPolygon::GetLineStyle

LAnnPolygon::SetLineStyle

LAnnPolygon::GetLineWidth

LAnnPolygon::SetLineWidth

LAnnPolygon::Define

LAnnPolygon::GetPointCount

LAnnPolygon::GetPoints

LAnnPolygon::SetPoints


LAnnPolyline

Description

The LAnnPolyline class is derived from LAnnotation. This class contains the support for creating, and managing Polyline annotation objects. You can use objects created from this class to set/get the different properties of a Polyline annotation object.

For more information about the Polyline annotation object, refer to Polyline Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnPolyline::Class Members

Member Functions

Return to LAnnPolyline


LAnnPolyline::Member Functions

Constructors / Destructors

Creating Polyline Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnPolyline::LAnnPolyline

LAnnPolyline::~LAnnPolyline

Creating Polyline Objects

LAnnPolyline::Create

Getting/Setting Object Properties

LAnnPolyline::AddUserHandle

LAnnPolyline::GetUserHandle

LAnnPolyline::GetUserHandles

LAnnPolyline::ChangeUserHandle

LAnnPolyline::DeleteUserHandle

LAnnPolyline::EnumerateHandles

LAnnPolyline::EnumHandleCallBack

LAnnPolyline::GetFixed

LAnnPolyline::SetFixed

LAnnPolyline::PushFixedState

LAnnPolyline::PopFixedState

LAnnPolyline::IsFixedInRect

LAnnPolyline::GetForeColor

LAnnPolyline::SetForeColor

LAnnPolyline::GetLineStyle

LAnnPolyline::SetLineStyle

LAnnPolyline::GetLineWidth

LAnnPolyline::SetLineWidth

LAnnPolyline::Define

LAnnPolyline::GetPointCount

LAnnPolyline::GetPoints

LAnnPolyline::SetPoints


LAnnPolyRuler

Description

The LAnnPolyRuler class is derived from LAnnotation. This class contains the support for creating and managing Poly Ruler annotation objects. You can use objects created from this class to set/get the different properties of a Poly Ruler annotation object.

For more information about the Poly Ruler annotation object, refer to Polyruler Annotation Object.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class

New Annotation Features of Version 14.5


LAnnPolyRuler::Class Members

Member Functions

Return to LAnnPolyRuler


LAnnPolyRuler::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnPolyRuler::LAnnPolyRuler

LAnnPolyRuler::~LAnnPolyRuler

Miscellaneous

LAnnPolyRuler::Create

LAnnPolyRuler::AddUserHandle

LAnnPolyRuler::GetUserHandle

LAnnPolyRuler::GetUserHandles

LAnnPolyRuler::ChangeUserHandle

LAnnPolyRuler::DeleteUserHandle

LAnnPolyRuler::EnumerateHandles

LAnnPolyRuler::EnumHandleCallBack

LAnnPolyRuler::GetFixed

LAnnPolyRuler::SetFixed

LAnnPolyRuler::PushFixedState

LAnnPolyRuler::PopFixedState

LAnnPolyRuler::IsFixedInRect

LAnnPolyRuler::GetPointCount

LAnnPolyRuler::GetPoints

LAnnPolyRuler::SetPoints

LAnnPolyRuler::GetLineStyle

LAnnPolyRuler::GetLineWidth

LAnnPolyRuler::SetLineStyle

LAnnPolyRuler::SetLineWidth

LAnnPolyRuler::SetNodes

LAnnPolyRuler::GetNodes

LAnnPolyRuler::GetTicMarkLength

LAnnPolyRuler::SetTicMarkLength

LAnnPolyRuler::GetDistance2

LAnnPolyRuler::GetDistance

LAnnPolyRuler::GetUnitLen


LAnnProtractor

Description

The LAnnProtractor class is derived from LAnnRuler. This class contains the support for creating and managing Protractor annotation objects. You can use objects created from this class to set/get the different properties of a Protractor annotation object.

For more information about the Protractor annotation object, refer to Protractor Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class

New Annotation Features of Version 14.5


LAnnProtractor Class Members

Constructors / Destructors

LAnnProtractor::LAnnProtractor

LAnnProtractor::~LAnnProtractor

Creating Protractor Objects

LAnnProtractor::Create

Getting/Setting Options

LAnnProtractor::GetProtractorOptions

LAnnProtractor::SetProtractorOptions

Getting/Setting Protractor Properties

LAnnProtractor::AddUserHandle

LAnnProtractor::GetUserHandle

LAnnProtractor::GetUserHandles

LAnnProtractor::ChangeUserHandle

LAnnProtractor::DeleteUserHandle

LAnnProtractor::EnumerateHandles

LAnnProtractor::EnumHandleCallBack

LAnnProtractor::GetFixed

LAnnProtractor::SetFixed

LAnnProtractor::PushFixedState

LAnnProtractor::PopFixedState

LAnnProtractor::IsFixedInRect

LAnnProtractor::GetDistance2

LAnnProtractor::GetAngle

LAnnProtractor::GetDistance

LAnnProtractor::GetPoints

LAnnProtractor::GetPointCount

LAnnProtractor::SetPoints

Return to LAnnProtractor


LAnnPushPin

Description

The LAnnPushPin class is derived from LAnnNote. This class contains the support for creating, and managing PushPin annotation objects. You can use objects created from this class to set/get the different properties of a PushPin annotation object.

For more information about the PushPin annotation object, refer to PushPin Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnPushPin Class Members

Constructors / Destructors

LAnnPushPin::LAnnPushPin

LAnnPushPin::~LAnnPushPin

Creating PushPin Objects

LAnnPushPin::Create

Getting/Setting Bitmaps

LAnnPushPin::AddUserHandle

LAnnPushPin::GetUserHandle

LAnnPushPin::GetUserHandles

LAnnPushPin::ChangeUserHandle

LAnnPushPin::DeleteUserHandle

LAnnPushPin::EnumerateHandles

LAnnPushPin::EnumHandleCallBack

LAnnPushPin::GetRotateAngle

LAnnPushPin::GetFixed

LAnnPushPin::SetFixed

LAnnPushPin::PushFixedState

LAnnPushPin::PopFixedState

LAnnPushPin::IsFixedInRect

LAnnPushPin::GetBitmap

LAnnPushPin::GetSecondaryBitmap

LAnnPushPin::SetBitmap

LAnnPushPin::SetSecondaryBitmap

Return to LAnnPushPin


LAnnRectangle

Description

The LAnnRectangle class is derived from LAnnotation class. This class contains the support for creating, and managing Rectangle annotation objects. You can use the objects created from this class to set/get the different properties of a Rectangle annotation object.

For more information about the Rectangle annotation object, refer to Rectangle Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnRectangle::Class Members

Member Functions

Return to LAnnRectangle


LAnnRectangle::Member Functions

Constructors / Destructors

Creating Rectangle Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnRectangle::LAnnRectangle

LAnnRectangle::~LAnnRectangle

Creating Rectangle Objects

LAnnRectangle::Create

Getting/Setting Object Properties

LAnnRectangle::AddUserHandle

LAnnRectangle::GetUserHandle

LAnnRectangle::GetUserHandles

LAnnRectangle::ChangeUserHandle

LAnnRectangle::DeleteUserHandle

LAnnRectangle::EnumerateHandles

LAnnRectangle::EnumHandleCallBack

LAnnRectangle::GetRotateAngle

LAnnRectangle::GetFixed

LAnnRectangle::SetFixed

LAnnRectangle::PushFixedState

LAnnRectangle::PopFixedState

LAnnRectangle::IsFixedInRect

LAnnRectangle::GetForeColor

LAnnRectangle::SetForeColor

LAnnRectangle::GetBackColor

LAnnRectangle::SetBackColor

LAnnRectangle::GetFillMode

LAnnRectangle::SetFillMode

LAnnRectangle::GetFillPattern

LAnnRectangle::SetFillPattern

LAnnRectangle::GetLineStyle

LAnnRectangle::SetLineStyle

LAnnRectangle::GetLineWidth

LAnnRectangle::SetLineWidth


LAnnRedact

Description

The LAnnRedact class is derived from LAnnotation. This class contains the support for creating, and managing Redact annotation objects. You can use objects created from this class to set/get the different properties of a Redact annotation object.

For more information about the Redaction annotation object, refer to Redaction Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnRedact::Class Members

Member Functions

Return to LAnnRedact


LAnnRedact::Member Functions

Constructors / Destructors

Creating Redact Objects

Getting/Setting Object Properties

Restoring a Bitmap from a Redact Object

Constructors / Destructors

LAnnRedact::LAnnRedact

LAnnRedact::~LAnnRedact

Creating Redact Objects

LAnnRedact::Create

Getting/Setting Object Properties

LAnnRedact::AddUserHandle

LAnnRedact::GetUserHandle

LAnnRedact::GetUserHandles

LAnnRedact::ChangeUserHandle

LAnnRedact::DeleteUserHandle

LAnnRedact::EnumerateHandles

LAnnRedact::EnumHandleCallBack

LAnnRedact::GetRotateAngle

LAnnRedact::GetBackColor

LAnnRedact::SetBackColor

Restoring a Bitmap from a Redact Object

LAnnRedact::Unrealize


LAnnRTF

Description

The LAnnRTF class is derived from LAnnotation. This class contains the support for creating and managing Rich Text annotation objects. You can use objects created from this class to set/get the different properties of a Rich Text annotation object.

For more information about the Rich Text annotation object, refer to Rich Text Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LAnnRTF::Class Members

Member Functions

Return to LAnnRTF


LAnnRTF::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnRTF::LAnnRTF

LAnnRTF::~LAnnRTF

Miscellaneous

LAnnRTF::Create

LAnnRTF::AddUserHandle

LAnnRTF::GetUserHandle

LAnnRTF::GetUserHandles

LAnnRTF::ChangeUserHandle

LAnnRTF::DeleteUserHandle

LAnnRTF::EnumerateHandles

LAnnRTF::EnumHandleCallBack

LAnnRTF::GetFixed

LAnnRTF::SetFixed

LAnnRTF::PushFixedState

LAnnRTF::PopFixedState

LAnnRTF::IsFixedInRect

LAnnRTF::SetTextRTF

LAnnRTF::GetTextRTF

LAnnRTF::GetText

LAnnRTF::GetTextLen

LAnnRTF::SetText


LAnnRuler

Description

The LAnnRuler class is derived from LAnnotation. This class contains the support for creating, and managing Ruler annotation objects. You can use objects created from this class to set/get the different properties of a Ruler annotation object.

For more information about the Ruler annotation object, refer to Ruler Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class, Derived Classes

New Annotation Features of Version 14.5


LAnnRuler::Class Members

Member Functions

Return to LAnnRuler


LAnnRuler::Member Functions

Constructors / Destructors

Creating Ruler Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnRuler::LAnnRuler

LAnnRuler::~LAnnRuler

Creating Ruler Objects

LAnnRuler::Create

Getting/Setting Object Properties

LAnnRuler::AddUserHandle

LAnnRuler::GetUserHandle

LAnnRuler::GetUserHandles

LAnnRuler::ChangeUserHandle

LAnnRuler::DeleteUserHandle

LAnnRuler::EnumerateHandles

LAnnRuler::EnumHandleCallBack

LAnnRuler::GetRotateAngle

LAnnRuler::GetFixed

LAnnRuler::SetFixed

LAnnRuler::PushFixedState

LAnnRuler::PopFixedState

LAnnRuler::IsFixedInRect

LAnnRuler::GetTicMarkLength

LAnnRuler::SetTicMarkLength

LAnnRuler::GetDistance2

LAnnRuler::GetDistance

LAnnRuler::GetFontName

LAnnRuler::GetFontNameLen

LAnnRuler::GetFontSize

LAnnRuler::GetForeColor

LAnnRuler::GetGaugeLength

LAnnRuler::GetLineStyle

LAnnRuler::GetLineWidth

LAnnRuler::GetText

LAnnRuler::GetTextLen

LAnnRuler::GetUnit

LAnnRuler::GetUnitLen

LAnnRuler::IsFontBold

LAnnRuler::IsFontItalic

LAnnRuler::IsFontStrikeThrough

LAnnRuler::IsFontUnderline

LAnnRuler::SetFontBold

LAnnRuler::SetFontItalic

LAnnRuler::SetFontName

LAnnRuler::SetFontSize

LAnnRuler::SetFontStrikeThrough

LAnnRuler::SetFontUnderline

LAnnRuler::SetForeColor

LAnnRuler::SetGaugeLength

LAnnRuler::SetLineStyle

LAnnRuler::SetLineWidth

LAnnRuler::SetUnit


LAnnRuler::Derived Classes

The following classes are derived directly from LAnnRuler:

LAnnCrossProduct

LAnnProtractor


LAnnStamp

Description

The LAnnStamp class is derived from LAnnotation. This class contains the support for creating, and managing Stamp annotation objects. You can use objects created from this class to set/get the different properties of a Stamp annotation object.

For more information about the Stamp annotation object, refer to Stamp Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnStamp::Class Members

Member Functions

Return to LAnnStamp


LAnnStamp::Member Functions

Constructors / Destructors

Creating Stamp Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnStamp::LAnnStamp

LAnnStamp::~LAnnStamp

Creating Stamp Objects

LAnnStamp::Create

Getting/Setting Object Properties

LAnnStamp::GetSecondaryMetafile

LAnnStamp::AddUserHandle

LAnnStamp::GetUserHandle

LAnnStamp::GetUserHandles

LAnnStamp::ChangeUserHandle

LAnnStamp::DeleteUserHandle

LAnnStamp::EnumerateHandles

LAnnStamp::EnumHandleCallBack

LAnnStamp::GetRotateAngle

LAnnStamp::GetFixed

LAnnStamp::SetFixed

LAnnStamp::PushFixedState

LAnnStamp::PopFixedState

LAnnStamp::IsFixedInRect

LAnnStamp::GetBackColor

LAnnStamp::GetBitmap

LAnnStamp::GetBitmap

LAnnStamp::GetFillMode

LAnnStamp::GetFillPattern

LAnnStamp::GetFontName

LAnnStamp::GetFontNameLen

LAnnStamp::GetFontSize

LAnnStamp::GetForeColor

LAnnStamp::GetLineStyle

LAnnStamp::GetLineWidth

LAnnStamp::GetText

LAnnStamp::GetTextLen

LAnnStamp::GetTransparent

LAnnStamp::IsFontBold

LAnnStamp::IsFontItalic

LAnnStamp::IsFontStrikeThrough

LAnnStamp::IsFontUnderline

LAnnStamp::SetBackColor

LAnnStamp::SetBitmap

LAnnStamp::GetBitmap

LAnnStamp::SetFillMode

LAnnStamp::SetFillPattern

LAnnStamp::SetFontBold

LAnnStamp::SetFontItalic

LAnnStamp::SetFontName

LAnnStamp::SetFontSize

LAnnStamp::SetFontStrikeThrough

LAnnStamp::SetFontUnderline

LAnnStamp::SetForeColor

LAnnStamp::SetLineStyle

LAnnStamp::SetLineWidth

LAnnStamp::SetText

LAnnStamp::SetTransparent


LAnnText

Description

The LAnnText class is derived from LAnnotation. This class contains the support for creating and managing Text annotation objects. You can use objects created from this class to set/get the different properties of a Text annotation object.

For more information about the Text annotation object, refer to Text Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnText::Class Members

Member Functions

Return to LAnnText


LAnnText::Member Functions

Constructors / Destructors

Creating Text Objects

Getting/Setting Object Properties

Constructors / Destructors

LAnnText::LAnnText

LAnnText::~LAnnText

Creating Text Objects

LAnnText::Create

Getting/Setting Object Properties

LAnnText::AddUserHandle

LAnnText::GetUserHandle

LAnnText::GetUserHandles

LAnnText::ChangeUserHandle

LAnnText::DeleteUserHandle

LAnnText::EnumerateHandles

LAnnText::EnumHandleCallBack

LAnnText::GetRotateAngle

LAnnText::GetTextAlign

LAnnText::SetTextAlign

LAnnText::GetFixed

LAnnText::SetFixed

LAnnText::PushFixedState

LAnnText::PopFixedState

LAnnText::IsFixedInRect

LAnnText::GetBackColor

LAnnText::GetFillMode

LAnnText::GetFontName

LAnnText::GetFontNameLen

LAnnText::GetFontSize

LAnnText::GetForeColor

LAnnText::GetText

LAnnText::GetTextLen

LAnnText::IsFontBold

LAnnText::IsFontItalic

LAnnText::IsFontStrikeThrough

LAnnText::IsFontUnderline

LAnnText::SetBackColor

LAnnText::SetFillMode

LAnnText::SetFontBold

LAnnText::SetFontItalic

LAnnText::SetFontName

LAnnText::SetFontSize

LAnnText::SetFontStrikeThrough

LAnnText::SetFontUnderline

LAnnText::SetForeColor

LAnnText::SetText


LAnnTextPointer

Description

The LAnnTextPointer class is derived from LAnnotation. This class contains the support for creating and managing Text Pointer annotation objects. You can use objects created from this class to set/get the different properties of a Text Pointer annotation object.

For more information about the Text Pointer annotation object, refer to Text Pointer Annotation Object

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LAnnTextPointer::Class Members

Member Functions

Return to LAnnTextPointer


LAnnTextPointer::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LAnnTextPointer::LAnnTextPointer

LAnnTextPointer::~LAnnTextPointer

Miscellaneous

LAnnTextPointer::Create

LAnnTextPointer::AddUserHandle

LAnnTextPointer::GetUserHandle

LAnnTextPointer::GetUserHandles

LAnnTextPointer::ChangeUserHandle

LAnnTextPointer::DeleteUserHandle

LAnnTextPointer::EnumerateHandles

LAnnTextPointer::EnumHandleCallBack

LAnnTextPointer::GetFixed

LAnnTextPointer::SetFixed

LAnnTextPointer::PushFixedState

LAnnTextPointer::PopFixedState

LAnnTextPointer::IsFixedInRect

LAnnTextPointer::GetRotateAngle

LAnnTextPointer::GetTextAlign

LAnnTextPointer::SetTextAlign

LAnnTextPointer::SetTextRotate

LAnnTextPointer::GetTextRotate

LAnnTextPointer::SetTextPointerFixed

LAnnTextPointer::GetTextPointerFixed


LAnnToolBar

Description

The LAnnToolBar class is derived from the LBase class. This class contains the support for creating, and managing the LEAD annotation toolbar. This class provides functions for checking/unchecking, showing/hiding, and creating annotation toolbars.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LAnnToolBar::Class Members

Member Functions

Return to LAnnToolBar


LAnnToolBar::Member Functions

Constructors / Destructors

Creating and Destroying the Toolbar

Managing the Toolbar

Constructors / Destructors

L AnnToolBar::LAnnToolBar

LAnnToolBar::~LAnnToolBar

Creating and Destroying the Toolbar

LAnnToolBar::IsCreated

LAnnToolBar::Create

LAnnToolBar::Destroy

Managing the Toolbar

LAnnToolBar::AddUserHandle

LAnnToolBar::GetUserHandle

LAnnToolBar::GetUserHandles

LAnnToolBar::ChangeUserHandle

LAnnToolBar::DeleteUserHandle

LAnnToolBar::EnumerateHandles

LAnnToolBar::EnumHandleCallBack

LAnnToolBar::GetWndHandle

LAnnToolBar::SetButtonVisible

LAnnToolBar::IsButtonVisible

LAnnToolBar::GetToolChecked

LAnnToolBar::SetToolChecked

LAnnToolBar::SetToolBarButtons

LAnnToolBar::GetToolBarButtons

LAnnToolBar::FreeToolBarButtons

LAnnToolBar::GetToolBarInfo

LAnnToolBar::SetToolBarColumns

LAnnToolBar::SetToolBarRows


LAnnVideo

This class is not supported in any LEADTOOLS Version 13 toolkits.

Description

The LAnnVideo class is derived from LAnnotation. This class contains the support for playing, and capturing multimedia files. You can use objects created from this class to set/get the different properties of a Video annotation object.

For more information about the Video annotation object, refer to Video Annotation Object

For playing the video, you must have DirectX installed.

To capture an AVI file from a video card, LTCAP14n.dll is required.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTANN
LTMM

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

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LAnnVideo Class Members

Constructors / Destructors

LAnnVideo::LAnnVideo

LAnnVideo::~LAnnVideo

Creating Video Objects

LAnnVideo::Create

Getting/Setting Text

LAnnVideo::AddUserHandle

LAnnVideo::GetUserHandle

LAnnVideo::GetUserHandles

LAnnVideo::ChangeUserHandle

LAnnVideo::DeleteUserHandle

LAnnVideo::EnumerateHandles

LAnnVideo::EnumHandleCallBack

LAnnVideo::GetRotateAngle

LAnnVideo::GetFixed

LAnnVideo::SetFixed

LAnnVideo::PushFixedState

LAnnVideo::PopFixedState

LAnnVideo::IsFixedInRect

LAnnVideo::GetText

LAnnVideo::GetTextLen

LAnnVideo::SetText

Return to LAnnVideo


LBase

Description

The LBase class is the root (base) class for the LEADTOOLS Class Library. All other classes in the LEADTOOLS Class Library derive from LBase. This class provides functionality for recording and displaying errors that occur in the LEADTOOLS Class Library functions, loading and unloading of the LEADTOOLS library DLLs at run-time, and getting version information about the LEADTOOLS library DLLs. The LBase class also provides functionality for processing status callbacks for other LEADTOOLS Class Library functions that support the status callback function.

You may find it useful to call the static member functions of this class directly, as (ClassName::Function), without declaring an object. For example, the following is valid, and will compile:

nMode = LBitmapSettings::GetDisplayMode();

This returns the current global setting for the paint contrast.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Derived Classes


LBase::Class Members

Member Functions

Return to LBase


LBase::Member Functions

Constructors / Destructors

Status CallBack Functions

Error Functions

Loading / Unloading Library DLL Functions

Overridables

Version Information

Compressing and Decompressing ABIC

Constructors / Destructors

LBase::LBase

LBase::~LBase

Status CallBack Functions

LBase::EnableCallBack

LBase::EnableOverlayCallBack

LBase::EnableStatusCallBack

LBase::IsCallBackEnabled

LBase::IsOverlayCallBackEnabled

LBase::IsStatusCallBackEnabled

Error Functions

LBase::DisplayError

LBase::IsAutoErrorDisplayEnabled

LBase::EnableAutoErrorDisplay

LBase::GetErrorFromList

LBase::SetErrorListDepth

LBase::GetErrorListDepth

LBase::ClearErrorList

LBase::GetErrorsNumber

LBase::DisplayErrorList

LBase::DisplayErrorFromList

LBase::GetErrorString

LBase::SetErrorString

LBase::RecordError

Loading/Unloading Library DLL Functions

LBase::LoadLibraries

LBase::UnloadLibraries

LBase::GetLoadedLibraries

Overridables

LBase::OverlayCallBack

LBase::StatusCallBack

Version Information Functions

LBase::VersionInfo

Compressing and Decompressing ABIC

LBase::EncodeABIC

LBase::DecodeABIC


LBase::Derived Classes

The following classes are derived directly from the LBase class:

LAnnotation | LAnnToolBar
LBaseFile | LBitmapBase
LBitmapList | LBitmapRgn
LBuffer | LChange
LDraw | LPlayBack
LPrint | LScan
LScreenCapture | LSettings
LVectorBase | LVectorDialog


LBaseFile

Description

The LBaseFile class is derived from LBase. This class is the base class for LEADTOOLS Class Library input/output operations. It contains basic operations for file I/O. With this class, you can override the default functions that LEADTOOLS uses for opening, closing, reading from, writing to, and seeking in files. This class forms the base for the LFile and LMemoryFile classes.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LBaseFile::Class Members

Data Members

Member Functions

Return to LBaseFile


LBaseFile::Data Members

LBaseFile::m_pBitmap


LBaseFile::Member Functions

Constructors / Destructors

Getting / Setting Information

Redirecting Input/Output

Overridables

Constructors / Destructors

LBaseFile::~LBaseFile

LBaseFile::LBaseFile

Getting / Setting Information

LBaseFile::EnableLoadInfoCallBack

LBaseFile::EnableRedirectIO

LBaseFile::IsLoadInfoCallBackEnabled

LBaseFile::SetBitmap

Redirecting Input/Output

LBaseFile::IsRedirectIOEnabled

LBaseFile::GetRedirectIOFlags

LBaseFile::SetRedirectIOFlags

Overridables

LBaseFile::LoadInfoCallBack

LBaseFile::RedirectCloseCallBack

LBaseFile::RedirectOpenCallBack

LBaseFile::RedirectReadCallBack

LBaseFile::RedirectSeekCallBack

LBaseFile::RedirectWriteCallBack


LBaseFile::Derived Classes

The following classes are derived directly from LBaseFile:

LFile | LMemoryFile
LVectorFile | LVectorMemoryFile


LBitmap

Description

The LBitmap class is derived from LBitmapBase, and extends it by adding functionality for more advanced image processing. This functionality includes: Halftone, Sharpen, Picturize, GammaCorrect, Deskew, Despeckle, WindowLevel, Color Separation and Color Merge, Image Filters (such as Average, Median, Mosaic), and color processing (such as Invert, Hue, Contrast, Inensity, and Saturation).

When calling some functions of the LBitmapBase LEADTOOLS Class Library classes, the bitmap data is changed. To be notified of these changes, you can override the LBitmapBase::StartChanging and LBitmapBase::EndChanging functions. For more information, refer to Bitmap Change Notifications and Notification Categories.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTDIS
LTFIL
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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LBitmap::Class Members

Member Functions

Return to LBitmap


LBitmap::Member Functions

Constructors / Destructors

Color Expansion and Reduction

Filtering Images

Geometric Transformations

Modifying Intensity Values

Operators

Overridables

Window leveling

Cleaning-up and Callbacks

Kaufmann region

Constructors / Destructors

LBitmap::LBitmap

LBitmap::~LBitmap

Color Expansion and Reduction

LBitmap::HalfTone

Filtering Images

LBitmap::AddNoise

LBitmap::AntiAlias

LBitmap::AverageFilter

LBitmap::BinaryFilter

LBitmap::Deskew

LBitmap::Despeckle

LBitmap::EdgeDetector

LBitmap::Emboss

LBitmap::IntensityDetect

LBitmap::MaxFilter

LBitmap::MedianFilter

LBitmap::MinFilter

LBitmap::Mosaic

LBitmap::MotionBlur

LBitmap::Oilify

LBitmap::Picturize

LBitmap::PicturizeList

LBitmap::PicturizeSingle

LBitmap::Posterize

LBitmap::Sharpen

LBitmap::Solarize

LBitmap::SpatialFilter

LBitmap::Add

LBitmap::AddBorder

LBitmap::AddFrame

LBitmap::AntiAlias

LBitmap::BalanceColors

LBitmap::ConvertToColoredGray

LBitmap::EdgeDetector

LBitmap::GaussianFilter

LBitmap::GetFunctionalLookupTable

LBitmap::GetHistogramGray

LBitmap::GetUserLookupTable

LBitmap::GrayScaleExt

LBitmap::LineProfile

LBitmap::MotionBlur

LBitmap::PicturizeList

LBitmap::PicturizeSingle

LBitmap::RemoveRedEye

LBitmap::ShiftMinimumToZero

LBitmap::ShiftZeroToNegative

LBitmap::SwapColors

LBitmap::UnsharpMask

LBitmap::Perlin

LBitmap::ColoredPencil

LBitmap::AdjustTint

LBitmap::BricksTexture

LBitmap::Canvas

LBitmap::Clouds

LBitmap::ColoredBalls

LBitmap::ColoredPencil

LBitmap::ColorHalfTone

LBitmap::CorrelationList

LBitmap::DeskewExt

LBitmap::DiffuseGlow

LBitmap::DisplaceMap

LBitmap::Fragment

LBitmap::GammaCorrectExt

LBitmap::HalfTonePattern

LBitmap::HighPassFilter

LBitmap::MaskConvolution

LBitmap::MosaicTiles

LBitmap::Offset

LBitmap::Perlin

LBitmap::Perspective

LBitmap::PlasmaFilter

LBitmap::Pointillist

LBitmap::RomanMosaic

LBitmap::Vignette

LBitmap::ZigZag

Geometric Transformations

LBitmap::AutoTrim

LBitmap::Deskew

LBitmap::Despeckle

LBitmap::GetAutoTrimRect

Modifying Intensity Values

LBitmap::ChangeContrast

LBitmap::ChangeHue

LBitmap::ChangeIntensity

LBitmap::ChangeSaturation

LBitmap::ColorMerge

LBitmap::ColorSeparate

LBitmap::GammaCorrect

LBitmap::GetHistogram

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::Invert

LBitmap::RemapIntensity

LBitmap::RemoveRedEye

LBitmap::StretchIntensity

Operators

LBitmap::operator=

Overridables

LBitmap::PicturizeCallBack

Window Leveling

LBitmap::ConvertSignedToUnsigned

LBitmap::ConvertUnsignedToSigned

LBitmap::Add

LBitmap::AdaptiveContrast

LBitmap::Aging

LBitmap::ApplyMathLogic

LBitmap::ColorIntensityBalance

LBitmap::ColorizeGray

LBitmap::ContBrightInt

LBitmap::DiceEffect

LBitmap::DigitalSubtract

LBitmap::DynamicBinary

LBitmap::EdgeDetectEffect

LBitmap::FunctionalLight

LBitmap::MultiScaleEnhancementBitmap

LBitmap::PuzzleEffect

LBitmap::RingEffect

LBitmap::SelectData

LBitmap::ShiftData

LBitmap::TextureAlphaBlend

LBitmap::AddShadow

LBitmap::AllocFTArray

LBitmap::ChangeHueSatIntBitmap

LBitmap::ColorReplace

LBitmap::ColorThreshold

LBitmap::DFT

LBitmap::DirectionEdgeStatistical

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FTDisplay

LBitmap::FrqFilter

LBitmap::FrqFilterMask

LBitmap::GetStatisticsInfo

LBitmap::GetFeretsDiameter

LBitmap::GetObjectInfo

LBitmap::GetRgnContourPoints

LBitmap::GetRgnPerimeterLength

LBitmap::MathFunction

LBitmap::RevEffect

LBitmap::Segment

LBitmap::SubtractBackground

LBitmap::UserFilter

LBitmap::GetLinearVOILUT

LBitmap::CountLUTColors

LBitmap::SetOverlay

LBitmap::GetOverlay

LBitmap::SetOverlayAttributes

LBitmap::GetOverlayAttributes

LBitmap::UpdateOverlayBits

LBitmap::GetOverlayCount

LBitmap::Scramble

LBitmap::ApplyModalityLUT

LBitmap::ApplyLinearModalityLUT

LBitmap::ApplyVOILUT

LBitmap::ApplyLinearVOILUT

LBitmap::RemapHue

LBitmap::GetMinMaxBits

LBitmap::GetMinMaxVal

LBitmap::WindowLevel

LBitmap::WindowLevelBitmap

LBitmap::WindowLevelFillLUT

Cleaning-up and Callbacks

LBitmap::BorderRemove

LBitmap::BorderRemoveCallBack

LBitmap::DotRemove

LBitmap::DotRemoveCallBack

LBitmap::HolePunchRemove

LBitmap::HolePunchRemoveCallBack

LBitmap::InvertedText

LBitmap::InvertedTextCallBack

LBitmap::LineRemove

LBitmap::LineRemoveCallBack

LBitmap::Smooth

LBitmap::SmoothCallBack

Kaufmann region

LBitmap::SetKaufmannRgn


LBitmap::Derived Classes

The following classes are derived directly from LBitmap:

LBitmapWindow


LBitmapBase

Description

The LBitmapBase class is the main bitmap class. This class contains the main functionality for dealing with bitmaps in memory. It includes functions for basic image transforms such as resizing, flipping, cropping, and rotating, and for changing the bitmaps’ color-depth. This class also includes functions for loading images from files and saving images to files. You can use this class to create bitmaps from scratch and deal with individual rows or pixels of the image data. This class also contains functions for the following:

Animation playback settings

Getting information about loaded bitmaps

Combining two or more bitmaps

Copying whole or partial bitmaps from one object to another

Copying bitmaps to or from the clipboard

Image display settings

Converting images to or from LEAD Bitmaps and DIBs or DDB's so you can work with other libraries

Creating Alpha-channel bitmaps

Creating a device context for the bitmap so you can draw on it using Windows GDI functions

Dealing with bitmap view perspectives

Dealing with image palettes, including paint palettes

This class is the base class for any bitmap classes that you wish to derive.

When calling some functions of the LBitmapBase LEADTOOLS Class Library classes, the bitmap data is changed. To be notified of these changes, you can override the LBitmapBase::StartChanging and LBitmapBase::EndChanging functions. For more information, refer to Bitmap Change Notifications and Notification Categories.

If you derive a class from LBitmapBase, the macros defined in Wrapper Macros may be helpful.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Also requires the file format DLLs described in Files To Be Included With Your Application.

See Also

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LBitmapBase::Class Members

Member Functions

Return to LBitmapBase


LBitmapBase::Member Functions

Constructors/Destructors | Copying Bitmaps from One Object to Another
Image Transforms | Color Processing
Copying Bitmaps To or From the Clipboard |
Loading/Saving Images | Image Display Settings
Animation Playback Settings | Converting Images
Getting/Setting Information | Creating Bitmaps
Combining Bitmaps | Device Contexts
Bitmap View Perspectives | Image Palettes and Paint Palettes
Overridables | Operators
Low-Level Functions |
Miscellaneous |

Constructors/Destructors

LBitmapBase::LBitmapBase

LBitmapBase::~LBitmapBase

Image Transforms

LBitmapBase::Size

LBitmapBase::Resize

LBitmapBase::Flip

LBitmapBase::Reverse

LBitmapBase::Resample

LBitmapBase::Rotate

LBitmapBase::RotateFine

LBitmapBase::Shear

LBitmapBase::Trim

Color Processing

LBitmapBase::GrayScale

LBitmapBase::StartDithering

LBitmapBase::DitherLine

LBitmapBase::StopDithering

LBitmapBase::TranslateColor

LBitmapBase::ColorRes

LBitmapBase::Fill

Loading/Saving Images

LBitmapBase::GetLoadStatus

LBitmapBase::Load

LBitmapBase::LoadResize

LBitmapBase::Save

LBitmapBase::IsProgressive

LBitmapBase::GetFileName

LBitmapBase::SetFileName

LBitmapBase::IsFileNameEnabled

LBitmapBase::EnableFileName

Animation Playback Settings

LBitmapBase::IsPlayBackWaitUserInput

LBitmapBase::IsPlayBackTransparencyEnabled

LBitmapBase::EnablePlayBackTransparency

LBitmapBase::EnablePlayBackWaitUserInput

LBitmapBase::SetPlayBackTransparentColor

LBitmapBase::GetPlayBackTransparentColor

LBitmapBase::GetPlayBackLeft

LBitmapBase::SetPlayBackLeft

LBitmapBase::GetPlayBackTop

LBitmapBase::SetPlayBackTop

LBitmapBase::GetPlayBackDisposalMethod

LBitmapBase::SetPlayBackDisposalMethod

LBitmapBase::GetPlayBackBackGroundColor

LBitmapBase::SetPlayBackBackGroundColor

LBitmapBase::SetPlayBackDelay

LBitmapBase::GetPlayBackDelay

Getting/Setting Info

LBitmapBase::Underlay

LBitmapBase::FlipViewPerspective

LBitmapBase::ReverseViewPerspective

LBitmapBase::ConvertFromEMF

LBitmapBase::ConvertFromWMF

LBitmapBase::ConvertToEMF

LBitmapBase::ConvertToWMF

LBitmapBase::CombineBitmapWarp

LBitmapBase::GetHandle

LBitmapBase::SetHandle

LBitmapBase::GetWidth

LBitmapBase::GetHeight

LBitmapBase::GetMemSize

LBitmapBase::IsAllocated

LBitmapBase::IsInterlaced

LBitmapBase::GetColorOrder

LBitmapBase::GetXResolution

LBitmapBase::GetYResolution

LBitmapBase::IsMemoryLocked

LBitmapBase::GetBitsPerPixel

LBitmapBase::GetBytesPerLine

LBitmapBase::Is1BitCompressed

LBitmapBase::IsUsingDiskMemory

LBitmapBase::GetViewPerspective

LBitmapBase::IsUsingConventionalMemory

LBitmapBase::GetDefaultDithering

LBitmapBase::GetPaintContrast

LBitmapBase::GetPaintGamma

LBitmapBase::GetPaintIntensity

LBitmapBase::Initialize

LBitmapBase::IsGrayScale

LBitmapBase::HasRgn

LBitmapBase::GetColorCount

LBitmapBase::IsPixelsSigned

LBitmapBase::GetDitheringMethod

LBitmapBase::SetDitheringMethod

LBitmapBase::SetLocalSettings

LBitmapBase::RestoreGlobalSettings

LBitmapBase::IsRedirectStatusCallBackEnabled

LBitmapBase::EnableRedirectStatusCallBack

LBitmapBase::IsBitmapListLocked

LBitmapBase::SetXResolution

LBitmapBase::SetYResolution

Combining Bitmaps

LBitmapBase::AlphaBlend

LBitmapBase::Combine

LBitmapBase::CreateFadedMask

LBitmapBase::CombineExt

LBitmapBase::ConvertSignedToUnsigned

LBitmapBase::FeatherAlphaBlend

LBitmapBase::Underlay

Bitmap View Perspectives

LBitmapBase::GetViewPerspective

LBitmapBase::SetViewPerspective

LBitmapBase::PointFromBitmap

LBitmapBase::PointToBitmap

LBitmapBase::RectFromBitmap

LBitmapBase::RectToBitmap

LBitmapBase::ChangeViewPerspective

LBitmapBase::RotateViewPerspective

Copying Bitmaps from one Object to Another

LBitmapBase::Copy

LBitmapBase::CopyData

LBitmapBase::CopyHandle

LBitmapBase::CopyRect

Copying Bitmaps To or From the Clipboard

LBitmapBase::IsClipboardReady

LBitmapBase::CopyFromClipboard

LBitmapBase::CopyToClipboard

Image Display Settings

LBitmapBase::GetDefaultDithering

LBitmapBase::SetDefaultDithering

LBitmapBase::GetPaintContrast

LBitmapBase::SetPaintContrast

LBitmapBase::GetPaintGamma

LBitmapBase::SetPaintGamma

LBitmapBase::GetPaintIntensity

LBitmapBase::SetPaintIntensity

LBitmapBase::GetDisplayMode

LBitmapBase::SetDisplayMode

LBitmapBase::EnableLocalSettings

LBitmapBase::IsLocalSettingsEnabled

LBitmapBase::GetRects

LBitmapBase::SetSrcRect

LBitmapBase::SetClipSrcRect

LBitmapBase::SetDstRect

LBitmapBase::SetClipDstRect

Converting Images

LBitmapBase::ConvertFromDIB

LBitmapBase::ConvertToDIB

LBitmapBase::ConvertToDDB

LBitmapBase::ConvertFromDDB

Creating bitmaps

LBitmapBase::Create

LBitmapBase::CreateAlphaBitmap

LBitmapBase::SetAlpha

Device Contexts

LBitmapBase::CreateLeadDC

LBitmapBase::DeleteLeadDC

Image Palettes and Paint Palettes

LBitmapBase::GetPalette

LBitmapBase::SetPalette

LBitmapBase::DupPalette

LBitmapBase::CreatePaintPalette

LBitmapBase::GetFixedPalette

LBitmapBase::GetColors

LBitmapBase::PutColors

Overridables

LBitmapBase::StartChanging

LBitmapBase::EndChanging

LBitmapBase::ColorResBitmapCallBack

Operators

LBitmapBase::operator=

Low-Level Functions

LBitmapBase::Free

LBitmapBase::Access

LBitmapBase::Release

LBitmapBase::Allocate

LBitmapBase::ChangeHeight

LBitmapBase::Clear

LBitmapBase::GetRow

LBitmapBase::GetRowCol

LBitmapBase::GetRowColCompressed

LBitmapBase::GetRowCompressed

LBitmapBase::PutRow

LBitmapBase::PutRowCol

LBitmapBase::PutRowCompressed

LBitmapBase::PutRowColCompressed

LBitmapBase::GetPixelColor

LBitmapBase::Initialize

LBitmapBase::ClearNegativePixels

LBitmapBase::ChangeCompression

LBitmapBase::IsSuperCompressed

Miscellaneous

LBitmapBase::EnableChangeNotification

LBitmapBase::IsChangeNotificationEnabled

LBitmapBase::EnableAlwaysEndNotification

LBitmapBase::IsAlwaysEndNotification

LBitmapBase::EnableRedirectStatusCallBack

LBitmapBase::GetPixelData

LBitmapBase::PutPixelData


LBitmapBase::Derived Classes

The following classes are derived directly from LBitmapBase:

LBitmap


LBitmapList

Description

The LBitmapList class is derived from the LBase class. This class contains functions for creating, manipulating, and managing bitmap lists. This class also provides functionality for loading and saving bitmap lists from/to multipage file formats.

If you derive a class from LBitmapList, the macros defined in Wrapper Macros may be helpful.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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.

See Also

Class Members, Class Hierarchy Chart, Parent class


LBitmapList::Class Members

Member Functions

Return to LBitmapList


LBitmapList::Member Functions

Constructors / Destructors

Creating / Initializing a Bitmap List

Destroying a Bitmap List

Getting / Setting Information

Getting / Setting Items in a Bitmap List

Loading a Bitmap List

Manipulating a Bitmap List

Operators

Saving a Bitmap List

Constructors / Destructors

LBitmapList::LBitmapList

LBitmapList::~LBitmapList

Creating / Initializing a Bitmap List

LBitmapList::Create

LBitmapList::IsCreated

LBitmapList::SetBitmapList

Destroying a Bitmap List

LBitmapList::Destroy

Getting / Setting Information

LBitmapList::GetBackgroundColor

LBitmapList::GetCurrentIndex

LBitmapList::GetGlobalHeight

LBitmapList::GetGlobalLoop

LBitmapList::GetGlobalWidth

LBitmapList::GetHandle

LBitmapList::GetItemsCount

LBitmapList::GetPalette

LBitmapList::GetViewPerspective

LBitmapList::HasGlobalBackground

LBitmapList::HasGlobalLoop

LBitmapList::HasGlobalPalette

LBitmapList::SetCurrentIndex

LBitmapList::SetHandle

Getting / Setting Items in a Bitmap List

LBitmapList::GetItemsCount

LBitmapList::GetFirstItem

LBitmapList::GetItem

LBitmapList::GetLastItem

LBitmapList::GetNextItem

LBitmapList::GetPreviousItem

LBitmapList::SetItem

Loading a Bitmap List

LBitmapList::Load

Manipulating a Bitmap List

LBitmapList::ColorResItems

LBitmapList::CopyItems

LBitmapList::DeleteItems

LBitmapList::InsertItem

LBitmapList::RemoveItem

Operators

LBitmapList::operator[]

LBitmapList::operator=

Saving a Bitmap List

LBitmapList::Save


LBitmapRgn

Description

The LBitmapRgn class is derived from the LBase class and contains support for region of interest processing. 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. In order to use this class, you must first associate an LBitmapBase object with it. Then, you can use the various region functions to create, modify, and destroy regions of interest in the associated LBitmapBase object's bitmap. When processing a bitmap that contains a region, there are two possible outcomes: 1) only the bitmap region is processed, 2) both the bitmap and the bitmap region are processed. For more information, refer to Functions Where the Region Preempts the Bitmap and Functions That Transform the Region and the Bitmap .

When calling some functions of the LBitmapBase LEADTOOLS Class Library classes, the bitmap data is changed. To be notified of these changes, you can override the LBitmapBase::StartChanging and LBitmapBase::EndChanging functions. For more information, refer to Bitmap Change Notifications and Notification Categories.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LBitmapRgn::Class Members

Member Functions

Return to LBitmapRgn


LBitmapRgn::Member Functions

Constructors / Destructors

Creating a Region

Working with the Current Region

Constructors / Destructors

LBitmapRgn::LBitmapRgn

LBitmapRgn::~LBitmapRgn

Creating a Region

LBitmapRgn::SetRgnHandle

LBitmapRgn::SetRgnColor

LBitmapRgn::SetRgnColorHSVRange

LBitmapRgn::SetRgnColorRGBRange

LBitmapRgn::SetRgnEllipse

LBitmapRgn::SetRgnPolygon

LBitmapRgn::SetRgnRect

LBitmapRgn::SetRgnRoundRect

LBitmapRgn::SetRgnFromMask

LBitmapRgn::SetBitmap

LBitmapRgn::SetRgnCombineMode

LBitmapRgn::SetRgnXForm

LBitmapRgn::GetRgnCombineMode

LBitmapRgn::GetRgnXForm

LBitmapRgn::CurveToBezier

Working with the Current Region

LBitmapRgn::BitmapHasRgn

LBitmapRgn::GetRgnHandle

LBitmapRgn::Free

LBitmapRgn::Offset

LBitmapRgn::GetRgnArea

LBitmapRgn::GetRgnBounds

LBitmapRgn::IsPtInRgn

LBitmapRgn::CreateMaskFromBitmapRgn

LBitmapRgn::IsValid

LBitmapRgn::ResizeRgn

LBitmapRgn::SetRgnMagicWand

LBitmapRgn::CurveToBezier

LBitmapRgn::SetRgnCurve

LBitmapRgn::GetClipSegments

LBitmapRgn::GetClipSegmentsMax

LBitmapRgn::HolesRemovalRgn

LBitmapRgn::SetRgnBorder


LBitmapSettings

Description

The LBitmapSettings class is derived from LSettings, and extends it to include functionality for getting and setting display options such as PaintIntensity, PaintContrast, PaintGamma &DisplayMode. This class also includes functions for setting the default image dithering method and for creating a UserMatch table for use with LBitmapBase::ColorRes.

You may find it useful to call the static member functions of this class directly, as (ClassName::Function), without declaring an object. For example, the following is valid, and will compile:

nMode = LBitmapSettings::GetDisplayMode();

This returns the current global setting for the paint contrast.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LBitmapSettings::Class Members

Member Functions

Return to LBitmapSettings


LBitmapSettings::Member Functions

Constructors / Destructors

Display Options

Dithering

User Match Table

Constructors / Destructors

LBitmapSettings::LBitmapSettings

LBitmapSettings::~LBitmapSettings

Display Options

LBitmapSettings::GetDisplayMode

LBitmapSettings::SetDisplayMode

Dithering

LBitmapSettings::DefaultDithering

User Match Table

LBitmapSettings::CreateUserMatchTable

LBitmapSettings::FreeUserMatchTable

LBitmapSettings::SetUserMatchTable


LBitmapWindow

Description

The LBitmapWindow class is derived from LBitmap, and extends it by adding full user interface (UI) functionality. You can consider this class as a full windowed control that is capable of displaying bitmaps. The LBitmapWindow class provides the following functionality:

Bitmap Displaying

Scrolling (which can be enabled or disabled)

Palette handling

Region drawing & floater bitmap

Zooming

Pan Window

Keyboard handling

Various UI tools including pan image, zoom in/out on mouse click, drawing zoom rects, and drawing regions of interest

Painting while loading of a bitmap from file

Paint effects, transitions, gradients, and patterns

Windows Drag/Drop operations for loading files

Using command notification messages, the LBitmapWindow object can be used in a manner similar to standard Windows controls for dialogs. By overriding the virtual functions provided by LBitmapWindow, you can use LBitmapWindow objects as a regular window, which handles most messages for you. For more information on the two ways in which LBitmapWindow objects can be used, refer to Using LBitmapWindow as a Window, Using LBitmapWindow as a Control, and LBitmapWindow:Window vs Control.

The LBitmapWindow control handles processing the mouse messages automatically when the internal tool type is not TOOL_USERMODE.

Double clicking the floater of an LBitmapWindow object will cause the floater to be pasted in its place and reactivated again for additional drag operations, while clicking beside the floater will cause the floater to be pasted and then freed.

Some inherited functions will work only on an LBitmapWindow object's floater (if a one exists). These functions do not affect the main displayed bitmap. For a list of these functions, refer to LBitmapWindow Inherited Floater Functions.

Certain keys are handled by the LBitmapWindow object when the bitmap window control has the focus. For a list of these keys and the associated action, refer to LBitmapWindow Keys.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTDIS
LTDLGKRN
LTDLGIMG
LTDLGEFX
LTDLGWEB
LTDLGFILE
LTDLGIMGEFX
LTDLGCLR
LTDLGIMGDOC
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

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

See Also

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LBitmapWindow::Class Members

Data Members

Member Functions

Return to LBitmapWindow


LBitmapWindow::Data Members

LBitmapWindow::m_hWnd


LBitmapWindow::Member Functions

Bitmap Display

Constructors / Destructors

Copying Bitmaps To or From the Clipboard

Floaters

Loading Images

Magnifying Glass

Message Handling

Overridables

Pan Window

Paint Effects

Effects

Gradients

Patterns

Transitions

Painting

Palette Handling

Region Drawing

Scrolling

User Interface Tools

Windows Drag and Drop

Zooming

Zoom View

Bitmap Display

LBitmapWindow::CreateWnd

LBitmapWindow::EnablePaintWhileLoad

LBitmapWindow::EnableLocalSettings

LBitmapWindow::FitToParent

LBitmapWindow::GetBitmapVisibleRect

LBitmapWindow::GetBitmapWnd

LBitmapWindow::IsPaintWhileLoadEnabled

LBitmapWindow::Move

LBitmapWindow::OnDraw

LBitmapWindow::SetDefaultDithering

LBitmapWindow::SetDisplayMode

LBitmapWindow::SetPaintContrast

LBitmapWindow::SetPaintGamma

LBitmapWindow::SetPaintIntensity

LBitmapWindow::SetWndHandle

LBitmapWindow::SnapWndToImage

Constructors / Destructors

LBitmapWindow::LBitmapWindow

LBitmapWindow::~LBitmapWindow

Copying Bitmaps To or From the Clipboard

LBitmapWindow::CopyFromClipboard

LBitmapWindow::CopyToClipboard

Floaters

LBitmapWindow::GetFloater

LBitmapWindow::GetFloaterRgn

LBitmapWindow::HasFloater

LBitmapWindow::GetAutoRgnToFloater

LBitmapWindow::SetAutoRgnToFloater

Loading Images

LBitmapWindow::MagGlassCallBack

LBitmapWindow::EnableDoubleBuffer

LBitmapWindow::IsDoubleBufferEnabled

LBitmapWindow::Load

Magnifying Glass

LBitmapWindow::GetMagGlassOptions

LBitmapWindow::SetMagGlassOptions

LBitmapWindow::IsToolTypeMagGlass

Message Handling

LBitmapWindow::MsgProcCallBack

Overridables

LBitmapWindow::EndChanging

LBitmapWindow::OnDraw

LBitmapWindow::OnFileDropped

LBitmapWindow::OnZoom

LBitmapWindow::PaintNotification

LBitmapWindow::PanWndCallBack

LBitmapWindow::MsgProcCallBack

LBitmapWindow::StartChanging

LBitmapWindow::StatusCallBack

Paint Effects

Effects

LBitmapWindow::EnablePaintEffect

LBitmapWindow::GetEffectParameters

LBitmapWindow::GetMaxEffectPasses

LBitmapWindow::GetPaintEffect

LBitmapWindow::IsPaintEffectEnabled

LBitmapWindow::SetEffectParameters

LBitmapWindow::SetMaxEffectPasses

LBitmapWindow::SetPaintEffect

Gradients

LBitmapWindow::EnableDrawGradient

LBitmapWindow::GetGradientParameters

LBitmapWindow::GetGradientStyle

LBitmapWindow::IsDrawGradientEnabled

LBitmapWindow::SetGradientParameters

LBitmapWindow::SetGradientStyle

Patterns

LBitmapWindow::EnableDrawPattern

LBitmapWindow::GetPatternBackColor

LBitmapWindow::GetPatternForeColor

LBitmapWindow::GetPatternStyle

LBitmapWindow::IsDrawPatternEnabled

LBitmapWindow::SetPatternBackColor

LBitmapWindow::SetPatternForeColor

LBitmapWindow::SetPatternStyle

Transitions

LBitmapWindow::EnablePaintTransition

LBitmapWindow::GetMaxTransitionPasses

LBitmapWindow::GetTransition

LBitmapWindow::GetTransitionEffect

LBitmapWindow::GetTransitionParameters

LBitmapWindow::IsPaintTransitionEnabled

LBitmapWindow::SetMaxTransitionPasses

LBitmapWindow::SetTransition

LBitmapWindow::SetTransitionEffect

LBitmapWindow::SetTransitionParameters

Painting

LBitmapWindow::EnableAutoPaint

LBitmapWindow::EnablePaintSizeUseDPI

LBitmapWindow::FitToParent

LBitmapWindow::GetROP3

LBitmapWindow::IsAutoPaintEnabled

LBitmapWindow::IsPaintSizeUseDPIEnabled

LBitmapWindow::Move

LBitmapWindow::PaintNotification

LBitmapWindow::Repaint

LBitmapWindow::SetROP3

Palette Handling

LBitmapWindow::HandlePalette

Pan Window

LBitmapWindow::CreatePanWnd

LBitmapWindow::DestroyPanWnd

LBitmapWindow::GetPanWnd

LBitmapWindow::IsPanWndCreated

LBitmapWindow::PanWndCallBack

LBitmapWindow::UpdatePanWnd

Region Drawing

LBitmapWindow::CancelRgn

LBitmapWindow::GetRegionType

LBitmapWindow::GetRgnFrameType

LBitmapWindow::SetRegionType

LBitmapWindow::SetRgnFrameType

Scrolling

LBitmapWindow::EnableAutoScroll

LBitmapWindow::EnableKeyboard

LBitmapWindow::GetHorzLineStep

LBitmapWindow::GetVertLineStep

LBitmapWindow::IsAutoScrollEnabled

LBitmapWindow::IsKeyboardEnabled

LBitmapWindow::ScrollBy

LBitmapWindow::ScrollTo

LBitmapWindow::SetHorzLineStep

LBitmapWindow::SetVertLineStep

User Interface Tools

LBitmapWindow::GetToolType

LBitmapWindow::SetToolType

Windows Drag and Drop

LBitmapWindow::EnableDragAcceptFiles

LBitmapWindow::IsDragAcceptFilesEnabled

LBitmapWindow::OnFileDropped

Zooming

LBitmapWindow::EnableCenterOnZoom

LBitmapWindow::EnableKeyboard

LBitmapWindow::GetZoomFactor

LBitmapWindow::GetZoomMode

LBitmapWindow::GetZoomPercent

LBitmapWindow::IsCenterOnZoomEnabled

LBitmapWindow::IsKeyboardEnabled

LBitmapWindow::OnZoom

LBitmapWindow::SetZoomFactor

LBitmapWindow::SetZoomMode

LBitmapWindow::SetZoomPercent

LBitmapWindow::SnapWndToImage

LBitmapWindow::ZoomIn

LBitmapWindow::ZoomOut

LBitmapWindow::ZoomToRect

Zoom View

LBitmapWindow::AddZoomView

LBitmapWindow::DestroyZoomView

LBitmapWindow::EnableHiliteZoomView

LBitmapWindow::GetZoomViewsCount

LBitmapWindow::GetZoomViewProps

LBitmapWindow::HasZoomView

LBitmapWindow::IsHiliteZoomViewEnabled

LBitmapWindow::UpdateZoomView


LBitmapWindow::Derived Classes

The following classes are derived directly from LBitmapWindow:

LAnimationWindow

LAnnotationWindow


LBuffer

Description

The LBuffer class is derived from the LBase class. This class contains support for dealing with buffers of image data, as opposed to entire bitmaps. LBuffer provides functionality for compressing and decompressing image data, resizing image data, converting image data to and from various color orders, and converting buffers of image data to and from various color spaces. LBuffer also encapsulates functions for allocating and freeing memory buffers to be used by the various image data processing functions.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LBuffer::Class Members

Member Functions

Return to LBuffer


LBuffer::Member Functions

Compressing Image Data

Constructors / Destructors

Converting Image Data

Copying

Decompressing Image Data

Lock / Unlock

Modifying the Buffer

Operators

Resizing Image Data

Compressing Image Data

LBuffer::CompressRow

LBuffer::CompressRows

Constructors / Destructors

LBuffer::~LBuffer

LBuffer::LBuffer

Converting Image Data

LBuffer::ConvertBuffer

LBuffer::ConvertColorSpace

Copying

LBuffer::Copy

LBuffer::operator=

Decompressing Image Data

LBuffer::ExpandRow

LBuffer::ExpandRows

Lock / Unlock

LBuffer::Lock

LBuffer::Unlock

Modifying the Buffer

LBuffer::Fill

LBuffer::Free

LBuffer::GetHandle

LBuffer::GetSize

LBuffer::IsValid

LBuffer::Reallocate

LBuffer::SetHandle

Operators

LBuffer::operator=

Resizing Image Data

LBuffer::Resize

LBuffer::StartResize

LBuffer::StopResize


LChange

Description

The LChange class is derived from LBase. This class provides support for changing between LEAD bitmap objects and device dependent bitmaps (DDB) and device independent bitmaps (DIB). Unlike the DIB and DDB conversion functions of LBitmapBase, these functions do not result in 2 copies of the image being in memory after the function is complete. These functions will invalidate the source image, and result in only one copy after function completion.

When calling some functions of the LBitmapBase LEADTOOLS Class Library classes, the bitmap data is changed. To be notified of these changes, you can override the LBitmapBase::StartChanging and LBitmapBase::EndChanging functions. For more information, refer to Bitmap Change Notifications and Notification Categories.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LChange::Class Members

Member Functions

Return to LChange


LChange::Member Functions

Constructors / Destructors

DIB

DDB

Constructors / Destructors

LChange::LChange

LChange::~LChange

DIB

LChange::ChangeFromDIB

LChange::ChangeToDIB

DDB

LChange::ChangeFromDDB

LChange::ChangeToDDB

LChange::ChangeFromWMF

LChange::ChangeFromEMF

LChange::ChangeToEMF

LChange::ChangeToWMF


LDoubleBuffer

Description

The LDoubleBuffer class is derived from LBase. This class contains the support for creating and managing Double Buffer objects. You can use objects created from this class to set/get the different properties of a Double buffer object.

For more information about the Double buffer object, refer to Minimizing Flicker with Double Buffering

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members , Class Hierarchy Chart, Parent class


LDoubleBuffer::Class Members

Member Functions

Return to LDoubleBuffer


LDoubleBuffer::Member Functions

Constructors / Destructors

Miscellaneous

Constructors / Destructors

LDoubleBuffer::LDoubleBuffer

LDoubleBuffer::~LDoubleBuffer

Miscellaneous

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

LDoubleBuffer::IsDoubleBufferEnabled


LDraw

Description

The LDraw class is derived from LBase, and provides base functionality for the LEADTOOLS Class Library painting and drawing classes. This class contains basic functions and member variables that are used when displaying bitmap objects.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LDraw::Class Members

Member Functions

Return to LDraw


LDraw::Member Functions

Constructors / Destructors

Displaying Images

Constructors / Destructors

LDraw::LDraw

LDraw::~LDraw

Displaying Images

LDraw::SetDC

LDraw::GetDC

LDraw::SetBitmap

LDraw::IsValid


LDraw::Derived Classes

The following classes are derived directly from LDraw:

LPaint

LPaintEffect


LFile

Description

The LFile class is derived from LBaseFile and extends it to contain functions for loading and saving bitmaps from and to files on disk.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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.

file format DLLs described in Files To Be Included With Your Application

See Also

Class Members, Class Hierarchy Chart, Parent class


LFile::Class Members

Member Functions

Return to LFile


LFile::Member Functions

Constructors / Destructors

File Comments

Getting / Setting File Information

Loading Images

Modifying Files

Overridables

Saving Images

EXIF Extensions

GeoKeys

ICC Profile

Compacting TIFF Files

CMYK TIFF Files

Constructors / Destructors

LFile::LFile

LFile::~LFile

File Comments

LFile::GetCommentSize

LFile::ReadComment

LFile::ReadCommentExt

LFile::WriteComment

Getting / Setting File Information

LFile::CreateThumbnail

LFile::CreateThumbnailCallBack

LFile::EnumTags

LFile::EnumTagsCallBack

LFile::DeleteTag

LFile::GetCommentSize

LFile::GetFileName

LFile::GetInfo

LFile::GetPCDResolution

LFile::IsValid

LFile::ReadCommentOffset

LFile::ReadLoadResolutions

LFile::ReadFileTransforms

LFile::ReadTag

LFile::SetFileName

LFile::SetBitmap

LFile::WriteFileTransforms

Loading Images

LFile::BrowseDir

LFile::FeedLoad

LFile::FeedLoadCallBack

LFile::GetCompressStamp

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadBitmapResize

LFile::LoadFile

LFile::LoadOffset

LFile::LoadTile

LFile::ReadFileTransforms

LFile::ReadStamp

LFile::StartFeedLoad

LFile::StopFeedLoad

LFile::LoadLayer

Modifying Files

LFile::DeletePage

LFile::FileConvert

LFile::TransformFile

Overridables

LFile::BrowseDirCallBack

LFile::FeedLoadCallBack

LFile::LoadFileCallBack

LFile::LoadFileOffsetCallBack

LFile::LoadFileTileCallBack

LFile::SaveFileCallBack

LFile::SaveFileOffsetCallBack

LFile::SaveFileTileCallBack

LFile::TransformFileCallBack

Saving Images

LFile::GetProperQualityFactor

LFile::SaveBitmap

LFile::SaveBitmapList

LFile::SaveFile

LFile::SaveOffset

LFile::SaveTile

LFile::WriteFileTransforms

LFile::WriteStamp

LFile::SaveBitmapWithLayers

EXIF Extensions

LFile::FreeExtensions

LFile::GetExtensionAudio

LFile::LoadExtensionStamp

LFile::ReadFileExtensions

GeoKeys

LFile::SetGeoKey

LFile::GetGeoKey

LFile::WriteGeoKey

LFile::ReadGeoKey

LFile::EnumGeoKeys

LFile::EnumGeoKeysCallBack

ICC Profile

LFile::FreeICCProfile

LFile::FreeICCProfileExt

LFile::InitICCProfile

LFile::InitICCProfileExt

LFile::LoadICCProfile

LFile::LoadICCProfileExt

LFile::SaveICCProfile

Compacting TIFF Files

LFile::Compact

CMYK TIFF Files

LFile::LoadCMYKArray

LFile::SaveCMYKArray

LPaint::PaintDCCMYKArray


LFileSettings

Description

The LFileSettings class is derived from LSettings, and extends it to include functionality for restricting which LEAD file import/export DLLs are loaded, getting/setting extended import/export options, getting/setting file comments and tags (for file formats such as TIFF and EXIF), and getting/setting resolution import options (for file formats such as WMF, PCD & FPX).

You may find it useful to call the static member functions of this class directly, as (ClassName::Function), without declaring an object. For example, the following is valid, and will compile:

nMode = LBitmapSettings::GetDisplayMode();

This returns the current global setting for the paint contrast.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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.

See Also

Class Members, Class Hierarchy Chart, Parent class


LFileSettings::Class Members

Member Functions

Return to LFileSettings


LFileSettings::Member Functions

Constructors / Destructors

Extended Import/Export Options

File Comments and Tags

File Format Options

JPEG 2000 Save Options

Restricting the Loading of LEAD File Import/Export DLLs

Resolution Import Options

Constructors / Destructors

LFileSettings::LFileSettings

LFileSettings::~LFileSettings

Extended Import / Export Options

LFileSettings::GetExtFileOption

LFileSettings::SetExtFileOption

LFileSettings::GetSaveResolution

LFileSettings::SetSaveResolution

File Comments and Tags

LFileSettings::GetComment

LFileSettings::SetComment

LFileSettings::GetTag

LFileSettings::SetTag

File Format Options

LFileSettings::GetDJVOptions

LFileSettings::SetDJVOptions

LFileSettings::GetJBIG2Options

LFileSettings::SetJBIG2Options

LFileSettings::GetPDFOptions

LFileSettings::SetPDFOptions

LFileSettings::GetPDFSaveOptions

LFileSettings::SetPDFSaveOptions

LFileSettings::GetPLTOptions

LFileSettings::SetPLTOptions

LFileSettings::GetPTKOptions

LFileSettings::SetPTKOptions

LFileSettings::GetRTFOptions

LFileSettings::SetRTFOptions

LFileSettings::GetTXTOptions

LFileSettings::SetTXTOptions

LFileSettings::SetAutoCADFilesColorScheme

JPEG 2000 Save Options

LFileSettings::GetDefaultJ2KOptions

LFileSettings::GetJ2KOptions

LFileSettings::SetJ2KOptions

Restricting the Loading of LEAD File Import/Export DLLs

LFileSettings::IgnoreFilters

LFileSettings::PreLoadFilters

Resolution Import Options

LFileSettings::GetWMFResolution

LFileSettings::SetWMFResolution

LFileSettings::GetPCDResolution

LFileSettings::SetPCDResolution

LFileSettings::GetLoadResolution

LFileSettings::SetLoadResolution


LImageListControl

Description

The LImageListControl class provides functionality for creating a Windows control that implements an ImageList for manipulating and displaying a list of images. The LImageListControl will display a list of images in a windowed control with various options and event notifications.

The LImageListControl class provides the following functionality:

ImageList Display with control over:

background color

item background color

item selection style

item size

item text display

item spacing

Items can be inserted, deleted, modified, and sorted (based on text property)

Scrolling (vertical or horizontal)

Palette handling

Automatic or manual item selection (single or multi)

Load from multi-page files

Save to multi-page files

Keyboard handling (which can be disabled)

Notification messages for item selection, mouse messages, keyboard messages, etc.

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.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTDIS
LTFIL
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.

See Also

Class Members, Class Hierarchy Chart, Parent class


LImageListControl::Class Members

Data Members

Member Functions

Return to LImageListControl


LImageListControl::Data Members

ImageListControl::m_hWnd


LImageListControl::Member Functions

Constructors / Destructors

Creating the Control

Getting / Setting Options

Item Operations

Overridables

Constructors / Destructors

LImageListControl::LImageListControl

LImageListControl::~LImageListControl

Creating the Control

LImageListControl::CreateControl

Getting / Setting Options

LImageListControl::EnableKeyboard

LImageListControl::GetBackColor

LImageListControl::GetBorderColor

LImageListControl::GetFirstVisible

LImageListControl::GetItemOptions

LImageListControl::GetScrollStyle

LImageListControl::GetSelectionOptions

LImageListControl::GetViewSize

LImageListControl::SetBackColor

LImageListControl::SetBorderColor

LImageListControl::SetItemOptions

LImageListControl::SetScrollStyle

LImageListControl::SetSelectionBitmap

LImageListControl::SetSelectionOptions

Item Operations

LImageListControl::Clear

LImageListControl::DrawItem

LImageListControl::EnsureVisible

LImageListControl::ExportBitmapList

LImageListControl::GetColumnCount

LImageListControl::GetItem

LImageListControl::GetItemCount

LImageListControl::GetRowCount

LImageListControl::GetSelectCount

LImageListControl::GetSelectedItems

LImageListControl::HitTest

LImageListControl::ImportBitmapList

LImageListControl::Insert

LImageListControl::Remove

LImageListControl::ScrollItems

LImageListControl::SelectAll

LImageListControl::Sort

LImageListControl::SortExt

LImageListControl::Update

Overridables

LImageListControl::ItemSelected

LImageListControl::MsgProcCallBack


LIsis

Description

The LIsis class is derived from LScanner and provides support for acquiring images from ISIS compatible scanners. This class provides functionality for selecting ISIS scanner drivers, displaying the ISIS built-in user interface, acquiring single or multiple images, and setting acquisition parameters without using the built-in UI..

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LIsis::Class Members

Member Functions

Return to LIsis


LIsis::Member Functions

Acquiring Single or Multiple Images

Constructors / Destructors

Displaying the ISIS Built-in User Interface

Overridables

Selecting ISIS Scanner Drivers

Getting/Setting Acquisition Parameters Without Using the Built-in User Interface

Acquiring Single or Multiple Images

LIsis::Acquire

LIsis::AcquireMulti

LIsis::AcquireMultiCallBack

LIsis::IsAvailable

LIsis::LoadDriver

LIsis::SetScanOptions

LIsis::UnloadDriver

Constructors / Destructors

LIsis::LIsis

LIsis::~LIsis

Displaying the ISIS Built-in User Interface

LIsis::Acquire

LIsis::AcquireMulti

Overridables

LIsis::AcquireMultiCallBack

Selecting ISIS Scanner Drivers

LIsis::Select

Getting/Setting Acquisition Parameters Without Using the Built-in User Interface

LIsis::GetTagLong

LIsis::GetTagShort

LIsis::SetTagLong

LIsis::SetTagShort

LIsis::GetTagASCII

LIsis::GetTagASCIIChoice

LIsis::GetTagLongChoice

LIsis::GetTagShortChoice

LIsis::SetTagASCII


LMarker

Description

The LMarker class is derived from LBase. This class contains the support for creating, and managing marker collection for image, you can use the objects created from this class to set/get the different properties of a markers.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Parent class


LMarker::Member Functions

Constructors/Destructors

Creating Marker Objects

Loading Markers

Overridables

Working with the Current Marker

Return to LMarker

Constructors / Destructors

LMarker::LMarker

LMarker::~LMarker

Creating Marker Objects

LMarker::Create

Loading Markers

LMarker::Load

Overridables

LMarker::EnumMarkersCallBack

Working with the Current Marker

LMarker::Copy

LMarker::Delete

LMarker::DeleteIndex

LMarker::Enum

LMarker::Free

LMarker::GetCount

LMarker::GetGlobalMarkers

LMarker::GetHandle

LMarker::Insert

LMarker::SetAsGlobalMarkers

LMarker::SetHandle


LMemoryFile

Description

The LMemoryFile class is derived from LBaseFile and extends it to contain functions for loading and saving bitmaps from and to files in memory buffers, as opposed to files on disk..

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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.

file format DLLs described in Files To Be Included With Your Application

See Also

Class Members, Class Hierarchy Chart, Parent class


LMemoryFile::Class Members

Member Functions

Return to LMemoryFile


LMemoryFile::Member Functions

Compressing Files

Constructors / Destructors

Decompressing Files

File Comments

Getting / Setting File Information

Loading Images

Overridables

Saving Images

Compressing Files

LMemoryFile::CompressBuffer

LMemoryFile::EndCompressBuffer

LMemoryFile::StartCompressBuffer

Constructors / Destructors

LMemoryFile::~LMemoryFile

LMemoryFile::LMemoryFile

Decompressing Files

LMemoryFile::Decompress

File Comments

LMemoryFile::ReadComment

Getting / Setting File Information

LMemoryFile::SetMemoryThresholds

LMemoryFile::GetMemoryThresholds

LMemoryFile::GetBitmapMemoryInfo

LMemoryFile::SetBitmapMemoryInfo

LMemoryFile::GetInfo

LMemoryFile::IsValid

LMemoryFile::ReadTag

Loading Images

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

Overridables

LMemoryFile::CompressBufferCallBack

LMemoryFile::DecompressMemoryCallBack

LMemoryFile::LoadMemoryCallBack

Saving Images

LMemoryFile::SaveBitmap

LMemoryFile::SaveBitmapBuffer

LMemoryFile::SaveBitmapBufferCallBack

LMemoryFile::SaveFileBuffer

LMemoryFile::SaveFileBufferCallBack

LMemoryFile::SaveFileCallBack


LOptimize

Description

The LOptimize class is derived from the LBase class, and provides functionality for optimizing certain image file formats, by saving images using the optimal bits per pixel, based on specific optimization options.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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.

See Also

Member Functions, Class Hierarchy Chart, Parent class


LOptimize::Class Members

Member Functions

Return to LOptimize


LOptimize::Member Functions

Constructors/Destructors

Getting Optimization Options

Optimizing Images

Return to LMarker

Constructors / Destructors

LOptimize::LOptimize

LOptimize::~LOptimize

Getting Optimization Options

LOptimize::GetDefaultOptions

Optimizing Images

LOptimize::OptimizeBuffer

LOptimize::OptimizeBufferCallBack

LOptimize::OptimizeDir

LOptimize::OptimizeDirCallBack


LPaint

Description

The LPaint class is derived from LDraw, and extends it to contain the functions for painting bitmap images. These functions handle painting bitmaps as well as displaying bitmap regions.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LPaint::Class Members

Member Functions

Return to LPaint


LPaint::Member Functions

Constructors / Destructors

Displaying Bitmap Regions

Painting Bitmaps

Constructors / Destructors

LPaint::~LPaint

LPaint::LPaint

Displaying Bitmap Regions

LPaint::PaintDCOverlay

LPaint::ColorRgn

LPaint::FrameRgn

LPaint::PaintRgnDC

LPaint::PaintRgnDCBuffer

Painting Bitmaps

LPaint::PaintDC

LPaint::PaintDCBuffer


LPaintEffect

Description

The LPaintEffect class derives from LDraw, and extends it to contain functions for displaying bitmaps and bitmap regions with LEADTOOLS paint effects. For a list of the LEADTOOLS paint effects, refer to Effect Types. LPaintEffect also contains functionality for drawing gradients, patterns, 3dShapes, and 3dText.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LPaintEffect::Class Members

Member Functions

Return to LPaintEffect


LPaintEffect::Member Functions

Constructors / Destructors

Draw Properties

Background / Foreground

Bitmap

Inner Band

Middle Band

Outer Band

Drawing a Frame

Drawing Gradients

Drawing Paint Effects

Drawing Patterns

Drawing Shapes

Drawing Text

Drawing Transitions

Constructors / Destructors

LPaintEffect::~LPaintEffect

LPaintEffect::LPaintEffect

Draw Properties

Background / Foreground

LPaintEffect::GetBackgroundColor

LPaintEffect::GetForegroundColor

LPaintEffect::SetBackgroundColor

LPaintEffect::SetForegroundColor

Bitmap

LPaintEffect::SetFillBitmap

LPaintEffect::GetFillBitmap

Inner Band

LPaintEffect::SetInnerBandHilite

LPaintEffect::GetInnerBandHilite

LPaintEffect::SetInnerBandShadowColor

LPaintEffect::GetInnerBandShadowColor

LPaintEffect::SetInnerBandWidth

LPainteffect::GetInnerBandWidth

Middle Band

LPaintEffect::SetMiddleBandWidth

LPaintEffect::GetMiddleBandWidth

LPaintEffect::SetMiddleBandColor

LPaintEffect::GetMiddleBandColor

Outer Band

LPaintEffect::SetOuterBandHilite

LPaintEffect::GetOuterBandHilite

LPaintEffect::SetOuterBandShadowColor

LPaintEffect::GetOuterBandShadowColor

LPaintEffect::SetOuterBandWidth

LPainteffect::GetOuterBandWidth

Drawing a Frame

LPaintEffect::DrawFrame

Drawing Gradients

LPaintEffect::DrawGradient

LPaintEffect::GetGradientParameters

LPaintEffect::SetGradientParameters

Drawing Paint Effects

LPaintEffect::EffectBlt

LPaintEffect::GetEffectParameters

LPaintEffect::PaintBitmap

LPaintEffect::SetEffectParameters

Drawing Patterns

LPaintEffect::DrawPattern

Drawing Shapes

LPaintEffect::Draw3dShape

LPaintEffect::GetShapeParameters

LPaintEffect::SetShapeParameters

Drawing Text

LPaintEffect::Draw3dText

LPaintEffect::GetTextParameters

LPaintEffect::SetTextParameters

Drawing Transitions

LPaintEffect::PaintTransition

LPaintEffect::GetTransitionParameters

LPaintEffect::SetTransitionParameters


LPlayBack

Description

The LPlayBack class is derived from LBase. This class contains the support for creating, and managing animation playbacks using bitmap lists. With this class, you can create, start, and stop playback of bitmap lists in order to create animation. This class provides functions for adding items to the playback, removing items from the playback, and processing frames of the playback.

If you derive a class from LPlayBack, the macros defined in Wrapper Macros may be helpful.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

See Also

Class Members, Class Hierarchy Chart, Parent class


LPlayBack::Class Members

Member Functions

Return to LPlayBack


LPlayBack::Member Functions

Constructors / Destructors

Creating an Animation PlayBack

Destroying an Animation PlayBack

Getting / Setting Animation Information

Modifying the Animation

Processing an Animation PlayBack

Constructors / Destructors

LPlayBack::LPlayBack

LPlayBack::~LPlayBack

Creating an Animation PlayBack

LPlayBack::Create

LPlayBack::IsCreated

Destroying an Animation PlayBack

LPlayBack::Destroy

Getting / Setting Animation Information

LPlayBack::ClearUpdateRect

LPlayBack::GetDelay

LPlayBack::GetIndex

LPlayBack::GetState

LPlayBack::GetUpdateRect

LPlayBack::SetIndex

Modifying the Animation

LPlayBack::Append

LPlayBack::ValidateLines

Processing an Animation PlayBack

LPlayBack::CancelWait

LPlayBack::Process


LPrint

Description

The LPrint class is derived from LBase and provides functions for printing bitmap objects. These functions allow you to specify the location and size of the printed image. Optionally, you can let the print functions center and/or size the image to fit the printed page. With the LPrint object, you can print multiple images per page, and can use the same device context for other drawing your application may need to do.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
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

Class Members, Class Hierarchy Chart, Parent class


LPrint::Class Members

Member Functions

Return to LPrint


LPrint::Member Functions

Constructors / Destructors

Before Printing

Printing

Constructors / Destructors

LPrint::LPrint

LPrint::~LPrint

Before Printing

LPrint::GetPrinterDC

LPrint::IsValid

LPrint::SetBitmap

Printing

LPrint::Print

LPrint::PrintFast


LScanner

Description

The LScanner class is derived from the LBase class. This class is the base class for the LEADTOOLS Class Library scanning interface classes. This class contains some basic scanning interface functions that are re-used in the derived class LIsis. You can use this class as a basis from which you can derive your own scanning class for scanner interfaces not supported by LEADTOOLS.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LScanner::Class Members

Data Members

Member Functions

Return to LScan


LScanner::Data Members

LScan::Data Members

LScanner::m_pBitmap


LScanner::Member Functions

LScan::Member Functions

Constructors / Destructors

LScanner::LScanner

LScanner::~LScanner

Miscellaneous

LScanner::IsValid

LScanner::SetBitmap

LScanner::SetWindow


LScanner::Derived Classes

The following classes are derived directly from LScan:

LIsis


LScreenCapture

Description

The LScreenCapture class is derived from LBase. This class provides the functionality for capturing images from the screen. It provides functions to capture a specific window, active window, active client area, mouse cursor, Windows object, user-defined area, menus and resources from executable files. This class supports capturing a single image or multiple images with a single capture session.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTKRN
LTDIS
LTSCR

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

Class Members, Class Hierarchy Chart, Parent class


LScreenCapture::Class Members

Data Members

Member Functions

Return to LScreenCapture


LScreenCapture::Data Members

LScreenCapture::m_pBitmap


LScreenCapture::Member Functions

Capturing

Constructors / Destructors

Getting/Setting Capture Information

Getting/Setting Capture Options

Overridables

Capturing

LScreenCapture::CaptureActiveClient

LScreenCapture::CaptureActiveWindow

LScreenCapture::CaptureArea

LScreenCapture::CaptureFromEXE

LScreenCapture::CaptureFromEXEDlg

LScreenCapture::CaptureFullScreen

LScreenCapture::CaptureMenuUnderCursor

LScreenCapture::CaptureMouseCursor

LScreenCapture::CaptureSelectedObject

LScreenCapture::CaptureWallpaper

LScreenCapture::CaptureWindow

LScreenCapture::CaptureWindowUnderCursor

LScreenCapture::StopCapture

Constructors / Destructors

LScreenCapture::~LScreenCapture

LScreenCapture::LScreenCapture

Getting / Setting Capture Information

LScreenCapture::ScreenCaptureHelpCallBack

LScreenCapture::GetCaptureOption

LScreenCapture::SetCaptureOption

LScreenCapture::CaptureGetResCount

LScreenCapture::IsCaptureActive

LScreenCapture::IsValid

LScreenCapture::SetBitmap

Getting / Setting Capture Options

LScreenCapture::CaptureAreaOptionDlg

LScreenCapture::CaptureObjectOptionDlg

LScreenCapture::GetCaptureAreaOptions

LScreenCapture::GetCaptureObjectOptions

LScreenCapture::GetCaptureOptions

LScreenCapture::SetCaptureAreaOptions

LScreenCapture::SetCaptureObjectOptions

LScreenCapture::SetCaptureOptionDlg

LScreenCapture::SetCaptureOptions

LScreenCapture::SetDefaultAreaOptions

LScreenCapture::SetDefaultCaptureOptions

LScreenCapture::SetDefaultObjectOptions

Overridables

LScreenCapture::CaptureHotKeyCallBack

LScreenCapture::ScreenCaptureCallBack


LSettings

Description

The LSettings class is derived from the LBase class. This class provides functions for unlocking optional LEADTOOLS features and for testing the availability of those options.

You may find it useful to call the static member functions of this class directly, as (ClassName::Function), without declaring an object. For example, the following is valid, and will compile:

nMode = LBitmapSettings::GetDisplayMode();

This returns the current global setting for the paint contrast.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

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

Class Members, Class Hierarchy Chart, Derived Classes, Parent class


LSettings::Class Members

Member Functions

Return to LSettings


LSettings::Member Functions

Constructors / Destructors

Support

Constructors / Destructors

LSettings::LSettings

LSettings::~LSettings

Support

LSettings::IsSupportLocked

LSettings::UnlockSupport


LSettings::Derived Classes

The following classes are derived directly from LScan:

LBitmapSettings

LFileSettings


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.


Class Library Function Groups

Raster Image Functions

Creation, Deletion, and Copying

Displaying and Printing

Document Imaging

Analysis

Floaters

Image Processing

Input and Output

Palettes

Region Processing

Screen Capture

Working with GeoKeys

ICC Profile Functions

Annotation Functions (Document/Medical only)

Automation

Creation, Deletion, and Copying

Displaying and Printing

Global Properties

Hyperlinks

Input and Output

Object Information

Object Properties

Realizing to a Bitmap

Security

Size, Position, and Shape

Support Functions

Overridables

Version and License Information

Callbacks

Miscellaneous Functions


Raster Image Functions: Palettes

Raster Image Functions:
Palettes

Implementing palettes:

LBitmapBase::CreatePaintPalette

LBitmapBase::DupPalette

LBitmapBase::GetFixedPalette

LBitmapBase::GetColors

LBitmapBase::PutColors

LBitmapBase::TranslateColor

LBitmapBase::IsGrayScale

Implementing window leveling:

Note:

This topic is for Document/Medical Imaging edition only.

LBitmap::WindowLevelBitmap

LBitmap::WindowLevel

LBitmap::GetMinMaxBits

LBitmap::GetMinMaxVal


Raster Image Functions: Floaters

Raster Image Functions:
Floaters

LBitmapWindow::GetAutoRgnToFloater

LBitmapWindow::GetFloater

LBitmapWindow::GetFloaterRgn

LBitmapWindow::HasFloater

LBitmapWindow::SetAutoRgnToFloater


Raster Image Functions: Screen Capture

Raster Image Functions:
Screen Capture

LScreenCapture::CaptureActiveClient

LScreenCapture::CaptureActiveWindow

LScreenCapture::CaptureArea

LScreenCapture::CaptureAreaOptionDlg

LScreenCapture::CaptureFromEXE

LScreenCapture::CaptureFromEXEDlg

LScreenCapture::CaptureFullScreen

LScreenCapture::CaptureMenuUnderCursor

LScreenCapture::CaptureMouseCursor

LScreenCapture::CaptureSelectedObject

LScreenCapture::CaptureWallPaper

LScreenCapture::CaptureWindowUnderCursor

LScreenCapture::StopCapture


Raster Image Functions: Working with GeoKeys

Raster Image Functions:
Working with GeoKeys

LFile::SetGeoKey

LFile::GetGeoKey

LFile::WriteGeoKey

LFile::ReadGeoKey

LFile::EnumGeoKeys

LFile::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 the Clipboard


Raster Image Functions: Copying Images

Raster Image Functions:
Creation, Deletion, and Copying
Copying Images

LBitmapBase::Copy

LBitmapBase::operator=

LBitmapBase::CopyData

LBitmapBase::CopyHandle

LBitmapBase::CopyRect

LBitmapBase::Combine

LBitmapBase::Underlay


Raster Image Functions: Creating and Deleting Images

Raster Image Functions:
Creation, Deletion, and Copying
Creating and Deleting Images

LBitmapBase::Create

LBitmapBase::Initialize

LBitmapBase::Allocate

LBitmapBase::Free

LFile::DeletePage

LFileSettings::GetTempDirectory

LFileSettings::SetTempDirectory

LMemoryFile::GetBitmapMemoryInfo

LMemoryFile::GetMemoryThresholds

LMemoryFile::SetBitmapMemoryInfo

LMemoryFile::SetMemoryThresholds


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:

LAnimationWindow::Load

LFile::LoadBitmapList

LBitmapList::Load

LAnimationWindow::Save

LFile::SaveBitmapList

LBitmapList::Save

LBitmapList::Create

LBitmapList::Destroy

LBitmapList::CopyItems

LBitmapList::operator=

Maintaining list items:

LBitmapList::GetItemsCount

LBitmapList::InsertItem

LBitmapList::RemoveItem

LBitmapList::DeleteItems

LBitmapList::ColorResItems

LBitmapBase::TranslateColor

Accessing bitmaps in a list:

LBitmapList::GetItem

LBitmapList::GetFirstItem

LBitmapList::GetNextItem

LBitmapList::GetPreviousItem

LBitmapList::GetLastItem

LBitmapList::SetItem


Raster Image Functions: Using DIBs and DDBs

Raster Image Functions:
Creation, Deletion, and Copying
Using DIBs and DDBs

DIB functions:

LBitmapBase::ConvertFromDIB

LBitmapBase::ConvertToDIB

LChange::ChangeFromDIB

LChange::ChangeToDIB

DDB functions:

LBitmapBase::ConvertFromDDB

LBitmapBase::ConvertToDDB

LChange::ChangeFromDDB

LChange::ChangeToDDB


Raster Image Functions: Using the Clipboard

Raster Image Functions:
Creation, Deletion, and Copying
Using the Clipboard

LBitmapBase::IsClipboardReady

LBitmapBase::CopyFromClipboard

LBitmapBase::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

High-level classes for Displaying Images:

LBitmapWindow

LAnimationWindow

LAnnotationWindow

Setting and Getting Display options:

LBitmapBase::CreatePaintPalette

LBitmapBase::GetDisplayMode

LBitmapBase::SetDisplayMode

LBitmapBase::GetPaintContrast

LBitmapBase::SetPaintContrast

LBitmapBase::GetPaintGamma

LBitmapBase::SetPaintGamma

LBitmapBase::GetPaintIntensity

LBitmapBase::SetPaintIntensity

LBitmap::WindowLevel

LBitmapSettings::GetDisplayMode

LBitmapSettings::SetDisplayMode

LBitmapWindow::GetMagGlassOptions

LBitmapWindow::GetZoomViewProps

LBitmapWindow::HasZoomView

LBitmapWindow::SetMagGlassOptions

LBitmapWindow::UpdateZoomView

LBitmapWindow::IsToolTypeMagGlass

Painting a bitmap:

LPaint::PaintDC

LPaint::PaintDCBuffer

LPaint::PaintDCCMYKArray

LPaint::PaintDCOverlay

LPaintEffect::PaintBitmap

LPaintEffect::EffectBlt

Painting a bitmap's region:

LPaint::PaintRgnDC

LPaint::PaintRgnDCBuffer

LPaintEffect::PaintRgnDCEffect

Using a PanWindow:

LBitmapWindow::CreatePanWnd

LBitmapWindow::DestroyPanWnd

LBitmapWindow::UpdatePanWnd

LBitmapWindow::PanWndCallBack

Using a Magnifying Glass

LBitmapWindow::GetMagGlassOptions

LBitmapWindow::IsToolTypeMagGlass

LBitmapWindow::MagGlassCallBack

LBitmapWindow::SetMagGlassOptions

LBitmapWindow::SetToolType

Using a ZoomView

LBitmapWindow::AddZoomView

LBitmapWindow::DestroyZoomView

LBitmapWindow::GetZoomViewProps

LBitmapWindow::GetZoomViewsCount

LBitmapWindow::HasZoomView

LBitmapWindow::UpdateZoomView

LBitmapWindow::EnableHiliteZoomView

LBitmapWindow::IsHiliteZoomViewEnabled

Thumbnail Browser

LFile::BrowseDir

LFile::BrowseDirCallBack

ImageList Control

LImageListControl::LImageListControl

LImageListControl::~LImageListControl

LImageListControl::Clear

LImageListControl::CreateControl

LImageListControl::DrawItem

LImageListControl::EnableKeyboard

LImageListControl::EnsureVisible

LImageListControl::ExportBitmapList

LImageListControl::GetBackColor

LImageListControl::GetBorderColor

LImageListControl::GetColumnCount

LImageListControl::GetFirstVisible

LImageListControl::GetItem

LImageListControl::GetItemCount

LImageListControl::GetItemOptions

LImageListControl::GetRowCount

LImageListControl::GetScrollStyle

LImageListControl::GetSelectCount

LImageListControl::GetSelectedItems

LImageListControl::GetSelectionOptions

LImageListControl::GetViewSize

LImageListControl::HitTest

LImageListControl::ImportBitmapList

LImageListControl::Insert

LImageListControl::ItemSelected

ImageListControl::m_hWnd

LImageListControl::MsgProcCallBack

LImageListControl::Remove

LImageListControl::ScrollItems

LImageListControl::SelectAll

LImageListControl::SetBackColor

LImageListControl::SetBorderColor

LImageListControl::SetItemOptions

LImageListControl::SetScrollStyle

LImageListControl::SetSelectionBitmap

LImageListControl::SetSelectionOptions

LImageListControl::Sort

LImageListControl::SortExt

LImageListControl::Update

Using double buffering to minimize flicker

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

See Also

Implementing Transparency


Raster Image Functions: Playing Animated Images

Raster Image Functions:
Displaying and Printing
Playing Animated Images

High-level classes for Playing Animated Images:

LAnimationWindow

Creating and deleting playbacks:

LPlayBack::Create

LPlayBack::Destroy

Creating a list during a playback:

LPlayBack::Append

LPlayBack::ValidateLines

Running playbacks:

LPlayBack::Process

LPlayBack::GetDelay

LPlayBack::CancelWait

LPlayBack::ClearUpdateRect

LPlayBack::GetIndex

LPlayBack::GetState

LPlayBack::GetUpdateRect

LPlayBack::SetIndex

See Also

Implementing Transparency


Raster Image Functions: Printing Images

Raster Image Functions:
Displaying and Printing
Printing Images

LPrint::GetPrinterDC

LPrint::Print

LPrint::PrintFast


Raster Image Functions: Using Special Effects

Raster Image Functions:
Displaying and Printing
Using Special Effects

High-level classes for Using Special Effects:

LBitmapWindow

Painting bitmaps:

LPaintEffect::PaintBitmap

LPaintEffect::EffectBlt

Painting text:

LPaintEffect::Draw3dText

Painting shapes and patterns:

LPaintEffect::PaintTransition

LPaintEffect::Draw3dShape

LPaintEffect::DrawFrame

LPaintEffect::DrawGradient

LPaintEffect::DrawPattern

See Also

Implementing Transparency


Raster Image Functions: Document Imaging

Raster Image Functions:
Document Imaging

LBitmap::ApplyTransformationParameters

LBitmap::GetMarksCenterMass

LBitmap::GetTransformationParameters

LBitmap::IsRegMarkBitmap

LBitmap::SearchRegMarks

See Also

Detecting Registration Marks

How to Use the Registration Marks Demo


Raster Image Functions: Analysis

Raster Image Functions:
Analysis

Image Analysis

Object or Region Analysis


Raster Image Functions: Image Analysis

Raster Image Functions:
Analysis
Image Analysis

LBitmap::Correlation

LBitmap::CorrelationList

LBitmap::ColorizeGray

LBitmap::DigitalSubtract

LBitmap::DynamicBinary

LBitmap::GetFeretsDiameter

LBitmap::GetObjectInfo

LBitmap::GetStatisticsInfo

LBitmap::IntensityDetect

LBitmap::MultiScaleEnhancementBitmap

LBitmap::SelectData

LBitmap::Skeleton

LBitmap::SpatialFilter

LBitmap::SubtractBackground

LBitmap::UserFilter


Raster Image Functions: Object or Region Analysis

Raster Image Functions:
Analysis
Object or Region Analysis

LBitmap::Correlation

LBitmap::CorrelationList

LBitmap::GetFeretsDiameter

LBitmap::GetObjectInfo

LBitmap::GetRgnContourPoints

LBitmap::GetRgnPerimeterLength

LBitmap::SelectData

LBitmap::Skeleton

LBitmap::SpatialFilter

LBitmap::SubtractBackground

LBitmap::UserFilter


Raster Image Functions: Artistic Effects

Raster Image Functions:
Image Processing
Artistic Effects

LBitmap::AddShadow

LBitmap::Aging

LBitmap::BricksTexture

LBitmap::Canvas

LBitmap::Clouds

LBitmap::ColoredBalls

LBitmap::Cubism

LBitmap::DiffuseGlow

LBitmap::DisplaceMap

LBitmap::DiceEffect

LBitmap::DrawStar

LBitmap::Dry

LBitmap::Fragment

LBitmap::FunctionalLight

LBitmap::GlassEffect

LBitmap::LensFlare

LBitmap::Light

LBitmap::MaskConvolution

LBitmap::MosaicTiles

LBitmap::Ocean

LBitmap::Offset

LBitmap::Perspective

LBitmap::PlasmaFilter

LBitmap::Pointillist

LBitmap::PlaneBend

LBitmap::Plane

LBitmap::PuzzleEffect

LBitmap::RomanMosaic

LBitmap::RevEffect

LBitmap::RingEffect

LBitmap::Segment

LBitmap::Tunnel

LBitmap::Vignette

LBitmap::ZigZag


Raster Image Functions: Image Processing

Raster Image Functions:
Image Processing

Artistic Effects

Changing Brightness and Contrast

Cleaning - up 1-Bit Images

Combining Images

Comparing Images

Correcting Colors

Detecting and Enhancing Edges and Lines

Doing Color Expansion or Reduction

Doing Color Space Conversions

Doing Geometric Transformations

Drawing on a Bitmap

Filtering Images

Fourier Transform Functions

Getting and Setting Pixel Values

Getting or Setting Bitmap Information

Interpreting Bitmap Coordinates

Modifying Intensity Values

Processing an Image

Removing Noise

Using Histograms

Using the Alpha Channel

Working with Color Halftones, Halftones, and Grayscale Images


Raster Image Functions: Changing Brightness and Contrast

Raster Image Functions:
Image Processing
Changing Brightness and Contrast

LBitmap::AdaptiveContrast

LBitmap::Add

LBitmap::AddWeighted

LBitmap::ApplyLinearModalityLUT

LBitmap::ApplyLinearVOILUT

LBitmap::ApplyModalityLUT

LBitmap::ApplyVOILUT

LBitmap::AutoColorLevel

LBitmap::ChangeContrast

LBitmap::ChangeHue

LBitmap::ChangeIntensity

LBitmap::ChangeSaturation

LBitmap::ChangeHueSatIntBitmap

LBitmap::ColorIntensityBalance

LBitmap::ColorLevel

LBitmap::ColorMerge

LBitmap::ColorSeparate

LBitmap::ContBrightInt

LBitmap::DynamicBinary

LBitmap::GammaCorrect

LBitmap::GammaCorrectExt

LBitmap::GetHistogram

LBitmap::GetFunctionalLookupTable

LBitmap::GetUserLookupTable

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::LightControl

LBitmap::LocalHistoEqualize

LBitmap::MathFunction

LBitmap::Multiply

LBitmap::RemapHue

LBitmap::RemapIntensity

LBitmapBase::SetPaintContrast

LBitmapBase::SetPaintGamma

LBitmapBase::SetPaintIntensity

LBitmap::StretchIntensity

LBitmap::SubtractBackground


Raster Image Functions: Cleaning - up 1-Bit Images

Raster Image Functions:
Image Processing
 Cleaning - up 1-Bit Images

(Document/Medical only)

LBitmap::Smooth

LBitmap::SmoothCallBack

LBitmap::LineRemove

LBitmap::LineRemoveCallBack

LBitmap::BorderRemove

LBitmap::BorderRemoveCallBack

LBitmap::InvertedText

LBitmap::InvertedTextCallBack

LBitmap::DotRemove

LBitmap::DotRemoveCallBack

LBitmap::HolePunchRemove

LBitmap::HolePunchRemoveCallBack

See Also

Implementing Transparency


Raster Image Functions: Combining Images

Raster Image Functions:
Image Processing
Combining Images

LBitmap::Add

LBitmapBase::CombineBitmapWarp

LBitmap::AddBorder

LBitmap::AddFrame

LBitmap::AddWeighted

LBitmap::BumpMap

LBitmap::BricksTexture

LBitmap::Canvas

LBitmap::Clouds

LBitmap::DisplaceMap

LBitmap::Fragment

LBitmap::Vignette

LBitmap::Multiply

LBitmap::TextureAlphaBlend

LBitmapBase::AlphaBlend

LBitmapBase::Combine

LBitmapBase::CombineExt

LBItmapBase::CreateFadedMask

LBitmapBase::FeatherAlphaBlend

LBitmap::Picturize

LBitmap::PicturizeList

LBitmap::PicturizeSingle

LBitmapBase::Underlay

See Also

Processing an Image

Implementing Transparency


Raster Image Functions: Comparing Images

Raster Image Functions:
Image Processing
Comparing Images

LBitmap::Correlation

LBitmap::CorrelationList


Raster Image Functions: Correcting Colors

Raster Image Functions:
Image Processing
Correcting Colors

LBitmap::AdjustTint

LBitmap::AntiAlias

LBitmap::ApplyMathLogic

LBitmap::AutoColorLevel

LBitmap::BalanceColors

LBitmap::BumpMap

LBitmap::ChangeHue

LBitmap::ChangeSaturation

LBitmap::ChannelMix

LBitmap::ChangeHueSatIntBitmap

LBitmap::ColorHalfTone

LBitmap::ColorReplace

LBitmap::ColorThreshold

LBitmap::ColorIntensityBalance

LBitmap::ColorizeGray

LBitmap::ColorLevel

LBitmap::Cubism

LBitmap::DrawStar

LBitmap::Dry

LBitmap::FreePlaneBend

LBitmap::FreeRadBend

LBitmap::GlassEffect

LBitmap::GlowFilter

LBitmap::Invert

LBitmap::LensFlare

LBitmap::Light

LBitmap::LightControl

LBitmap::Ocean

LBitmap::SampleTarget

LBitmap::PlaneBend

LBitmap::Plane

LBitmap::SampleTarget

LBitmap::SelectiveColor

LBitmap::SmoothEdges

LBitmap::SelectData

LBitmap::ShiftData

LBitmap::SwapColors

LBitmap::RemoveRedeye

LBitmap::Tunnel


Raster Image Functions: Detecting and Enhancing Edges and Lines

Raster Image Functions:
Image Processing
Detecting and Enhancing Edges and Lines

LBitmapBase::Combine

LBitmap::DiffuseGlow

LBitmap::DirectionEdgeStatistical

LBitmap::EdgeDetectEffect

LBitmap::EdgeDetector

LBitmap::EdgeDetectStatistical

LBitmap::GaussianFilter

LBitmap::GlowFilter

LBitmap::HighPassFilter

LBitmap::IntensityDetect

LBitmap::MaskConvolution

LBitmap::Sharpen

LBitmap::Skeleton

LBitmap::SmoothEdges

LBitmap::SpatialFilter

LBitmap::UnsharpMask


Raster Image Functions: Doing Color Expansion or Reduction

Raster Image Functions:
Image Processing
Doing Color Expansion or Reduction

Automated color reduction:

LBitmapBase::SetDefaultDithering

LBitmapSettings::DefaultDithering

Main color resolution functions:

LBitmapBase::ColorRes

LBitmapList::ColorResItems

LAnimationWindow::ColorResItems

Support for dithering to a custom palette:

LBitmapSettings::CreateUserMatchTable

LBitmapSettings::SetUserMatchTable

LBitmapSettings::FreeUserMatchTable

Specialized resolution functions:

LBitmap::AutoBinary

LBitmap::ChannelMix

LBitmap::ColorHalfTone

LBitmap::ConvertToColoredGray

LBitmap::Desaturate

LBitmap::DynamicBinary

LBitmap::GrayScaleExt

LBitmap::GrayScaleToDuotone

LBitmap::GrayScaleToMultitone

LBitmap::HalfTone

LBitmap::HalfTonePattern

LBitmap::Pointillist

LBitmap::SampleTarget

LBitmap::Segment

LBitmap::WindowLevelBitmap ( Medical Imaging only)

LBitmapBase::GrayScale

Low-level color resolution functions:

LBitmapBase::StartDithering

LBitmapBase::DitherLine

LBitmapBase::StopDithering

LBuffer::ConvertBuffer

See Also

Processing an Image


Raster Image Functions: Doing Color Space Conversions

Raster Image Functions:
Image Processing
Doing Color Space Conversions

LBitmap::ColorSeparate

LBitmap::ColorThreshold

LBitmap::ColorMerge

LBitmapBase::ColorRes

LBuffer::ConvertColorSpace

LBuffer::ConvertBuffer

LBitmapSettings::CreateUserMatchTable

LBitmapSettings::DefaultDithering

LBitmap::GammaCorrectExt

See Also

Processing an Image


Raster Image Functions: Doing Geometric Transformations

Raster Image Functions:
Image Processing
Doing Geometric Transformations

High-level resizing alternatives:

LBitmapBase::Size

LBitmapBase::Resample

LBitmapBase::Resize

High-level trimming alternatives:

LBitmap::AutoTrim

LBitmap::GetAutoTrimRect

LBitmapBase::Trim

Other high-level transformation functions:

LBitmap::Bending

LBitmap::BricksTexture

LBitmap::Cylindrical

LBitmap::Deskew ( Document/Medical only)

LBitmap::DeskewExt

LBitmap::DisplaceMap

LBitmap::FreeHandShear

LBitmap::FreeHandWave

LBitmap::FreePlaneBend

LBitmap::FreeRadBend

LBitmap::Impressionist

LBitmap::MosaicTiles

LBitmap::Offset

LBitmap::Perspective

LBitmap::PlaneBend

LBitmap::Plane

LBitmap::Polar

LBitmap::PlasmaFilter

LBitmap::Punch

LBitmap::RadialBlur

LBitmap::RadWave

LBitmap::Ripple

LBitmap::RomanMosaic

LBitmap::Spherize

LBitmap::Swirl

LBitmap::Tunnel

LBitmap::Wave

LBitmap::Wind

LBitmap::ZigZag

LBitmap::ZoomBlur

LBitmap::ZoomWave

LBitmapBase::Flip

LBitmapBase::Reverse

LBitmapBase::Rotate

LBitmapBase::RotateFine

LBitmapBase::RotateViewPerspective ( Document/Medical only)

LBitmapBase::Shear

LBitmapBase::ChangeViewPerspective

LBitmapBase::ChangeViewPerspective

LFile::ReadFileTransforms

LFile::LoadCMYKArray

LFile::TransformFile

LFile::SaveCMYKArray

LFile::WriteFileTransforms

Low-level resizing functions:

LBuffer::StartResize

LBuffer::Resize

LBuffer::StopResize

See Also

Processing an Image


Raster Image Functions: Drawing on a Bitmap

Raster Image Functions:
Image Processing
Drawing on a Bitmap

LBitmapBase::CreateLeadDC

LBitmapBase::DeleteLeadDC

See Also

Processing an Image


Raster Image Functions: Filtering Images

Raster Image Functions:
Image Processing
Filtering Images

General Filters

LBitmap::BinaryFilter

LBitmap::EdgeDetector

LBitmap::SpatialFilter

Specialized Spatial Filters

LBitmap::AddNoise

LBitmap::AddShadow

LBitmap::AutoBinary

LBitmap::AverageFilter

LBitmap::BricksTexture

LBitmap::ColoredPencil

LBitmap::Deskew

LBitmap::DeskewExt

LBitmap::Despeckle

LBitmap::DiffuseGlow

LBitmap::DynamicBinary

LBitmap::DirectionEdgeStatistical

LBitmap::EdgeDetectEffect

LBitmap::EdgeDetectStatistical

LBitmap::Emboss

LBitmap::GaussianFilter

LBitmap::GlowFilter

LBitmap::HalfTonePattern

LBitmap::HighPassFilter

LBitmap::Impressionist

LBitmap::IntensityDetect

LBitmap::MaskConvolution

LBitmap::MedianFilter

LBitmap::Mosaic

LBitmap::MotionBlur

LBitmap::Oilify

LBitmap::Perspective

LBitmap::PlasmaFilter

LBitmap::Pointillist

LBitmap::Perlin

LBitmap::Pixelate

LBitmap::Posterize

LBitmap::RadialBlur

LBitmap::Sharpen

LBitmap::SmoothEdges

LBitmap::Solarize

LBitmap::UnsharpMask

LBitmap::ZoomBlur

Specialized Binary Filters

LBitmap::MaxFilter

LBitmap::MinFilter

LBitmap::Skeleton

See Also

Removing Noise

Detecting and Enhancing Edges and Lines

Applying Artistic Effects


Raster Image Functions: Fourier Transform Functions

Raster Image Functions:
Image Processing
Fourier Transform Functions

LBitmap::AllocFTArray

LBitmap::DFT

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FTDisplay

LBitmap::FrqFilter

LBitmap::FrqFilterMask


Raster Image Functions: Getting and Setting Pixel Values

Raster Image Functions:
Image Processing
Getting and Setting Pixel Values

High-level functions:

LBitmapBase::Clear

LBitmapBase::ClearNegativePixels

LBitmapBase::ConvertSignedToUnsigned

LBitmapBase::Fill

LBitmapBase::GetColorCount

LBitmap::ColorReplace

LBitmap::ColorThreshold

LBitmap::RemoveRedEye

LBitmap::ShiftMinimumToZero

LBitmap::ShiftZeroToNegative

Lock and release for low-level functions:

LBitmapBase::Access

LBitmapBase::Release

Low-level functions:

LBitmapBase::GetPixelColor

LBitmapBase::PutPixelColor

LBitmapBase::GetPixelData

LBitmapBase::PutPixelData

LBitmapBase::GetRow

LBitmapBase::PutRow

LBitmapBase::GetRowCol

LBitmapBase::PutRowCol

LBitmap::LineProfile


Raster Image Functions: Getting or Setting Bitmap Information

Raster Image Functions:
Image Processing
 Getting or Setting Bitmap Information

Dimensions, Color order, Size, Resolution

LBitmapBase::GetBitsPerPixel

LBitmapBase::GetBytesPerLine

LBitmapBase::GetColorCount

LBitmapBase::GetColorOrder

LBitmapBase::GetHeight

LBitmapBase::GetMemSize

LBitmapBase::GetWidth

LBitmapBase::GetXResolution

LBitmapBase::GetYResolution

Memory Associated with Bitmaps

LBitmapBase::GetMemSize

LBitmapBase::Is1BitCompressed

LBitmapBase::IsAllocated

LBitmapBase::IsMemoryLocked

LBitmapBase::IsUsingConventionalMemory

LBitmapBase::IsUsingDiskMemory

Display Characteristics

LBitmapBase::GetDefaultDithering

LBitmapBase::GetDitheringMethod

LBitmapBase::GetPaintContrast

LBitmapBase::GetPaintGamma

LBitmapBase::GetPaintIntensity

General Information

LBitmapBase::GetHandle

LBitmapBase::GetViewPerspective

LBitmapBase::HasRgn

LBitmapBase::IsGrayScale

LBitmapBase::IsInterlaced

LBitmapBase::IsPixelsSigned

LBitmapBase::IsTiled

Setting Bitmap Information

LBitmapBase::Initialize

LBitmapBase::SetHandle

LBitmapBase::SetDitheringMethod

LBitmapBase::SetXResolution

LBitmapBase::SetYResolution


Raster Image Functions: Interpreting Bitmap Coordinates

Raster Image Functions:
Image Processing
Interpreting Bitmap Coordinates

LBitmapBase::PointFromBitmap

LBitmapBase::PointToBitmap

LBitmapBase::RectFromBitmap

LBitmapBase::RectToBitmap

LBitmapBase::ChangeViewPerspective

LBitmapBase::RotateViewPerspective ( Document/Medical only)


Raster Image Functions: Modifying Intensity Values

Raster Image Functions:
Image Processing
Modifying Intensity Values

For overall brightness and contrast:

LBitmap::ApplyLinearModalityLUT

LBitmap::ApplyLinearVOILUT

LBitmap::ApplyModalityLUT

LBitmap::ApplyVOILUT

LBitmap::Add

LBitmap::AdaptiveContrast

LBitmap::AddWeighted

LBitmap::AdjustTint

LBitmap::AutoColorLevel

LBitmap::ChangeContrast

LBitmap::ChangeIntensity

LBitmap::ColorLevel

LBitmap::GammaCorrect

LBitmap::GammaCorrectExt

LBitmap::GetFunctionalLookupTable

LBitmap::GetUserLookupTable

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::Light

LBitmap::LightControl

LBitmap::LocalHistoEqualize

LBitmap::Multiply

LBitmap::StretchIntensity

LBitmap::SubtractBackground

LFile::ReadFileTransforms

LFile::WriteFileTransforms

For color changes:

LBitmap::Aging

LBitmap::ApplyMathLogic

LBitmap::BalanceColors

LBitmap::ChangeHue

LBitmap::ChangeHueSatIntBitmap

LBitmap::ChangeSaturation

LBitmap::ChannelMix

LBitmap::ColorIntensityBalance

LBitmap::ColorizeGray

LBitmap::ColorMerge

LBitmap::ColorReplace

LBitmap::ColorSeparate

LBitmap::ColorThreshold

LBitmap::ContBrightInt

LBitmap::ConvertToColoredGray

LBitmap::Desaturate

LBitmap::DigitalSubtract

LBitmap::FunctionalLight

LBitmap::Invert

LBitmap::MathFunction

LBitmap::MultiScaleEnhancementBitmap

LBitmap::RemapHue

LBitmap::RemoveRedEye

LBitmap::SampleTarget

LBitmap::Segment

LBitmap::SelectData

LBitmap::SelectiveColor

LBitmap::ShiftData

LBitmap::SwapColors

LBuffer::ConvertColorSpace

LFile::ReadFileTransforms

LFile::WriteFileTransforms

For filtering:

LBitmap::DynamicBinary

LBitmap::GaussianFilter

LBitmap::HighPassFilter

LBitmap::IntensityDetect

LBitmap::IntensityDetect

LBitmap::Segment

LBitmap::UserFilter

LFile::ReadFileTransforms

LBitmap::RemoveRedEye

LFile::WriteFileTransforms

For low-level manipulation:

LBitmap::Deinterlace

LBitmap::RemapHue

LBitmap::RemapIntensity

For special Effects:

LBitmap::ColoredPencil

LBitmap::ColoredBalls

LBitmap::DiffuseGlow

LBitmap::LensFlare

See Also

Changing Brightness and Contrast

Correcting Colors


Raster Image Functions: Processing an Image

Raster Image Functions:
Image Processing
Processing an Image

LBitmap::AddBorder

LBitmap::AddFrame

LBitmapBase::AlphaBlend

LBitmap::BricksTexture

LBitmap::BumpMap

LBitmap::Canvas

LBitmap::ColorMerge

LBitmap::ColorSeparate

LBitmapBase::CombineExt

LBitmapBase::Combine

LBitmapBase::CombineBitmapWarp

LBuffer::ConvertColorSpace

LBitmap::Correlation

LBitmap::CorrelationList

LBitmapBase::CreateFadedMask

LBitmapBase::CreateLeadDC

LBitmap::DeskewExt ( Document/Medical only)

LBitmap::Deskew

LBitmap::DigitalSubtract

LBitmap::DisplaceMap

LBitmapBase::FeatherAlphaBlend

LBitmapBase::Flip

LBitmap::GetMinMaxBits ( Medical only)

LBitmap::GetMinMaxVal ( Medical only)

LBitmap::Perspective

LBitmap::Picturize

LBitmap::PicturizeList

LBitmap::PicturizeSingle

LBitmapBase::Reverse

LBitmapBase::Rotate

LBitmapBase::Size

LBitmap::TextureAlphaBlend

LFile::TransformFile

LBitmapBase::Underlay

LBitmap::WindowLevel ( DocumentMedical only)

LBitmap::WindowLevelFillLUT ( DocumentMedical only)


Raster Image Functions: Removing Noise

Raster Image Functions:
Image Processing
Removing Noise

LBitmap::Add

LBitmap::AddWeighted

LBitmap::AllocFTArray

LBitmap::AutoBinary

LBitmap::AverageFilter

LBitmap::BinaryFilter

LBitmapBase::Combine

LBitmap::Deinterlace

LBitmap::Despeckle

LBitmap::DFT

LBitmap::DynamicBinary

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FrqFilter

LBitmap::FrqFilterMask

LBitmap::FTDisplay

LBitmap::GaussianFilter

LBitmap::HighPassFilter

LBitmap::MaxFilter

LBitmap::MedianFilter

LBitmap::MinFilter

LBitmap::SmoothEdges

LBitmap::UnsharpMask


Raster Image Functions: Using Histograms

Raster Image Functions:
Image Processing
Using Histograms

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::GetHistogram

See Also

Changing Brightness and Contrast


Raster Image Functions: Using the Alpha Channel

Raster Image Functions:
Image Processing
Using the Alpha Channel

LBitmapBase::CreateAlphaBitmap

LBitmapBase::SetAlpha

LBitmapRgn::CreateMaskFromBitmapRgn

LBitmapRgn::SetRgnFromMask

See Also

Implementing Transparency


Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Raster Image Functions:
Image Processing
Working with Color Halftones, Halftones, and Grayscale Images

Creating and working with color halftones

LBitmap::AutoColorLevel

LBitmap::ChannelMix

LBitmap::ColorLevel

LBitmap::ColorMerge

LBitmap::ColorSeparate

LBuffer::ConvertColorSpace

LBitmap::ColorHalfTone

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::SelectiveColor

LBitmap::SelectData ( Document/Medical only)

LBitmap::ShiftData ( Document/Medical only)

Creating and working with halftone images

LBitmapSettings::DefaultDithering

LBitmap::HalfTone

LBitmap::HalfTonePattern

Creating and working with grayscale images

LBitmap::ColorizeGray

LBitmap::ConvertToColoredGray

LBitmap::Desaturate

LBitmapBase::GrayScale

LBitmap::GrayScaleExt

LBitmap::GrayScaleToDuotone

LBitmap::GrayScaleToMultitone

LBitmapBase::IsGrayScale

LBitmap::SelectData ( Document/Medical only)

LBitmap::ShiftData ( Document/Medical only)

Changing the Highlight pen and Cursor Style (Document/Medical only)

LAnnAutomation::SetAutoCursor

LAnnAutomation::SetAutoHilightPen

Getting information about grayscale images

LBitmap::GetMinMaxBits (Document/Medical only)

LBitmap::GetMinMaxVal (Document/Medical only)

LBitmap::GetHistogram (Document/Medical only)

LBitmapBase::IsGrayScale

Getting information about color images

LBitmapBase::GetColorCount

LBitmapBase::GetColors

LBitmap::GetHistogram

LBitmap::GetStatisticsInfo

Window leveling (Document/Medical only)

LBitmap::GetMinMaxBits

LBitmap::GetMinMaxVal

LBitmap::WindowLevel

LBitmap::WindowLevelFillLUT


Raster Image Functions: Input and Output

Raster Image Functions:
Input and Output

Converting Files

Getting and Setting File Information

Input/Output File Filters

Loading and Saving Stamp Images

Loading Files

Low-Level Compression Functions

Maintaining File Comments and Tags

Rasterizing Files

Redirecting Input and Output

Saving Files

Scanning Images using ISIS

Optimization Functions


Raster Image Functions: Compression Functions

Raster Image Functions:
Input and Output
Compression Functions

High-Level Functions

LBitmapBase::ChangeCompression

For LEAD and JPEG Compression:

LMemoryFile::StartCompressBuffer

LMemoryFile::CompressBuffer

LMemoryFile::EndCompressBuffer

For 1-Bit RLE-Compressed Bitmaps (Document/Medical only):

LBitmapBase::ChangeCompression

LBitmapBase::GetRowCompressed

LBitmapBase::PutRowCompressed

LBitmapBase::GetRowColCompressed

LBitmapBase::PutRowColCompressed

LBuffer::ExpandRow

LBuffer::CompressRow

LBuffer::CompressRows

LBuffer::ExpandRows

Super Compressed Bitmaps

LBitmapBase::ChangeCompression

ABIC Compression

LBase::EncodeABIC

LBase::DecodeABIC


Raster Image Functions: Converting Files

Raster Image Functions:
Input and Output
Converting Files

LFile::FileConvert


Raster Image Functions: Getting and Setting File Information

Raster Image Functions:
Input and Output
Getting and Setting File Information

Getting information:

LBitmap::ExtractMessage

LFile::FreeExtensions

LFile::GetExtensionAudio

LFile::GetInfo

LMemoryFile::GetInfo

LFileSettings::GetLoadResolution

LFileSettings::GetPCDResolution

LFileSettings::GetWMFResolution

LFileSettings::GetSaveResolution

LFile::LoadExtensionStamp

LFile::ReadFileExtensions

LFile::ReadFileTransforms

LFile::ReadLoadResolutions

Setting information:

LBitmap::AddMessage

LFileSettings::SetExtFileOption

LBaseFile::EnableLoadInfoCallBack

LFileSettings::SetLoadResolution

LFileSettings::SetPCDResolution

LFileSettings::SetWMFResolution

LFileSettings::SetSaveResolution

LFile::WriteFileTransforms

LFile::WriteComment


Raster Image Functions: ICC Profile Functions

Raster Image Functions:
ICC Profile Functions

Creating an ICC Profile

LFile::InitICCProfileExt

Loading an ICC Profile

LFile::InitICCProfileExt

LFile::LoadICCProfileExt

Saving an ICC Profile

LFile::SaveICCProfile

Freeing an ICC Profile

LFile::FreeICCProfileExt


Raster Image Functions: Input/Output File Filters

Raster Image Functions:
Input and Output
Input/Output File Filters

LFileSettings::IgnoreFilters

LFileSettings::PreLoadFilters


Raster Image Functions: Loading and Saving Stamp Images

Raster Image Functions:
Input and Output
Loading and Saving Stamp Images

LFile::GetCompressStamp

LFile::ReadStamp

LFile::WriteStamp

LFileSettings::SetExtFileOption

LFile::SaveFile


Raster Image Functions: Loading Files

Raster Image Functions:
Input and Output
Loading Files

Getting information before loading:

LFile::GetInfo

LMemoryFile::GetInfo

LFile::ReadFileTransforms

Optional settings before loading:

LBaseFile::EnableLoadInfoCallBack

LFile::ReadLoadResolutions

LFileSettings::GetAutoCADFilesColorScheme

LFileSettings::GetDJVOptions

LFileSettings::GetExtFileOption

LFileSettings::GetLoadResolution

LFileSettings::GetPCDResolution

LFileSettings::GetPLTOptions

LFileSettings::GetPTKOptions

LFileSettings::GetRTFOptions

LFileSettings::GetTXTOptions

LFileSettings::GetWMFResolution

LFileSettings::SetAutoCADFilesColorScheme

LFileSettings::SetDJVOptions

LFileSettings::SetExtFileOption

LFileSettings::SetLoadResolution

LFileSettings::SetPCDResolution

LFileSettings::SetPLTOptions

LFileSettings::SetPTKOptions

LFileSettings::SetRTFOptions

LFileSettings::SetTXTOptions

LFileSettings::SetWMFResolution

Alternatives to load from a file on a disk:

LAnimationWindow::Load

LBitmapBase::Load

LBitmapBase::LoadResize

LBitmapList::Load

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadBitmapResize

LFile::LoadFile

LFile::LoadCMYKArray

LFile::LoadLayer

LFile::LoadOffset

LFile::LoadTile

Alternatives to load from a file in memory:

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::Decompress

Where you supply the image data to load:

LFile::StartFeedLoad

LFile::FeedLoad

LFile::StopFeedLoad

LBitmapBase::ChangeHeight

Loading Embedded ICC Profiles

LFile::FreeICCProfile

LFile::InitICCProfile

LFile::LoadICCProfile

Compacting TIFF Files

LFile::Compact

Loading Corrupted Files

LBitmapBase::GetLoadStatus


Raster Image Functions: Maintaining File Comments

Raster Image Functions:
Input and Output
Maintaining File Comments and Tags

For the comment to be saved:

LFileSettings::SetComment

LFileSettings::GetComment

For the comment in an existing file:

LFile::ReadComment

LMemoryFile::ReadComment

LFile::ReadCommentOffset

For the TIFF tag to be saved:

LFileSettings::SetTag

LFileSettings::GetTag

For the TIFF tag in an existing file:

LFile::DeleteTag

LFile::EnumTags

LFile::EnumTagsCallBack

LFile::ReadCommentOffset

LFile::ReadTag

LMemoryFile::ReadTag

LFile::WriteTag

For the FlashPix Comments:

LFile::GetCommentSize

LFile::ReadCommentExt

LFile::WriteComment


Raster Image Functions: Markers

Raster Image Functions:
Input and Output
Markers

LMarker::Create

LMarker::Load

LMarker::Copy

LMarker::Delete

LMarker::DeleteIndex

LMarker::Enum

LMarker::Free

LMarker::GetCount

LMarker::GetHandle

LMarker::GetGlobalMarkers

LMarker::Insert

LMarker::SetAsGlobalMarkers

LMarker::SetHandle

LMarker::EnumMarkersCallBack


Raster Image Functions: Optimization Functions

Raster Image Functions:
Input and Output:
Optimization Functions

LOptimize::GetDefaultOptions

LOptimize::OptimizeBuffer

LOptimize::OptimizeDir

LOptimize::OptimizeBufferCallBack

LOptimize::OptimizeDirCallBack


Raster Image Functions: Rasterizing Files

Raster Image Functions:
Input and Output
Rasterizing Files

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D


Raster Image Functions: Redirecting Input and Output

Raster Image Functions:
Input and Output
Redirecting Input and Output

LBaseFile::EnableRedirectIO

LBaseFile::RedirectOpenCallBack

LBaseFile::RedirectSeekCallBack

LBaseFile::RedirectReadCallBack

LBaseFile::RedirectWriteCallBack

LBaseFile::RedirectCloseCallBack


Raster Image Functions: Saving Files

Raster Image Functions:
Input and Output
Saving Files

Optional settings before saving:

LFileSettings::GetExtFileOption

LFileSettings::SetExtFileOption

LFileSettings::GetComment

LFileSettings::SetComment

LFileSettings::GetDefaultJ2KOptions

LFileSettings::GetJ2KOptions

LFileSettings::SetJ2KOptions

LFileSettings::GetJBIG2Options

LFileSettings::SetJBIG2Options

LFileSettings::GetPDFSaveOptions

LFileSettings::SetPDFSaveOptions

LFileSettings::GetTag

LFileSettings::SetTag

LFileSettings::GetSaveResolution

LFileSettings::SetSaveResolution

Alternatives to save a file on disk:

LBitmapBase::Save

LFile::SaveBitmap

LFile::SaveBitmapList

LBitmapList::Save

LFile::SaveBitmapWithLayers

LFile::SaveCMYKArray

LFile::SaveFile

LFile::SaveOffset

LFile::SaveTile

Functions for saving a file in memory:

LMemoryFile::SaveBitmap

LMemoryFile::SaveBitmapBuffer

LMemoryFile::SaveBitmapBufferCallBack

LMemoryFile::SaveFileBuffer

LMemoryFile::SaveFileBufferCallBack

LMemoryFile::SaveFileCallBack

Optional settings after saving:

LFile::WriteFileTransforms

LFile::WriteStamp


Raster Image Functions: Scanning Images using ISIS

Raster Image Functions:
Input and Output
Scanning Images using ISIS

LIsis::Acquire ( Document/Medical only)

LIsis::AcquireMulti ( Document/Medical only)

LIsis::GetTagASCII

LIsis::GetTagASCIIChoice

LIsis::GetTagLong ( Document/Medical only)

LIsis::GetTagLongChoice

LIsis::GetTagShort ( Document/Medical only)

LIsis::GetTagShortChoice

LIsis::IsAvailable ( Document/Medical only)

LIsis::LoadDriver ( Document/Medical only)

LIsis::Select ( Document/Medical only)

LIsis::SetScanOptions ( Document/Medical only)

LIsis::SetTagASCII

LIsis::SetTagLong ( Document/Medical only)

LIsis::SetTagShort ( Document/Medical only)

LIsis::UnloadDriver ( Document/Medical only)


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:

LBitmap::SetKaufmannRgn

LBitmapRgn::SetRgnBorder

LBitmapRgn::SetRgnHandle

LBitmapRgn::SetRgnColor

LBitmapRgn::SetRgnColorHSVRange

LBitmapRgn::SetRgnColorRGBRange

LBitmapRgn::SetRgnCurve

LBitmapRgn::SetRgnEllipse

LBitmapRgn::SetRgnPolygon

LBitmapRgn::SetRgnRect

LBitmapRgn::SetRgnRoundRect

LBitmapRgn::SetRgnFromMask

LBitmapRgn::SetRgnMagicWand

For working with the current region:

LBitmap::GetRgnContourPoints

LBitmap::GetRgnPerimeterLength

LBitmapRgn::BitmapHasRgn

LPaint::ColorRgn

LPaint::FrameRgn

LBitmapRgn::CreateMaskFromBitmapRgn

LBitmapRgn::Free

LBitmapRgn::GetRgnHandle

LBitmapRgn::GetClipSegments

LBitmapRgn::GetClipSegmentsMax

LBitmapRgn::GetRgnArea

LBitmapRgn::GetRgnBounds

LBitmapRgn::HolesRemovalRgn

LBitmapRgn::IsPtInRgn

LBitmapRgn::Offset

LBitmapRgn::SetRgnCurve

See Also

Implementing Transparency

LBitmapRgn::ResizeRgn


Raster Image Functions: Displaying a Region

Raster Image Functions:
Region Processing
Displaying a Region

LBitmapWindow

LPaint::PaintRgnDC

LPaint::PaintRgnDCBuffer

LPaintEffect::PaintRgnDCEffect

LPaint::FrameRgn

See Also

Implementing Transparency


Raster Image Functions: Functions That Transform the Region and the Bitmap

Raster Image Functions:
Region Processing
Functions That Transform the Region and the Bitmap

LBitmapBase::ChangeViewPerspective

LBitmapBase::Flip

LBitmapBase::Resample

LBitmapBase::Reverse

LBitmapBase::Rotate

LBitmapBase::RotateFine

LBitmapBase::RotateViewPerspective

LBitmapBase::Shear

LBitmapBase::Size

LBitmapBase::Trim

LBitmap::AutoTrim


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 LBitmapRgn::BitmapHasRgn function. To remove a bitmap region so that these functions act on the bitmap, use the LBitmapRgn::Free function.

LBitmapBase::Clear

LBitmapBase::Combine

LBitmapBase::GetColorCount

LBitmapBase::GetPixelColor

LBitmapBase::Fill

LBitmapBase::PutPixelColor

LBitmap::AddNoise

LBitmap::AutoBinary

LBitmap::AutoColorLevel

LBitmap::AverageFilter

LBitmap::Bending

LBitmap::BinaryFilter

LBitmap::ChangeContrast

LBitmap::ChangeHue

LBitmap::ChangeIntensity

LBitmap::ChangeSaturation

LBitmap::ChannelMix

LBitmap::ColorizeGray

LBitmap::ColorLevel

LBitmap::ContBrightInt

LBitmap::Cylindrical

LBitmap::Despeckle

LBitmap::DiceEffect

LBitmap::DigitalSubtract

LBitmap::DrawStar

LBitmap::Dry

LBitmap::Emboss

LBitmap::FreeHandWave

LBitmap::FreePlaneBend

LBitmap::FreeRadBend

LBitmap::GammaCorrect

LBitmap::GetHistogram

LBitmap::GlassEffect

LBitmap::HistoContrast

LBitmap::HistoEqualize

LBitmap::IntensityDetect

LBitmap::Invert

LBitmap::Light

LBitmap::MaxFilter

LBitmap::MedianFilter

LBitmap::MinFilter

LBitmap::Mosaic

LBitmap::MultiScaleEnhancementBitmap

LBitmap::Ocean

LBitmap::Oilify

LBitmap::Pixelate

LBitmap::PlaneBend

LBitmap::Plane

LBitmap::Polar

LBitmap::Posterize

LBitmap::Punch

LBitmap::PuzzleEffect

LBitmap::RadialBlur

LBitmap::RadWave

LBitmap::RemapIntensity

LBitmap::RingEffect

LBitmap::Ripple

LBitmap::SelectData

LBitmap::SelectiveColor

LBitmap::Sharpen

LBitmap::ShiftData

LBitmap::Skeleton

LBitmap::Solarize

LBitmap::SpatialFilter

LBitmap::Spherize

LBitmap::StretchIntensity

LBitmap::Swirl

LBitmap::Wave

LBitmap::ZoomBlur

LBitmap::ZoomWave

LBitmapRgn::HolesRemovalRgn

LBitmap::Clouds

LBitmap::ColoredBalls

LBitmap::ColorHalfTone

LBitmap::CorrelationList

LBitmap::DiffuseGlow

LBitmap::DisplaceMap

LBitmap::Fragment

LBitmap::HalfTonePattern

LBitmap::HighPassFilter

LBitmap::MosaicTiles

LBitmap::Perspective

LBitmap::Pointillist

LBitmap::RomanMosaic

LBitmap::Vignette

LBitmap::ZigZag


Annotation Functions (Document/Medical only): Global Properties

Annotation Functions:
Global Properties

[Document/Medical ]

LAnnotation::GetUserMode

LAnnContainer::SetUserMode

LAnnotation::GetWnd

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Hyperlinks

Annotation Functions:
Hyperlinks

[Document/Medical ]

LAnnotation::GetHyperlink

LAnnotation::GetHyperlinkLen

LAnnAutomation::IsHyperlinkMenuEnabled

LAnnotation::SetHyperlink

LAnnAutomation::SetHyperlinkMenuEnabled


Annotation Functions (Document/Medical only): Object Information

Annotation Functions:
Object Information

[Document/Medical]

LAnnotation::GetTopContainer

LAnnotation::GetContainer

LAnnProtractor::GetAngle

LAnnotation::GetAutoBackColor

LAnnStamp::GetBitmap

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnAutomation::GetNodes

LAnnotation::GetTextOptions

LAnnotation::GetPredefinedMetafile

LAnnProtractor::GetProtractorOptions

LAnnotationWindow::GetContainerObject

LAnnContainer::GetItem

LAnnotation::GetROP2

LAnnPushPin::GetSecondaryBitmap

LAnnotation::IsSelected

LAnnContainer::GetSelectRect

LAnnAutomation::GetShowFlags

LAnnotation::GetTextOptions

LAnnAutomation::GetTransparentColor

LAnnContainer::Enumerate

LAnnContainer::HitTest

LAnnotation::GetType


Annotation Functions (Document/Medical only): Realizing to a Bitmap

Annotation Functions:
Realizing to a Bitmap

[Document/Medical ]

LAnnotation::Realize

LAnnContainer::Realize

LAnnContainer::Unrealize

LAnnRedact::Unrealize


Annotation Functions (Document/Medical only): Security

Annotation Functions:
Security

[Document/Medical ]

LAnnotation::IsLocked

LAnnotation::Lock

LAnnotation::ShowLockedIcon

LAnnotation::Unlock

LAnnotation::SetUser


Annotation Functions (Document/Medical only): Automation

Annotation Functions:
Automation

[Document/Medical ]

Implementing Automation

Working with the Toolbar

Creating Custom Annotations


Annotation Functions (Document/Medical only): Creating Custom Annotations

Annotation Functions:
Automation
Creating Custom Annotations

[Document/Medical]

LAnnContainer Class:

LAnnContainer::Convert

LAnnContainer::HitTestExt

LAnnContainer::RestrictCursor

LAnnotation Class:

LAnnotation::AdjustPoint

LAnnotation::CreateAnnObject

LAnnotation::Define2

LAnnotation::Define

LAnnotation::GetRestrictToContainer

LAnnotation::SetRestrictToContainer

LAnnotation::CalibrateRuler

LAnnotation::GetAutoSnapCursor

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetRotateOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetRotateOptions

LAnnotation::SetTextOptions

LAnnAudioClip Class:

LAnnAudioClip::AddUserHandle

LAnnAudioClip::GetUserHandle

LAnnAudioClip::GetUserHandles

LAnnAudioClip::ChangeUserHandle

LAnnAudioClip::DeleteUserHandle

LAnnAudioClip::EnumerateHandles

LAnnAudioClip::EnumHandleCallBack

LAnnButton Class:

LAnnButton::AddUserHandle

LAnnButton::GetUserHandle

LAnnButton::GetUserHandles

LAnnButton::ChangeUserHandle

LAnnButton::DeleteUserHandle

LAnnButton::EnumerateHandles

LAnnButton::EnumHandleCallBack

LAnnCrossProduct Class:

LAnnCrossProduct::AddUserHandle

LAnnCrossProduct::GetUserHandle

LAnnCrossProduct::GetUserHandles

LAnnCrossProduct::ChangeUserHandle

LAnnCrossProduct::DeleteUserHandle

LAnnCrossProduct::EnumerateHandles

LAnnCrossProduct::EnumHandleCallBack

LAnnCurve Class:

LAnnCurve::AddUserHandle

LAnnCurve::GetUserHandle

LAnnCurve::GetUserHandles

LAnnCurve::ChangeUserHandle

LAnnCurve::DeleteUserHandle

LAnnCurve::EnumerateHandles

LAnnCurve::EnumHandleCallBack

LAnnCurveClosed Class:

LAnnCurveClosed::AddUserHandle

LAnnCurveClosed::GetUserHandle

LAnnCurveClosed::GetUserHandles

LAnnCurveClosed::ChangeUserHandle

LAnnCurveClosed::DeleteUserHandle

LAnnCurveClosed::EnumerateHandles

LAnnCurveClosed::EnumHandleCallBack

LAnnEllipse Class:

LAnnEllipse::AddUserHandle

LAnnEllipse::GetUserHandle

LAnnEllipse::GetUserHandles

LAnnEllipse::ChangeUserHandle

LAnnEllipse::DeleteUserHandle

LAnnEllipse::EnumerateHandles

LAnnEllipse::EnumHandleCallBack

LAnnEncrypt Class:

LAnnEncrypt::AddUserHandle

LAnnEncrypt::GetUserHandle

LAnnEncrypt::GetUserHandles

LAnnEncrypt::ChangeUserHandle

LAnnEncrypt::DeleteUserHandle

LAnnEncrypt::EnumerateHandles

LAnnEncrypt::EnumHandleCallBack

LAnnFreehand Class:

LAnnFreehand::AddUserHandle

LAnnFreehand::GetUserHandle

LAnnFreehand::GetUserHandles

LAnnFreehand::ChangeUserHandle

LAnnFreehand::DeleteUserHandle

LAnnFreehand::EnumerateHandles

LAnnFreehand::EnumHandleCallBack

LAnnFreehandHotSpot Class:

LAnnFreehandHotSpot::AddUserHandle

LAnnFreehandHotSpot::GetUserHandle

LAnnFreehandHotSpot::GetUserHandles

LAnnFreehandHotSpot::ChangeUserHandle

LAnnFreehandHotSpot::DeleteUserHandle

LAnnFreehandHotSpot::EnumerateHandles

LAnnFreehandHotSpot::EnumHandleCallBack

LAnnHilite Class:

LAnnHilite::AddUserHandle

LAnnHilite::GetUserHandle

LAnnHilite::GetUserHandles

LAnnHilite::ChangeUserHandle

LAnnHilite::DeleteUserHandle

LAnnHilite::EnumerateHandles

LAnnHilite::EnumHandleCallBack

LAnnHotSpot Class:

LAnnHotSpot::AddUserHandle

LAnnHotSpot::GetUserHandle

LAnnHotSpot::GetUserHandles

LAnnHotSpot::ChangeUserHandle

LAnnHotSpot::DeleteUserHandle

LAnnHotSpot::EnumerateHandles

LAnnHotSpot::EnumHandleCallBack

LAnnLine Class:

LAnnLine::AddUserHandle

LAnnLine::GetUserHandle

LAnnLine::GetUserHandles

LAnnLine::ChangeUserHandle

LAnnLine::DeleteUserHandle

LAnnLine::EnumerateHandles

LAnnLine::EnumHandleCallBack

LAnnNote Class:

LAnnNote::AddUserHandle

LAnnNote::GetUserHandle

LAnnNote::GetUserHandles

LAnnNote::ChangeUserHandle

LAnnNote::DeleteUserHandle

LAnnNote::EnumerateHandles

LAnnNote::EnumHandleCallBack

LAnnPolygon Class:

LAnnPolygon::AddUserHandle

LAnnPolygon::GetUserHandle

LAnnPolygon::GetUserHandles

LAnnPolygon::ChangeUserHandle

LAnnPolygon::DeleteUserHandle

LAnnPolygon::EnumerateHandles

LAnnPolygon::EnumHandleCallBack

LAnnPoint Class:

LAnnPoint::AddUserHandle

LAnnPoint::GetUserHandle

LAnnPoint::GetUserHandles

LAnnPoint::ChangeUserHandle

LAnnPoint::DeleteUserHandle

LAnnPoint::EnumerateHandles

LAnnPoint::EnumHandleCallBack

LAnnPolyline Class:

LAnnPolyline::AddUserHandle

LAnnPolyline::GetUserHandle

LAnnPolyline::GetUserHandles

LAnnPolyline::ChangeUserHandle

LAnnPolyline::DeleteUserHandle

LAnnPolyline::EnumerateHandles

LAnnPolyline::EnumHandleCallBack

LAnnPolyRuler Class:

LAnnPolyRuler::AddUserHandle

LAnnPolyRuler::GetUserHandle

LAnnPolyRuler::GetUserHandles

LAnnPolyRuler::ChangeUserHandle

LAnnPolyRuler::DeleteUserHandle

LAnnPolyRuler::EnumerateHandles

LAnnPolyRuler::EnumHandleCallBack

LAnnProtractor Class:

LAnnProtractor::AddUserHandle

LAnnProtractor::GetUserHandle

LAnnProtractor::GetUserHandles

LAnnProtractor::ChangeUserHandle

LAnnProtractor::DeleteUserHandle

LAnnProtractor::EnumerateHandles

LAnnProtractor::EnumHandleCallBack

LAnnPointer Class:

LAnnPointer::AddUserHandle

LAnnPointer::GetUserHandle

LAnnPointer::GetUserHandles

LAnnPointer::ChangeUserHandle

LAnnPointer::DeleteUserHandle

LAnnPointer::EnumerateHandles

LAnnPointer::EnumHandleCallBack

LAnnPushPin Class:

LAnnPushPin::AddUserHandle

LAnnPushPin::GetUserHandle

LAnnPushPin::GetUserHandles

LAnnPushPin::ChangeUserHandle

LAnnPushPin::DeleteUserHandle

LAnnPushPin::EnumerateHandles

LAnnPushPin::EnumHandleCallBack

LAnnRedact Class:

LAnnRedact::AddUserHandle

LAnnRedact::GetUserHandle

LAnnRedact::GetUserHandles

LAnnRedact::ChangeUserHandle

LAnnRedact::DeleteUserHandle

LAnnRedact::EnumerateHandles

LAnnRedact::EnumHandleCallBack

LAnnRectangle Class:

LAnnRectangle::AddUserHandle

LAnnRectangle::GetUserHandle

LAnnRectangle::GetUserHandles

LAnnRectangle::ChangeUserHandle

LAnnRectangle::DeleteUserHandle

LAnnRectangle::EnumerateHandles

LAnnRectangle::EnumHandleCallBack

LAnnRTF Class:

LAnnRTF::AddUserHandle

LAnnRTF::GetUserHandle

LAnnRTF::GetUserHandles

LAnnRTF::ChangeUserHandle

LAnnRTF::DeleteUserHandle

LAnnRTF::EnumerateHandles

LAnnRTF::EnumHandleCallBack

LAnnRuler Class:

LAnnRuler::AddUserHandle

LAnnRuler::GetUserHandle

LAnnRuler::GetUserHandles

LAnnRuler::ChangeUserHandle

LAnnRuler::DeleteUserHandle

LAnnRuler::EnumerateHandles

LAnnRuler::EnumHandleCallBack

LAnnStamp Class:

LAnnStamp::AddUserHandle

LAnnStamp::GetUserHandle

LAnnStamp::GetUserHandles

LAnnStamp::ChangeUserHandle

LAnnStamp::DeleteUserHandle

LAnnStamp::EnumerateHandles

LAnnStamp::EnumHandleCallBack

LAnnText Class:

LAnnText::AddUserHandle

LAnnText::GetUserHandle

LAnnText::GetUserHandles

LAnnText::ChangeUserHandle

LAnnText::DeleteUserHandle

LAnnText::EnumerateHandles

LAnnText::EnumHandleCallBack

LAnnTextPointer Class:

LAnnTextPointer::AddUserHandle

LAnnTextPointer::GetUserHandle

LAnnTextPointer::GetUserHandles

LAnnTextPointer::ChangeUserHandle

LAnnTextPointer::DeleteUserHandle

LAnnTextPointer::EnumerateHandles

LAnnTextPointer::EnumHandleCallBack

LAnnToolBar Class:

LAnnToolBar::AddUserHandle

LAnnToolBar::GetUserHandle

LAnnToolBar::GetUserHandles

LAnnToolBar::ChangeUserHandle

LAnnToolBar::DeleteUserHandle

LAnnToolBar::EnumerateHandles

LAnnToolBar::EnumHandleCallBack

LAnnVideo Class:

LAnnVideo::AddUserHandle

LAnnVideo::GetUserHandle

LAnnVideo::GetUserHandles

LAnnVideo::ChangeUserHandle

LAnnVideo::DeleteUserHandle

LAnnVideo::EnumerateHandles

LAnnVideo::EnumHandleCallBack

Structures

WM_LTANNEVENT

ANNMOUSEPOS

ANNHANDLE


Annotation Functions (Document/Medical only): Implementing Automation

Annotation Functions:
Automation
Implementing Automation

[Document/Medical]

High-Level classes for Implementing Automation

LAnnotationWindow

Creating the automation object:

LAnnAutomation::Create

Setting initial automation properties:

LAnnotation::GetActiveState

LAnnotation::GetAutoBackColor

LAnnAutomation::GetAutoContainer

LAnnAutomation::GetAutoCursor

LAnnAutomation::GetBitmapDpiX

LAnnAutomation::SetBitmapDpiX

LAnnAutomation::GetDpiX

LAnnAutomation::SetDpiX

LAnnAutomation::GetBitmapDpiY

LAnnAutomation::SetBitmapDpiY

LAnnAutomation::GetDpiY

LAnnAutomation::SetDpiY

LAnnAutomation::SetAutoContainer

LAnnAutomation::SetUndoDepth

LAnnAutomation::IsAutoDrawEnabled

LAnnAutomation::SetAutoDrawEnabled

LAnnAutomation::IsAutoMenuEnabled

LAnnAutomation::GetAutoOptions

LAnnAutomation::GetBitmapDpiX

LAnnAutomation::GetBitmapDpiY

LAnnAutomation::SetAutoMenuEnabled

LAnnAutomation::SetAutoHilightPen

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetTextOptions

LAnnotation::SetActiveState

LAnnotation::SetAutoBackColor

LAnnAutomation::SetAutoOptions

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetTextOptions

Using automation:

LAnnAutomation::GetTool

LAnnAutomation::SetTool

LAnnAutomation::Undo

Modifying automated text strings:

LAnnAutomation::GetAutoText

LAnnAutomation::GetAutoTextLen

LAnnAutomation::SetAutoText

Modifying the menu

LAnnotation::GetAutoMenuItemEnable

LAnnotation::GetAutoMenuState

LAnnotation::SetAutoMenuItemEnable

LAnnotation::SetAutoMenuState


Annotation Functions (Document/Medical only): Working with the Toolbar

Annotation Functions:
Automation
Working with the Toolbar

[Document/Medical ]

LAnnToolBar::Create

LAnnToolBar::GetToolChecked

LAnnToolBar::SetToolChecked

LAnnToolBar::IsButtonVisible

LAnnToolBar::SetButtonVisible

LAnnToolBar::FreeToolBarButtons

LAnnToolBar::GetToolBarButtons

LAnnToolBar::GetToolBarInfo

LAnnToolBar::SetToolBarButtons

LAnnToolBar::SetToolBarColumns

LAnnToolBar::SetToolBarRows


Annotation Functions (Document/Medical only): Creation, Deletion, and Copying

Annotation Functions:
Creation, Deletion, and Copying

[ Document/Medical ]

High-level creation:

LAnnotation::Define2

Copying Annotations

Creating and Deleting Annotations

Using the Clipboard

Custom:

Functionality for adding and maintaining user-defined handles has been added to the Annotation Class Library. This functionality has been implemented by adding the LAnnXXX::AddUserHandle, LAnnXXX::ChangeUserHandle, LAnnXXX::DeleteUserHandle, LAnnXXX::GetUserHandle, LAnnXXX::GetUserHandles, LAnnXXX::EnumerateHandles and LAnnXXX::EnumHandleCallBack functions, where LAnnXXX represents the classes that support handles. These classes are as follows:

LAnnAudioClip

LAnnButton

LAnnCrossProduct

LAnnCurve

LAnnCurveClosed

LAnnEllipse

LAnnEncrypt

LAnnFreehand

LAnnFreehandHotSpot

LAnnHilite

LAnnHotSpot

LAnnLine

LAnnNote

LAnnPolygon

LAnnPoint

LAnnPolyline

LAnnPolyRuler

LAnnProtractor

LAnnPointer

LAnnPushPin

LAnnRedact

LAnnRectangle

LAnnRTF

LAnnRuler

LAnnStamp

LAnnText

LAnnTextPointer

LAnnToolBar

LAnnVideo


Annotation Functions (Document/Medical only): Copying Annotations

Annotation Functions:
Creation, Deletion, and Copying
Copying Annotations

[Document/Medical ]

LAnnotation::Copy

LAnnotation::operator=


Annotation Functions (Document/Medical only): Creating and Deleting Annotations

Annotation Functions:
Creation, Deletion, and Copying
Creating and Deleting Annotations

[Document/Medical]

Low-level creation:

LAnnAudioClip::Create

LAnnAutomation::Create

LAnnButton::Create

LAnnContainer::Create

LAnnEllipse::Create

LAnnFreehand::Create

LAnnHilite::Create

LAnnHotSpot::Create

LAnnLine::Create

LAnnNote::Create

LAnnPointer::Create

LAnnPolygon::Create

LAnnPolyline::Create

LAnnRectangle::Create

LAnnRedact::Create

LAnnRuler::Create

LAnnStamp::Create

LAnnText::Create

High-level creation:

LAnnFreehand::Define

LAnnotation::CreateAnnObject

LAnnPolygon::Define

LAnnPolyline::Define

Insertion, and removal:

LAnnContainer::Insert

LAnnotation::Remove

Cut

LAnnotation::CutToClipboard

Deletion:

LAnnotation::Destroy


Annotation Functions (Document/Medical only): Using the Clipboard

Annotation Functions:
Creation, Deletion, and Copying
Using the Clipboard

[Document/Medical ]

LAnnContainer::CopyFromClipboard

LAnnotation::CopyToClipboard

LAnnotation::CutToClipboard

LAnnotation::IsClipboardReady


Annotation Functions (Document/Medical only): Displaying and Printing

Annotation Functions:
Displaying and Printing

[Document/Medical ]

Displaying Annotations

Printing Annotations


Annotation Functions (Document/Medical only): Displaying Annotations

Annotation Functions:
Displaying and Printing
Displaying Annotations

[Document/Medical]

LAnnAutomation::GetAutoCursor

LAnnAutomation::GetDpiX

LAnnAutomation::GetDpiY

LAnnAutomation::GetTransparentColor

LAnnAutomation::SetAutoCursor

LAnnAutomation::SetAutoHilightPen

LAnnAutomation::SetDpiX

LAnnAutomation::SetDpiY

LAnnAutomation::SetTransparentColor

LAnnAutomation::SetTransparent

LAnnContainer::SetTransparentColor

LAnnContainer::SetTransparent

LAnnotation::GetAutoSnapCursor

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetRotateOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoSnapCursor

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnotation::SetRotateOptions

LAnnotation::SetTextOptions

LAnnotation::BringToFront

LAnnotation::Draw

LAnnotation::GetAutoBackColor

LAnnotation::GetROP2

LAnnotation::SendToBack

LAnnotation::SetAutoBackColor

LAnnotation::SetROP2

LAnnPoint::GetTransparentColor

LAnnPoint::GetTransparent

LAnnPoint::SetTransparentColor

LAnnPoint::SetTransparent

LAnnStamp::GetTransparentColor

LAnnStamp::GetTransparent

LAnnStamp::SetTransparentColor

LAnnStamp::SetTransparent


Annotation Functions (Document/Medical only): Printing Annotations

Annotation Functions:
Displaying and Printing
Printing Annotations

[Document/Medical ]

LAnnotationWindow::AnnPrint

LAnnotation::Print


Annotation Functions (Document/Medical only): Input and Output

Annotation Functions:
Input and Output

[ Document/Medical ]

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:
Input and Output
 Deleting Pages from an Annotation File

[ Document/Medical ]

LAnnContainer::DeletePage

LAnnContainer::DeletePageMemory

LAnnContainer::DeletePageOffset


Annotation Functions (Document/Medical only): Getting Annotation File Information

Annotation Functions:
Input and Output
 Getting Annotation File Information

[ Document/Medical ]

LAnnContainer::FileInfo

LAnnContainer::FileInfoMemory

LAnnContainer::FileInfoOffset


Annotation Functions (Document/Medical only): Loading Annotation Files

Annotation Functions:
Input and Output
Loading Annotation Files

[ Document/Medical ]

LAnnotationWindow::AnnLoad

LAnnContainer::Load

LAnnContainer::LoadMemory

LAnnContainer::LoadOffset


Annotation Functions (Document/Medical only): Saving Annotation Files

Annotation Functions:
Input and Output
Saving Annotation Files

[ Document/Medical ]

LAnnotationWindow::AnnSave

LAnnContainer::Save

LAnnContainer::SaveTag

LAnnContainer::SaveMemory

LAnnContainer::SaveOffset


Annotation Functions (Document/Medical only): Object Properties

Annotation Functions:
Object Properties

[Document/Medical]

Getting and Setting Encrypt Properties

Grouping and Ungrouping Annotation Objects

Getting and Setting Color Properties

Getting and Setting Fill Properties

Getting and Setting Font Properties

Getting and Setting the Freehand HotSpot Properties

Getting and Setting the HotSpot Properties

Getting and Setting Line Properties

Getting and Setting Node Properties

Getting and Setting Text Properties

Getting and Setting the Activation Property

Getting and Setting the Object Bitmap Property

Getting and Setting the Cross product Properties

Getting and Setting the Protractor Properties

Getting and Setting the Push Pin Properties

Getting and Setting the Ruler Properties

Getting and Setting the Stamp Properties

Getting and Setting the Tag Property

Getting and Setting the Visible Property

Getting and Setting the ROP2 Property

Getting and Setting the Object Metafile Property

Getting and Setting New Options Property

Getting and Setting the Alpha Property

Getting and Setting Button Properties

Getting and Setting Closed Curve Properties

Getting and Setting Ellipse Properties

Getting and Setting Polygon Properties

Getting and Setting Rectangle Properties

Getting and Setting Polyruler Properties

Getting and Setting Container Properties

Getting and Setting the Rotation Properties

Getting and Setting Cursor Properties


Annotation Functions (Document/Medical only): Getting and Setting Button Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Button Properties

LAnnotation::GetActiveState

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnButton::GetFixed

LAnnButton::GetForeColor

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnButton::GetText

LAnnAutomation::GetTextExpandTokens

LAnnotation::GetTextOptions

LAnnotation::GetUserMode

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnotation::SetActiveState

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnButton::SetFixed

LAnnButton::SetForeColor

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnButton::SetText

LAnnAutomation::SetTextExpandTokens

LAnnotation::SetTextOptions

LAnnContainer::SetUserMode

LAnnotation::SetVisible

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Getting and Setting Closed Curve Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Closed Curve Properties

LAnnotation::GetBackColor

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnAutomation::GetFillPattern

LAnnAutomation::GetFixed

LAnnotation::GetForeColor

LAnnAutomation::GetLineStyle

LAnnAutomation::GetLineWidth

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnCurveClosed::GetPoints

LAnnAutomation::GetPolyFillMode

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnotation::GetUserMode

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnotation::SetBackColor

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnAutomation::SetFillPattern

LAnnCurveClosed::SetFixed

LAnnotation::SetForeColor

LAnnAutomation::SetLineStyle

LAnnAutomation::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnCurveClosed::SetPoints

LAnnAutomation::SetPolyFillMode

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnContainer::SetUserMode

LAnnotation::SetVisible

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Getting and Setting Color Properties

Annotation Functions:
Object Properties
Getting and Setting Color Properties

[Document/Medical]

LAnnAutomation Class:

LAnnAutomation::GetBackColor

LAnnAutomation::GetForeColor

LAnnAutomation::GetTransparentColor

LAnnAutomation::SetAutoHilightPen

LAnnAutomation::SetBackColor

LAnnAutomation::SetForeColor

LAnnAutomation::SetTransparentColor

LAnnContainer Class:

LAnnContainer::GetBackColor

LAnnContainer::GetForeColor

LAnnContainer::SetBackColor

LAnnContainer::SetForeColor

LAnnContainer::SetTransparent

LAnnEllipse Class:

LAnnEllipse::GetBackColor

LAnnEllipse::GetForeColor

LAnnEllipse::SetBackColor

LAnnEllipse::SetForeColor

LAnnFreehand Class:

LAnnFreehand::GetForeColor

LAnnFreehand::SetForeColor

LAnnHilite Class:

LAnnHilite::GetBackColor

LAnnHilite::SetBackColor

LAnnLine Class:

LAnnLine::GetForeColor

LAnnLine::SetForeColor

LAnnNote Class:

LAnnNote::GetBackColor

LAnnNote::SetBackColor

LAnnotation Class:

LAnnotation::GetAutoBackColor

LAnnotation::GetBackColor

LAnnotation::GetForeColor

LAnnotation::GetROP2

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::GetTextOptions

LAnnotation::SetAutoBackColor

LAnnotation::SetBackColor

LAnnotation::SetForeColor

LAnnotation::GetOptions

LAnnotation::SetOptions

LAnnotation::GetFillModeExt

LAnnotation::SetFillModeExt

LAnnotation::SetROP2

LAnnPoint Class:

LAnnPoint::GetTransparentColor

LAnnPoint::GetTransparent

LAnnPoint::SetTransparentColor

LAnnPoint::SetTransparent

LAnnPointer Class

LAnnPointer::GetForeColor

LAnnPointer::SetForeColor

LAnnPolygon Class:

LAnnPolygon::GetBackColor

LAnnPolygon::GetForeColor

LAnnPolygon::SetBackColor

LAnnPolygon::SetForeColor

LAnnPolyline Class:

LAnnPolyline::GetForeColor

LAnnPolyline::SetForeColor

LAnnRectangle Class:

LAnnRectangle::GetBackColor

LAnnRectangle::GetForeColor

LAnnRectangle::SetBackColor

LAnnRectangle::SetForeColor

LAnnRedact Class:

LAnnRedact::GetBackColor

LAnnRedact::SetBackColor

LAnnRuler Class:

LAnnRuler::GetForeColor

LAnnRuler::SetForeColor

LAnnStamp Class:

LAnnStamp::GetBackColor

LAnnStamp::GetForeColor

LAnnStamp::GetTransparentColor

LAnnStamp::GetTransparent

LAnnStamp::SetBackColor

LAnnStamp::SetForeColor

LAnnStamp::SetTransparentColor

LAnnStamp::SetTransparent

LAnnText Class:

LAnnText::GetBackColor

LAnnText::GetForeColor

LAnnText::SetBackColor

LAnnText::SetForeColor


Annotation Functions (Document/Medical only): Getting and Setting Container Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Container Properties

LAnnContainer::GetBackColor

LAnnContainer::GetFillMode

LAnnContainer::GetFillPattern

LAnnContainer::GetForeColor

LAnnContainer::GetLineStyle

LAnnContainer::GetLineWidth

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnotation::GetUserMode

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnotation::CalibrateRuler

LAnnAutomation::GetFixed

LAnnotation::IsFontBold

LAnnotation::IsFontItalic

LAnnotation::GetFontName

LAnnotation::GetFontSize

LAnnotation::IsFontStrikeThrough

LAnnotation::IsFontUnderline

LAnnotation::GetNameOptions

LAnnotation::GetROP2

LAnnAutomation::GetShowFlags

LAnnContainer::SetBackColor

LAnnContainer::SetFillMode

LAnnAutomation::SetFixed

LAnnContainer::SetFontBold

LAnnContainer::SetFontItalic

LAnnContainer::SetFontName

LAnnContainer::SetFontSize

LAnnContainer::SetFontStrikeThrough

LAnnContainer::SetFontUnderline

LAnnContainer::SetForeColor

LAnnContainer::SetLineStyle

LAnnContainer::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetROP2

LAnnotation::SetSelected

LAnnAutomation::SetShowFlags


Annotation Functions (Document/Medical only): Getting and Setting the Cursor Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Cursor Properties

LAnnAutomation::GetAutoCursor

LAnnAutomation::GetAutoDialogFontSize

LAnnAutomation::GetAutoOptions

LAnnAutomation::GetAutoText

LAnnAutomation::GetAutoUndoEnable

LAnnAutomation::SetAutoCursor

LAnnAutomation::SetAutoDialogFontSize

LAnnAutomation::SetAutoDrawEnabled

LAnnAutomation::SetAutoHilightPen

LAnnAutomation::SetAutoMenuEnabled

LAnnAutomation::SetAutoOptions

LAnnAutomation::SetAutoText

LAnnAutomation::SetAutoUndoEnable

LAnnotation::GetAutoSnapCursor

LAnnotation::SetAutoMenuItemEnable

LAnnotation::SetAutoMenuState

LAnnotation::SetAutoSnapCursor


Annotation Functions (Document/Medical only): Getting and Setting Ellipse Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Ellipse Properties

LAnnEllipse::GetBackColor

LAnnEllipse::GetFillMode

LAnnotation::GetFillModeExt

LAnnEllipse::GetFillPattern

LAnnEllipse::GetFixed

LAnnEllipse::GetForeColor

LAnnEllipse::GetLineStyle

LAnnEllipse::GetLineWidth

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnEllipse::SetBackColor

LAnnEllipse::SetFillMode

LAnnotation::SetFillModeExt

LAnnEllipse::SetFillPattern

LAnnEllipse::SetFixed

LAnnEllipse::SetForeColor

LAnnEllipse::SetLineStyle

LAnnEllipse::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnotation::SetVisible

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Getting and Setting Encrypt Properties

Annotation Functions:
Object Properties
Getting and Setting Encrypt Properties

[Document/Medical]

LBitmap::Scramble

LAnnAutomation::SetFillPattern

LAnnAutomation::SetLineWidth

LAnnAutomation::SetPolyFillMode

LAnnContainer::EncryptApply

LAnnContainer::SetLineStyle

LAnnContainer::SetUserMode

LAnnContainer::SetWnd

LAnnEncrypt::GetEncryptOptions

LAnnEncrypt::GetMetafile

LAnnEncrypt::GetSecondaryMetafile

LAnnEncrypt::SetEncryptOptions

LAnnEncrypt::SetMetafile

LAnnotation::SetBackColor

LAnnotation::SetForeColor

LAnnotation::SetNameOptions

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnotation::SetVisible


Annotation Functions (Document/Medical only): Getting and Setting Fill Properties

Annotation Functions:
Object Properties
Getting and Setting Fill Properties

[Document/Medical ]

LAnnotation::GetFillMode

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnotation::GetFillModeExt

LAnnAutomation::GetFillPattern

LAnnAutomation::SetFillPattern

LAnnAutomation::GetPolyFillMode

LAnnAutomation::SetPolyFillMode

LAnnotation::GetOptions

LAnnotation::SetOptions

LAnnStamp::GetFillPattern

LAnnStamp::SetFillPattern

LAnnRectangle::GetFillPattern

LAnnRectangle::SetFillPattern

LAnnEllipse::GetFillPattern

LAnnEllipse::SetFillPattern

LAnnPolygon::GetPolyFillMode

LAnnPolygon::SetPolyFillMode

LAnnContainer::SetFillPattern

LAnnContainer::SetPolyFillMode


Annotation Functions (Document/Medical only): Getting and Setting Font Properties

Annotation Functions:
Object Properties
Getting and Setting Font Properties

[Document/Medical]

LAnnotation::GetFontName

LAnnotation::GetFontNameLen

LAnnotation::SetFontName

LAnnotation::IsFontBold

LAnnotation::SetFontBold

LAnnotation::IsFontItalic

LAnnotation::SetFontItalic

LAnnotation::IsFontStrikeThrough

LAnnotation::SetFontStrikeThrough

LAnnotation::IsFontUnderline

LAnnotation::SetFontUnderline

LAnnotation::GetFontSize

LAnnotation::SetFontSize

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting Freehand HotSpot Properties

Annotation Functions:
Object Properties
 Getting and Setting Freehand HotSpot Properties

[Document/Medical ]

LAnnFreehandHotSpot::GetMetafile

LAnnotation::GetPredefinedMetafile

LAnnFreehandHotSpot::SetMetafile

LAnnotation::SetPredefinedMetafile

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting HotSpot Properties

Annotation Functions:
Object Properties
 Getting and Setting HotSpot Properties

[Document/Medical ]

LAnnHotSpot::GetMetafile

LAnnHotSpot::SetMetafile

LAnnotation::GetPredefinedMetafile

LAnnotation::SetPredefinedMetafile

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting Line Properties

Annotation Functions:
Object Properties
Getting and Setting Line Properties

[Document/Medical ]

LAnnAutomation::GetLineStyle

LAnnAutomation::SetLineStyle

LAnnAutomation::GetLineWidth

LAnnAutomation::SetLineWidth

LAnnStamp::GetLineStyle

LAnnStamp::SetLineStyle

LAnnStamp::GetLineWidth

LAnnStamp::SetLineWidth

LAnnLine::GetLineStyle

LAnnLine::SetLineStyle

LAnnLine::GetLineWidth

LAnnLine::SetLineWidth

LAnnPolyline::GetLineStyle

LAnnPolyline::SetLineStyle

LAnnPolyline::GetLineWidth

LAnnPolyline::SetLineWidth

LAnnPolygon::GetLineStyle

LAnnPolygon::SetLineStyle

LAnnPolygon::GetLineWidth

LAnnPolygon::SetLineWidth

LAnnFreehand::GetLineStyle

LAnnFreehand::SetLineStyle

LAnnFreehand::GetLineWidth

LAnnFreehand::SetLineWidth

LAnnRectangle::GetLineStyle

LAnnRectangle::SetLineStyle

LAnnRectangle::GetLineWidth

LAnnRectangle::SetLineWidth

LAnnEllipse::GetLineStyle

LAnnEllipse::SetLineStyle

LAnnEllipse::GetLineWidth

LAnnEllipse::SetLineWidth

LAnnPointer::GetLineStyle

LAnnPointer::SetLineStyle

LAnnPointer::GetLineWidth

LAnnPointer::SetLineWidth

LAnnRuler::GetLineStyle

LAnnRuler::SetLineStyle

LAnnRuler::GetLineWidth

LAnnRuler::SetLineWidth

LAnnContainer::SetLineStyle

LAnnContainer::SetLineStyle


Annotation Functions (Document/Medical only): Getting and Setting New Options Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting New Options Property

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting Node Properties

Annotation Functions:
Object Properties
Getting and Setting Node Properties

[Document/Medical]

LAnnPolyline::GetNodes

LAnnPolyline::SetNodes

LAnnPolygon::GetNodes

LAnnPolygon::SetNodes

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting Polygon Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Polygon Properties

LAnnPolygon::GetBackColor

LAnnPolygon::GetFillMode

LAnnotation::GetFillModeExt

LAnnPolygon::GetFillPattern

LAnnPolygon::GetFixed

LAnnPolygon::GetForeColor

LAnnPolygon::GetLineStyle

LAnnPolygon::GetLineWidth

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnPolygon::GetPolyFillMode

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnotation::GetUserMode

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnPolygon::SetBackColor

LAnnPolygon::SetFillMode

LAnnotation::SetFillModeExt

LAnnPolygon::SetFillPattern

LAnnPolygon::SetFixed

LAnnPolygon::SetForeColor

LAnnPolygon::SetLineStyle

LAnnPolygon::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnPolygon::SetPolyFillMode

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnContainer::SetUserMode

LAnnotation::SetVisible

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Getting and Setting Polyruler Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Polyruler Properties

LAnnotation::CalibrateRuler

LAnnPolyRuler::GetDistance2

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnPolyRuler::GetFixed

LAnnotation::IsFontBold

LAnnotation::IsFontItalic

LAnnotation::GetFontName

LAnnotation::GetFontSize

LAnnotation::IsFontStrikeThrough

LAnnotation::IsFontUnderline

LAnnotation::GetForeColor

LAnnAutomation::GetGaugeLength

LAnnPolyRuler::GetLineStyle

LAnnPolyRuler::GetLineWidth

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnPolyRuler::GetPoints

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnPolyRuler::GetTicMarkLength

LAnnAutomation::GetUnit

LAnnotation::IsVisible

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnPolyRuler::SetFixed

LAnnotation::SetFontBold

LAnnotation::SetFontItalic

LAnnotation::SetFontName

LAnnotation::SetFontSize

LAnnotation::SetFontStrikeThrough

LAnnotation::SetFontUnderline

LAnnotation::SetForeColor

LAnnAutomation::SetGaugeLength

LAnnPolyRuler::SetLineStyle

LAnnPolyRuler::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnPolyRuler::SetPoints

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnPolyRuler::SetTicMarkLength

LAnnAutomation::SetUnit

LAnnotation::SetVisible


Annotation Functions (Document/Medical only): Getting and Setting Rectangle Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting Rectangle Properties

LAnnRectangle::GetBackColor

LAnnRectangle::GetFillMode

LAnnotation::GetFillModeExt

LAnnRectangle::GetFillPattern

LAnnRectangle::GetFixed

LAnnRectangle::GetForeColor

LAnnRectangle::GetLineStyle

LAnnRectangle::GetLineWidth

LAnnotation::GetNameOptions

LAnnotation::GetOptions

LAnnotation::IsSelected

LAnnotation::GetTag

LAnnotation::GetUserMode

LAnnotation::IsVisible

LAnnotation::GetWnd

LAnnRectangle::SetBackColor

LAnnRectangle::SetFillMode

LAnnotation::SetFillModeExt

LAnnRectangle::SetFillPattern

LAnnRectangle::SetFixed

LAnnRectangle::SetForeColor

LAnnRectangle::SetLineStyle

LAnnRectangle::SetLineWidth

LAnnotation::SetNameOptions

LAnnotation::SetOptions

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnContainer::SetUserMode

LAnnotation::SetVisible

LAnnContainer::SetWnd


Annotation Functions (Document/Medical only): Getting and Setting Text Properties

Annotation Functions:
Object Properties
Getting and Setting Text Properties

[Document/Medical]

For text in objects:

LAnnotation::TextEdit

LAnnAutomation::GetText

LAnnAutomation::GetTextLen

LAnnAutomation::SetText

LAnnText::GetText

LAnnText::GetTextLen

LAnnText::SetText

LAnnStamp::GetText

LAnnStamp::GetTextLen

LAnnStamp::SetText

LAnnButton::GetText

LAnnButton::GetTextLen

LAnnButton::SetText

LAnnAudioClip::GetText

LAnnAudioClip::GetTextLen

LAnnAudioClip::SetText

LAnnRuler::GetText

LAnnRuler::GetTextLen

LAnnNote::GetText

LAnnNote::GetTextLen

LAnnNote::SetText

LAnnContainer::SetText

LAnnotation::SetFillModeExt

LAnnotation::GetFillModeExt

LAnnotation::SetTextOptions

LAnnotation::GetTextOptions

LAnnotation::GetOptions

LAnnotation::SetOptions

For automated menu text:

LAnnAutomation::GetAutoText

LAnnAutomation::GetAutoTextLen

LAnnAutomation::SetAutoText


Annotation Functions (Document/Medical only): Getting and Setting the Activation Property

Annotation Functions:
Object Properties
Getting and Setting the Activation Property

[Document/Medical ]

LAnnotation::GetActiveState

LAnnotation::SetActiveState


Annotation Functions (Document/Medical only): Getting and Setting the Alpha Property

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Alpha Property

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::SetFillModeExt

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting the Cross product Properties

Annotation Functions:
Object Properties
Getting and Setting Cross product Properties

[Document/Medical]

LAnnCrossProduct::GetPointCount

LAnnCrossProduct::GetPoints

LAnnCrossProduct::SetPoints

LAnnCrossProduct::GetLineStyle

LAnnCrossProduct::SetLineStyle

LAnnCrossProduct::GetLineWidth

LAnnCrossProduct::SetLineWidth

LAnnCrossProduct::GetDistance

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting the Object Bitmap Property

Annotation Functions:
Object Properties
 Getting and Setting the Object Bitmap Property

[Document/Medical]

LAnnStamp::GetBitmap

LAnnStamp::SetBitmap

LAnnPushPin::GetBitmap

LAnnPushPin::GetSecondaryBitmap

LAnnPushPin::SetBitmap

LAnnPushPin::SetSecondaryBitmap

LAnnPoint::GetBitmap

LAnnPoint::SetBitmap

LAnnotation::SetOptions

LAnnotation::GetOptions


Annotation Functions (Document/Medical only): Getting and Setting the Object Metafile Property

Annotation Functions:
Object Properties
 Getting and Setting the Object Metafile Property

[Document/Medical]

LAnnEncrypt::GetMetafile

LAnnEncrypt::SetMetafile

LAnnEncrypt::GetSecondaryMetafile

LAnnFreehandHotSpot::GetMetafile

LAnnFreehandHotSpot::SetMetafile

LAnnHotSpot::GetMetafile

LAnnHotSpot::SetMetafile

LAnnotation::GetPredefinedMetafile

LAnnotation::SetPredefinedMetafile

LAnnStamp::GetMetafile

LAnnStamp::SetMetafile

LAnnStamp::GetSecondaryMetafile


Annotation Functions (Document/Medical only): Getting and Setting the Protractor Properties

Annotation Functions:
Object Properties
Getting and Setting Protractor Properties

[Document/Medical]

LAnnotation::CalibrateRuler

LAnnProtractor::GetAngle

LAnnProtractor::GetPointCount

LAnnProtractor::GetPoints

LAnnProtractor::GetProtractorOptions

LAnnProtractor::SetProtractorOptions

LAnnProtractor::GetDistance

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::SetFillModeExt

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting the Push Pin Properties

Annotation Functions:
Object Properties
Getting and Setting Push Pin Properties

[Document/Medical]

LAnnContainer::SetUserMode

LAnnContainer::SetWnd

LAnnNote::SetText

LAnnotation::GetActiveState

LAnnotation::SetActiveState

LAnnotation::SetBackColor

LAnnotation::SetFontBold

LAnnotation::SetFontItalic

LAnnotation::SetFontName

LAnnotation::SetFontSize

LAnnotation::SetFontStrikethrough

LAnnotation::SetFontUnderline

LAnnotation::SetForeColor

LAnnotation::SetHyperlink

LAnnotation::SetNameOptions

LAnnotation::SetSelected

LAnnotation::SetTag

LAnnotation::SetVisible

LAnnPushPin::SetFixed

LAnnotation::GetOptions

LAnnotation::SetOptions

LAnnPushPin::GetBitmap

LAnnPushPin::SetBitmap

LAnnPushPin::GetSecondaryBitmap

LAnnPushPin::SetSecondaryBitmap


Annotation Functions (Document/Medical only): Getting and Setting the ROP2 Property

Annotation Functions:
Object Properties
 Getting and Setting the ROP2 Property

[Document/Medical]

LAnnotation::SetROP2

LAnnotation::GetROP2


Annotation Functions (Document/Medical only): Getting and Setting the Rotation Properties

Annotation Functions (Document/Medical only):
Object Properties
 Getting and Setting the Rotation Properties

LAnnotation::GetRotateOptions

LAnnotation::SetRotateOptions


Annotation Functions (Document/Medical only): Getting and Setting the Ruler Properties

Annotation Functions:
Object Properties
Getting and Setting Ruler Properties

[Document/Medical]

LAnnAutomation::GetBitmapDpiX

LAnnAutomation::GetBitmapDpiY

LAnnAutomation::SetBitmapDpiX

LAnnAutomation::SetBitmapDpiY

LAnnAutomation::GetGaugeLength

LAnnAutomation::SetGaugeLength

LAnnAutomation::GetUnit

LAnnAutomation::GetUnitLen

LAnnAutomation::SetUnit

LAnnRuler::GetGaugeLength

LAnnRuler::SetGaugeLength

LAnnRuler::GetShowFlags

LAnnRuler::GetUnit

LAnnRuler::GetUnitLen

LAnnRuler::SetShowFlags

LAnnRuler::SetUnit

LAnnotation::CalibrateRuler

LAnnotation::GetFillMode

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::SetFillMode

LAnnotation::SetFillModeExt

LAnnotation::SetOptions

LAnnAutomation::GetShowFlags

LAnnAutomation::SetShowFlags

LAnnAutomation::SetTicMarkLength

LAnnotation::CalibrateRuler

LAnnPolyRuler::SetTicMarkLength

LAnnRuler::GetShowFlags

LAnnRuler::SetShowFlags

LAnnRuler::SetTicMarkLength


Annotation Functions (Document/Medical only): Getting and Setting the Stamp Properties

Annotation Functions:
Object Properties
Getting and Setting Stamp Properties

[Document/Medical]

LAnnotation::GetPredefinedMetafile

LAnnotation::SetPredefinedMetafile

LAnnStamp::GetMetafile

LAnnStamp::SetMetafile

LAnnStamp::GetTransparentColor

LAnnStamp::SetTransparentColor

LAnnotation::GetFillModeExt

LAnnotation::GetOptions

LAnnotation::SetFillModeExt

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Getting and Setting the Tag Property

Annotation Functions:
Object Properties
Getting and Setting the Tag Property

[Document/Medical ]

LAnnotation::GetTag

LAnnotation::SetTag


Annotation Functions (Document/Medical only): Getting and Setting the Visible Property

Annotation Functions:
Object Properties
Getting and Setting the Visible Property

[Document/Medical]

LAnnotation::IsVisible

LAnnotation::SetVisible

LAnnotation::GetOptions

LAnnotation::SetOptions


Annotation Functions (Document/Medical only): Size, Position, and Shape

Annotation Functions:
Size, Position, and Shape

[Document/Medical ]

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:
Size, Position, and Shape
Doing Geometric Transformations

[Document/Medical ]

LAnnFreehand::GetPointCount

LAnnPolygon::GetPointCount

LAnnPolyline::GetPointCount

LAnnotation::BringToFront

LAnnotation::Flip

LAnnotation::Move

LAnnotation::Resize

LAnnotation::Reverse

LAnnotation::Rotate

LAnnotation::SendToBack


Annotation Functions (Document/Medical only): Getting and Setting Geometric Properties

Annotation Functions:
Size, Position, and Shape
Getting and Setting Geometric Properties

[Document/Medical ]

Setting up coordinate translations:

LAnnotation::GetScalarX

LAnnotation::SetScalarX

LAnnotation::GetScalarY

LAnnotation::SetScalarY

LAnnotation::GetOffsetX

LAnnotation::SetOffsetX

LAnnotation::GetOffsetY

LAnnotation::SetOffsetY

Defining the position and shape of an object:

LAnnotation::GetRect

LAnnotation::SetRect

LAnnFreehand::GetPointCount

LAnnPolygon::GetPointCount

LAnnPolyline::GetPointCount

LAnnFreehand::GetPoints

LAnnPolyline::SetPoints

LAnnPolygon::GetPoints

LAnnPolyline::GetPoints

LAnnFreehand::SetPoints

LAnnPolygon::SetPoints

LAnnPolyline::SetPoints

Getting the window coordinates of an object:

LAnnotation::GetBoundingRect


Annotation Functions (Document/Medical only): Using Window Coordinates to Define an Object

Annotation Functions:
Size, Position, and Shape
Using Window Coordinates to Define an Object

[Document/Medical ]

LAnnFreehand::Define

LAnnPolygon::Define

LAnnPolyline::Define


Annotation Functions (Document/Medical only): Using Window Coordinates to Select Objects

Annotation Functions:
Size, Position, and Shape
Using Window Coordinates to Select Objects

[Document/Medical ]

Selecting all objects in a rectangle:

LAnnContainer::SelectRect

LAnnContainer::GetSelectCount

LAnnContainer::GetSelectItems

Selecting an object at a particular point:

LAnnContainer::SelectPoint

Getting the bounding rectangle of selected objects:

LAnnContainer::GetSelectRect

Identifying an object at a particular point:

LAnnContainer::HitTest

LAnnotation::SendToBack


Support Functions: Overridables

Detecting the progress of a function:

LBase::EnableStatusCallBack

LBase::StatusCallBack

Class-specific overridables:

LBitmapBase::StartChanging

LBitmapBase::EndChanging

LBitmapBase::ColorResbitmapCallBack

LBitmap::PicturizeCallBack

LBitmapWindow::OnDraw

LBitmapWindow::OnFileDropped

LBitmapWindow::OnZoom

LBitmapWindow::PaintNotification

LBitmapWindow::PanWndCallBack

LBitmapWindow::MsgProcCallBack

LAnimationWindow::AnimateEvent

LAnnotationWindow::OnAnnEvent

LIsis::AcquireMultiCallBack

LBaseFile::LoadInfoCallBack

LBaseFile::RedirectCloseCallBack

LBaseFile::RedirectOpenCallBack

LBaseFile::RedirectReadCallBack

LBaseFile::RedirectSeekCallBack

LBaseFile::RedirectWriteCallBack

LFile::FeedLoadCallBack

LFile::LoadFileCallBack

LFile::LoadFileOffsetCallBack

LFile::LoadFileTileCallBack

LFile::SaveFileCallBack

LFile::SaveFileOffsetCallBack

LFile::SaveFileTileCallBack

LFile::TransformFileCallBack

LMemoryFile::CompressBufferCallBack

LMemoryFile::DecompressMemoryCallBack

LMemoryFile::LoadMemoryCallBack

LMemoryFile::SaveBitmapBufferCallBack

LMemoryFile::SaveFileBufferCallBack

LAnnContainer::EnumerateCallBack

LScreenCapture::CaptureHotKeyCallBack

LScreenCapture::ScreenCaptureCallBack

Supporting L_RedirectIO:

LBaseFile::RedirectCloseCallBack

LBaseFile::RedirectOpenCallBack

LBaseFile::RedirectReadCallBack

LBaseFile::RedirectSeekCallBack

LBaseFile::RedirectWriteCallBack

Screen Capture:

LScreenCapture::CaptureHotKeyCallBack

LScreenCapture::ScreenCaptureCallBack


Support Functions: Callbacks

Support Functions:
Callbacks

Function-specific callbacks

LAnnAudioClip::EnumHandleCallBack

LAnnButton::EnumHandleCallBack

LAnnCrossProduct::EnumHandleCallBack

LAnnCurve::EnumHandleCallBack

LAnnCurveClosed::EnumHandleCallBack

LAnnEllipse::EnumHandleCallBack

LAnnEncrypt::EnumHandleCallBack

LAnnFreehand::EnumHandleCallBack

LAnnFreehandHotSpot::EnumHandleCallBack

LAnnHilite::EnumHandleCallBack

LAnnHotSpot::EnumHandleCallBack

LAnnLine::EnumHandleCallBack

LAnnNote::EnumHandleCallBack

LAnnPolygon::EnumHandleCallBack

LAnnPoint::EnumHandleCallBack

LAnnPolyline::EnumHandleCallBack

LAnnPolyRuler::EnumHandleCallBack

LAnnProtractor::EnumHandleCallBack

LAnnPointer::EnumHandleCallBack

LAnnPushPin::EnumHandleCallBack

LAnnRedact::EnumHandleCallBack

LAnnRectangle::EnumHandleCallBack

LAnnRTF::EnumHandleCallBack

LAnnRuler::EnumHandleCallBack

LAnnStamp::EnumHandleCallBack

LAnnText::EnumHandleCallBack

LAnnTextPointer::EnumHandleCallBack

LAnnToolBar::EnumHandleCallBack

LAnnVideo::EnumHandleCallBack


Support Functions: Version and License Information

Support Functions:
Version and License Information

LSettings::IsSupportLocked

LSettings::UnlockSupport

LBase::VersionInfo


Support Functions: LEADTOOLS Miscellaneous Functions

Support Functions:
Miscellaneous Functions

Low-level conversions

LBitmapRgn::CurveToBezier


Window Messages

LTIMGLISTCLASS Registered Class

Detecting Events

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_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 LAnnotation::Define. 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_ACTIVATE | [3] Indicates that an activation event was triggered by the LAnnotation::SetActiveState 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 LAnnotation::SetActiveState 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 LAnnContainer::Insert 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 LAnnPolyline::Define, LAnnPolygon::Define, or LAnnFreehand::Define functions.
LTANNEVENT_AUTOENDSET | [8] Indicates that the user has finished drawing an object. This event occurs after the last call to the LAnnPolyline::Define, LAnnPolygon::Define, or LAnnFreehand::Define functions.
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 | [21] 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_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(LAnnotation * plAnnObject, L_TCHAR
 szMsg[], LPARAM lParam)
{
pANNCHANGEPARAM pAnnChangeParam = (pANNCHANGEPARAM)lParam;
L_UINT uType;
L_TCHAR szTemp[200];

uType = plAnnObject->GetType();

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_MILLIMETERS:
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;
L_TCHAR * pszMsg = NULL;
L_TCHAR szMsg[500];
HANNOBJECT hObject = (HANNOBJECT)lParam;
LAnnotation MyAnnObject;
pANNCHANGEPARAM pAnnChangeParam;
MyAnnObject.SetHandle(hObject);

// 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(&MyAnnObject,
 szMsg, lParam);
pszMsg = szMsg;

if (pszMsg)
{
L_TCHAR szMsg[300];
L_TCHAR *pszType= NULL;
L_UINT uObjectType=999;

if (hObject)
{
uObjectType = MyAnnObject
 .GetType();
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);
}
}


LBitmapWindow Styles

L_BS_CENTER | [0x00000001] center the image in the bitmap window.
L_BS_PROCESSKEYBOARD | [0x00000002] to enable keyboard processing.


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 LImageListControl::CreateControl 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


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
Topics: |


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
Topics: |


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
Topics: |


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.

See Also

Elements: | L_ILN_SETFOCUS, L_ILN_KILLFOCUS, L_ILN_HSCROLL, L_ILN_VSCROLL, L_ILN_CLICKED, L_ILN_ITEMSEL
Topics: |


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_ITEMSEL
Topics: |


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
Topics: |


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
Topics: |


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
Topics: |


Data Types

Basic Data Types and Keywords

Keywords Used in Declarations

LEADTOOLS Basic Data Types

Image and Toolkit Information Structures

ADDMESGINFO

BITMAPHANDLE

FILEINFO

FlashPix Comments

FlashPix Enumerated Types

FlashPix Structures

VERSIONINFO

Structures Used with Input and Output Functions

DIMENSION

FILEJBIG2OPTIONS

FILEPLTOPTIONS

FILEPDFOPTIONS

FILEPDFSAVEOPTIONS

FILEPTKOPTIONS

FILERTFOPTIONS

FILETXTOPTIONS

LOADFILEOPTION

LOADINFO

MAGGLASSDATA

ZOOMVIEWPROPS

PCDINFO

SAVEFILEOPTION

WINDOWS Structures

Image Processing Structures

ADDBORDERINFO

ADDFRAMEINFO

BALANCING

BALANCEDATA

BINARYFLT

BUMPDATA

CODBLOCKSTYLE

COLORDATA

COLORREPLACE

COMPDATA

CURVE

FILEOVERLAYCALLBACKDATA

FTARRAY

GRAYCOLOR

HSIDATA

HSVREF

COMPLEX

LIGHTINFO

LIGHTPARAMS

LVLCLRINF

LVLCLR

MAGGLASSOPTIONS

MOSAICTILESINFO

OVERLAYATTRIBUTES

PHOTMTRICINTERP

PLASMAINFO

SEARCHMARKS

SELCLRINF

SELCLR

FILETRANSFORMS

SPATIALFLT

STARINFO

STATISTICSINFO

THUMBOPTIONS

USERFLT

VIGNETTEINFO

Image Clean-up Structures

BORDERREMOVE

DOTREMOVE

HOLEPUNCH

INVERTEDTEXT

LINEREMOVE

SMOOTH

ImageList Control Structures

LILCLICK

LILDRAWITEM

LILEXPORTBITMAPLIST

LILIMPORTBITMAPLIST

LILITEM

LILITEMOPTION

LILITEMSEL

LILKEYDOWN

LILSELOPTION

LILSORTOPTIONS

Region Processing Structure

RGNXFORM

Screen Capture Structures

LEADCAPTUREAREAOPTION

LEADCAPTUREINFO

LEADCAPTUREOBJECTOPTION

LEADCAPTUREOPTION

WINDOWCAPTURETYPE

List and Animation Data Types

HBITMAPLIST

HPLAYBACK

Annotation Data Type and Structures (Document/Medical only)

ANNBUTTON

ANNCHANGEPARAM

ANNCHANGETYPE

ANNENCRYPTOPTIONS

ANNFONT

ANNHANDLE

ANNHANDLEINFO

ANNHILIGHT

HITTESTINFO

ANNFILEINFO

ANNHYPERLINK

ANNMOUSEPOS

ANNMOVE

ANNMOVEPOINT

ANNNAMEOPTIONS

ANNPOINT

ANNPOINTOPTIONS

ANNPROTRACTOR

ANNRECT

ANNRESIZEROTATE

ANNRULERUNIT

ANNSMARTDISTANCE

ANNTEXTTOKEN

ANNTEXTTOKENTYPE

ANNTOOL

ANNTOOLBARINFO

ANNXFORM

HANNOBJECT

ANNROTATEOPTIONS

ANNTEXTOPTIONS

Control Notification Message Structures

ANIMATIONEVENTDATA

ANNEVENTDATA ( Document/Medical only)

BLISTINFO

DRAGDROPDATA

KEYDATA

MOUSEDATA

PAINTEFFECTDATA

PANWINDOWDATA

REGIONDATA

SIZEDATA

ZOOMDATA

J2K Structures

FILEJ2KOPTIONS

J2KCOMPRESSIONCONTROL

J2KREGIONOFINTEREST

ICC Profile Structures

MEMICCPROFILE

ICCPROFILEEXT

ICCHEADER

ICCTAG

ICCTAG_LIST

ICC_DATE_TIME_NUMBER

ICC_XYZ_NUMBER

ICCCOLORSPACE

ICCPROFILECLASS

ICCPLATFORMSIGNATURE

ICCRENDERINGINTENT

ICCTAGSIGNATURE

Image Optimization Structures

OPTIMIZEIMAGEOPTIONS

OPTIMIZEIMAGEDIRINFO

JPEGCOLORSPACE


ANNBUTTON

typedef struct _ANNBUTTON
{
L_UINT uFlags;
L_UINT uTool;
L_UINT uToolCount;
pANNTOOL
 pTools;
pBITMAPHANDLE
 pBitmapUp;
pBITMAPHANDLE
 pBitmapDown;
#ifdef WIN32
L_INT nToolTipTextID;
L_TCHAR
 L_FAR *pToolTipText;
#endif
} ANNBUTTON, L_FAR *pANNBUTTON;

The ANNBUTTON structure contains information about buttons contained in the annotation toolbar. [Document/Medical ]

Member | Description
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 being used:

if the old style toolbar is being used, the dimensions should be TOOLBARIMAGECX x TOOLBARIMAGECY

if the new XP style toolbar is being used, the dimensions should be TOOLBARIMAGEXP_CX x TOOLBARIMAGEXP_CY

When using the old style toolbar, it is recommended that all bitmaps 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.

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 LAnnToolBar::FreeToolBarButtons.

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.

Beginning with Version 14.5, two different toolbar styles are available, the original style and a new XP style.

The following figure displays a sample of the original style and the new style:

Note:

In Version 14.5, you need to first enable the display of the XP style toolbar by calling the LAnnotation::SetOptions function with the ANN_OPTIONS_NEW_TOOLBAR flag set. For more information, refer to New Annotation Features of Version 14.5.

If you are using the new style annotation toolbar, the dimensions of the bitmap should be

TOOLBARIMAGEXP_CX by 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). See the documentation for the LAnnotation::SetOptions function for more details on using the new style annotation toolbar.

See Also

Functions:

LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarButtons, LAnnToolBar::SetToolBarButtons


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

ANNCHANGETYPE (Document/Medical only)

typedef enum tagANNCHANGETYPE
{
ANNCHANGE_TAG [1] Tag LAnnotation::SetTag
ANNCHANGE_VISIBLE [2] Visible LAnnotation::SetVisible
ANNCHANGE_SELECTED [3] Selected LAnnotation::SetSelected
ANNCHANGE_FONT_BOLD [4] Font bold LAnnotation::SetFontBold
ANNCHANGE_FONT_ITALIC [5] Font italic LAnnotation::SetFontItalic
ANNCHANGE_FONT_STRIKETHROUGH [6] Font strike-through
 LAnnotation::SetFontStrikeThrough
ANNCHANGE_FONT_UNDERLINE [7] Font underline LAnnotation::SetFontUnderline
ANNCHANGE_LINEWIDTH [8] Line width LAnnAutomation::SetLineWidth
ANNCHANGE_LINESTYLE [9] Line style LAnnAutomation::SetLineStyle
ANNCHANGE_FILLPATTERN [10] Fill pattern LAnnAutomation::SetFillPattern
ANNCHANGE_FILLMODE [11] Fill mode LAnnotation::SetFillMode
 or LAnnotation::SetFillModeExt
ANNCHANGE_POLYFILLMODE [12] Poly fill mode LAnnAutomation::SetPolyFillMode
ANNCHANGE_FONT_SIZE [13] Font size LAnnotation::SetFontSize
ANNCHANGE_FORECOLOR [14] Foreground color LAnnotation::SetForeColor
ANNCHANGE_BACKCOLOR [15] Background color LAnnotation::SetBackColor
ANNCHANGE_TRANSPARENT_COLOR [16] Transparent color LAnnAutomation::SetTransparentColor
ANNCHANGE_TRANSPARENT [17] Transparent LAnnAutomation::SetTransparent
ANNCHANGE_FONT_NAME [18] Font name LAnnotation::SetFontName
ANNCHANGE_TEXT [19] Text LAnnAutomation::SetText
ANNCHANGE_ROP2 [20] ROP2 code LAnnotation::SetROP2
ANNCHANGE_BITMAP [21] Bitmap LAnnContainer::SetBitmap
ANNCHANGE_BITMAP2 [22] Secondary bitmap LAnnPushPin::SetSecondaryBitmap
ANNCHANGE_METAFILE [23] Metafile LAnnStamp::SetMetafile
ANNCHANGE_METAFILE2 [24] Decrypt metafile LAnnStamp::SetMetafile
//
ANNCHANGE_NAME_FORECOLOR [30] Name foreground color LAnnotation::SetNameOptions
ANNCHANGE_NAME_BACKCOLOR [31] Name background color LAnnotation::SetNameOptions
ANNCHANGE_NAME_SHOWNAME [32] Name--show name LAnnotation::SetNameOptions
ANNCHANGE_NAME_OFFSET [33] Name offset LAnnotation::SetNameOptions
ANNCHANGE_NAME_RESTRICT [34] Name restrict LAnnotation::SetNameOptions
ANNCHANGE_NAME_BACKTRANSPARENT [35] Name background transparent
 LAnnotation::SetNameOptions
ANNCHANGE_NAME_TEXT [36] Name text LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_NAME [37] Name--font name LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_BOLD [38] Name--font bold LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_ITALIC [39] Name--font italic LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_STRIKEOUT [40] Name--font strikethrough
 LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_UNDERLINE [41] Name--font underline
 LAnnotation::SetNameOptions
ANNCHANGE_NAME_FONT_SIZE [42] Name--font size LAnnotation::SetNameOptions
//
ANNCHANGE_POINT_USE_BITMAP [50] Point--use bitmap LAnnPoint::SetPointOptions
ANNCHANGE_POINT_RADIUS [51] Point--radius in pixels LAnnPoint::SetPointOptions
ANNCHANGE_POINT_BORDER_COLOR [52] Point--border color
 LAnnPoint::SetPointOptions
ANNCHANGE_POINT_FILL_COLOR [53] Point--fill color LAnnPoint::SetPointOptions
ANNCHANGE_POINT_TRANSPARENT_FILL [54] Point--transparent
 fill LAnnPoint::SetPointOptions
ANNCHANGE_POINT_FIXED_SIZE [55] Point--fixed size LAnnPoint::SetPointOptions
//
ANNCHANGE_SHOW_DEFAULT_HANDLES [60] Show default handles
 LAnnAutomation::SetNodes
ANNCHANGE_GAP_DEFAULT_HANDLES [61] Handle gap LAnnAutomation::SetNodes
ANNCHANGE_HYPERLINK [62] Hyperlink options LAnnotation::SetHyperlink

// Ruler changes
ANNCHANGE_GAUGELENGTH [70] Gauge length LAnnAutomation::SetGaugeLength
ANNCHANGE_BITMAP_DPI_X [71] Bitmap DPI -- horizontal
 LAnnAutomation::SetBitmapDpiX
ANNCHANGE_BITMAP_DPI_Y [72] Bitmap DPI -- vertical LAnnAutomation::SetBitmapDpiY
ANNCHANGE_RULER_UNIT [73] Ruler unit, abreviation, precision
 LAnnAutomation::SetUnit
ANNCHANGE_RULER_SHOW_FLAGS [74] Ruler show flags LAnnAutomation::SetShowFlags
ANNCHANGE_PROTRACTOR [75] Protractor options LAnnProtractor::SetProtractorOptions

ANNCHANGE_ENCRYPTOR_TYPE [80] Encryptor type LAnnEncrypt::SetEncryptOptions
ANNCHANGE_ENCRYPTOR_KEY [81] Encryptor key LAnnEncrypt::SetEncryptOptions
ANNCHANGE_ENCRYPTOR_NEVER_ENCRYPTED [82] Indicates if
 never encrypted LAnnEncrypt::SetEncryptOptions
ANNCHANGE_ENCRYPTOR_BITMAP [83] Bitmap to be encrypted
 LAnnEncrypt::SetEncryptOptions
///
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 LAnnAutomation::Undo
ANNCHANGE_CUT [101] Annotation cut to clipboard LAnnotation::CutToClipboard
ANNCHANGE_PASTE [102] Annotation paste LAnnotation::CopyFromClipboard
ANNCHANGE_DELETE [103] Object being deleted LAnnotation::Destroy
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 LAnnotation::Lock
ANNCHANGE_UNLOCK [108] Unlock one object LAnnotation::Unlock
ANNCHANGE_LOCK_SELECTED [109] Menu: Lock selected objects
ANNCHANGE_UNLOCK_SELECTED [110] Menu: Unlock selected
 objects
ANNCHANGE_INSERT [111] Insert object into container LAnnContainer::Insert
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 LAnnXXXX 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;

The ANNENCRYPTOPTIONS structure is used with the functions LAnnEncrypt::SetEncryptOptions and LAnnEncrypt::GetEncryptOptions to get or set options on an annotation encrypt object. This encrypt object may be in the encryptor state or the decryptor state.

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 LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::SaveTag.
 | FALSE | Encryptor keys are saved with a value of 0 with LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::SaveTag.
bSaveDecryptorKey | Flag that indicates if decryptor keys are saved. Possible values are:
 | Value | Meaning
 | TRUE | Decryptor keys are saved with LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::SaveTag.
 | FALSE | Decryptor keys are saved with a value of 0 with LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::SaveTag.
bClearEncryptorKey | Flag that indicates what happens to encrypt keys after calling LAnnContainer::EncryptApply
 | 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 LAnnContainer::EncryptApply.
 | 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 LAnnContainer::Save,
 LAnnContainer::SaveOffset,
 LAnnContainer::SaveMemory,
 LAnnContainer::SaveTag.


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;

This structure is part of the ANNNAMEOPTIONS structure, and is used for setting or getting font characteristics of the annotation name.

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.

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 (LAnnContainer::HitTestExt)
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 LAnnRTF::AddUserHandle.

This structure is used with the AddUserHandle, ChangeUserHandle, DeleteUserHandle, GetUserHandle, GetUserHandles, EnumerateHandles, and EnumHandleCallback functions of the LAnnAudioClip, LAnnButton, LAnnCrossProduct, LAnnCurve, LAnnCurveClosed, LAnnEllipse, LAnnEncrypt, LAnnFreehand, LAnnFreehandHotSpot, LAnnHilite, LAnnHotSpot, LAnnLine, LAnnNote, LAnnPolygon, LAnnPoint, LAnnPolyline, LAnnPolyRuler, LAnnProtractor, LAnnPointer, LAnnPushPin, LAnnRedact, LAnnRectangle, LAnnRTF, LAnnRuler, LAnnStamp, LAnnText, LAnnTextPointer, LAnnToolBar, LAnnVideo classes.

See Also

Functions:

LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define


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 with the EnumerateHandles function of the LAnnAudioClip, LAnnButton, LAnnCrossProduct, LAnnCurve, LAnnCurveClosed, LAnnEllipse, LAnnEncrypt, LAnnFreehand, LAnnFreehandHotSpot, LAnnHilite, LAnnHotSpot, LAnnLine, LAnnNote, LAnnPolygon, LAnnPoint, LAnnPolyline, LAnnPolyRuler, LAnnProtractor, LAnnPointer, LAnnPushPin, LAnnRedact, LAnnRectangle, LAnnRTF, LAnnRuler, LAnnStamp, LAnnText, LAnnTextPointer, LAnnToolBar, LAnnVideo classes.

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 ChangeUserHandle or DeleteUserHandle functions of the LAnnAudioClip, LAnnButton, LAnnCrossProduct, LAnnCurve, LAnnCurveClosed, LAnnEllipse, LAnnEncrypt, LAnnFreehand, LAnnFreehandHotSpot, LAnnHilite, LAnnHotSpot, LAnnLine, LAnnNote, LAnnPolygon, LAnnPoint, LAnnPolyline, LAnnPolyRuler, LAnnProtractor, LAnnPointer, LAnnPushPin, LAnnRedact, LAnnRectangle, LAnnRTF, LAnnRuler, LAnnStamp, LAnnText, LAnnTextPointer, LAnnToolBar, LAnnVideo classes. 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 LAnnotation::Define. The message is also useful for updating information about an annotation in real time.


HITTESTINFO

HITTESTINFO (Document/Medical only)

typedef struct tagHITTESTINFO
{
L_UINT uStructSize;
L_INT nHandleIndex;
L_INT nHandleID;
L_INT nReserved;
} L_FAR *pHITTESTINFO, HITTESTINFO;

The HITTESTINFO structure provides hit test information for the LAnnContainer::HitTestExt function. [ Document/Medical ]

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 LAnnContainer::HitTestExt 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 LAnnXXX::AddUserHandle, LAnnXXX::ChangeUserHandle, or LAnnXXX::EnumerateHandles functions, where LAnnXXX represents the classes that support handles. These classes are as follows:
 | LAnnAudioClip
 | LAnnButton
 | LAnnCrossProduct
 | LAnnCurve
 | LAnnCurveClosed
 | LAnnEllipse
 | LAnnEncrypt
 | LAnnFreehand
 | LAnnFreehandHotSpot
 | LAnnHilite
 | LAnnHotSpot
 | LAnnLine
 | LAnnNote
 | LAnnPolygon
 | LAnnPoint
 | LAnnPolyline
 | LAnnPolyRuler
 | LAnnProtractor
 | LAnnPointer
 | LAnnPushPin
 | LAnnRedact
 | LAnnRectangle
 | LAnnRTF
 | LAnnRuler
 | LAnnStamp
 | LAnnText
 | LAnnTextPointer
 | LAnnToolBar
 | LAnnVideo
nReserved | Reserved for future use. Set this field to zero.

Comments

For an example showing the use of this structure, refer to LAnnContainer::HitTestExt.

See Also

Functions: | LAnnContainer::HitTestExt, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Creating Custom Annotations


ANNFILEINFO

typedef struct tagANNFILEINFO
{
L_INT32 nSize;
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
nSize | 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 '13' is returned, this refers to version 13 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 LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory and LAnnContainer::FileInfoOffset 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.


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

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. [Document/Medical ]

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 the LAnnXXX::AddUserHandle, LAnnXXX::DeleteUserHandle, LAnnXXX::ChangeUserHandle, or LAnnXXX::EnumerateHandles functions, where LAnnXXX represents the classes that support handles. These classes are as follows:
 | LAnnAudioClip , LAnnButton , LAnnCrossProduct , LAnnCurve , LAnnCurveClosed , LAnnEllipse , LAnnEncrypt , LAnnFreehand , LAnnFreehandHotSpot , LAnnHilite , LAnnHotSpot , LAnnLine , LAnnNote , LAnnPolygon , LAnnPoint , LAnnPolyline , LAnnPolyRuler , LAnnProtractor , LAnnPointer , LAnnPushPin , LAnnRedact , LAnnRectangle , LAnnRTF , LAnnRuler , LAnnStamp , LAnnText , LAnnTextPointer , LAnnToolBar , LAnnVideo
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;

The ANNNAMEOPTIONS structure is used with the functions LAnnotation::SetNameOptions and LAnnotation::GetNameOptions to get or set the name options on any annotation object.

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

When calling LAnnotation::GetNameOptions, the uFlags field identifies which fields to retrieve. When calling LAnnotation::SetNameOptions, 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 LAnnAutomation::SetAutoText with uItem set to ANNAUTOTEXT_ITEM_DEFAULTNAME, and pText set to your desired default string. For example:

LAnnAutomation::SetAutoText(hAutomation, ANNAUTOTEXT_ITEM_DEFAULTNAME, "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 LAnnotation::SetNameOptions.
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 LAnnotation::GetNameOptions to determine the length of the character string. Then, you must allocate a character string of this length, and call LAnnotation::GetNameOptions again.

The sample illustrates this.

Example

For an example, refer to LAnnotation::SetNameOptions.


ANNPOINT

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. [ Document/Medical ]

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;

The ANNPOINTOPTIONS structure
 is used with the functions LAnnAutomation::SetPointOptions,
 LAnnPoint::SetPointOptions
 and LAnnAutomation::GetPointOptions,
 LAnnPoint::GetPointOptions
 to get or set options on an annotation point object.

Member | Description
uStructSize | Size of this structure. Use sizeof(ANNENCRYPTOPTIONS)
uFlags | Identifies 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

When calling LAnnAutomation::GetPointOptions or LAnnPoint::GetPointOptions, the uFlags field identifies which fields to retrieve. When calling LAnnAutomation::SetPointOptions or LAnnPoint::SetPointOptions, 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;

LAnnAutomation::GetPointOptions,
 LAnnPoint::GetPointOptions(hObject,
 &PointOptions);

If the call to LAnnAutomation::GetPointOptions or LAnnPoint::GetPointOptions is successful, PointBitmap now contains the point bitmap. You must call LBitmapBase::Free(&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 LAnnAutomation::SetPointOptions or LAnnPoint::SetPointOptions.

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

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. [ Document/Medical ]

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 LAnnotation::Define explicitly)

Rotate—Shift-clicking a handle in automated mode

Resizing—dragging a vertex of a rectangular object

Resize/Rotate—by calling LAnnotation::Define 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


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 the ANNROTATEOPTIONS structure. This should be sizeof(ANNROTATEOPTIONS). You must fill this member.
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] The 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 LAnnotation::SetRotateOptions and LAnnotation::GetRotateOptions to get or set the rotate options on any annotation object, including the automation object.

When calling LAnnotation::GetRotateOptions, the uFlags field identifies which fields to retrieve. When calling LAnnotation::SetRotateOptions, 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.

This structure is used with two of the new functions being introduced as part of Version 14.5.


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; // sizeof(ANNSMARTDISTANCE)
L_DOUBLE dDistance; // distance in units
L_UINT uRulerUnit; // One of the ANNUNIT_XXXX constants
L_UINT uSmartUnit; // One of the ANNUNIT_XXXX constants
} 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 LAnnPolyRuler::GetDistance2.

See Also

Functions:

LAnnPolyRuler::GetDistance2, LAnnAutomation::SetBitmapDpiX, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetBitmapDpiY, LAnnRuler::GetUnit, LAnnPolyRuler::GetUnitLen, LAnnPolyRuler::GetDistance, LAnnRuler::SetGaugeLength, LAnnRuler::GetGaugeLength, LAnnRuler::SetUnit.


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;

The ANNTEXTOPTIONS structure 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. 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 LAnnotation::SetTextOptions and the LAnnotation::GetTextOptions functions to get or set the text options for text annotation objects, including the Automation object. If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function.

When calling the LAnnotation::GetTextOptions function, the uFlags field identifies which fields to retrieve. When calling the LAnnotation::SetTextOptions 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:

LAnnContainer

LAnnAutomation

LAnnText

LAnnTextPointer

LAnnStamp

LAnnNote

LAnnPushPin

LAnnButton

The default value for bShowBorder is TRUE. This flag affects the following objects:

LAnnText

LAnnStamp


ANNTEXTTOKEN (Document/Medical only)

typedef struct tagANNTEXTTOKEN
{
L_UINT uStructSize; // sizeof this structure
L_TCHAR cToken; // character representing the token
L_TCHAR *pszDesc; // description of the token
L_TCHAR *pszTokenString; // definition of the token
ANNTEXTTOKENTYPE nTokenType; // constant defining the type of token
L_INT nReserved; // reserved for future use
} 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:

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::EnumerateTextTokenTable

For more information, see the topic The Annotation Text Token Table.

See Also

Functions: | LAnnAutomation::ClearTextTokenTable, LAnnAutomation::DeleteTextTokenTable, LAnnAutomation::EnumerateTextTokenTable, LAnnAutomation::GetTextExpandTokens, LAnnAutomation::InsertTextTokenTable, LAnnAutomation::SetTextExpandTokens
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 enumeartion is used in the following structure:

ANNTEXTTOKEN


ANNTOOL

typedef struct _ANNTOOL
{
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. [ Document/Medical ]

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

See Also

Topics:

ANNBUTTON


ANNTOOLBARINFO

typedef struct _ANNTOOLBARINFO
{
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. [ Document/Medical ]

Member | Description
uButtons | Number of buttons in the toolbar.
uRows | Number of rows in the toolbar.
uColumns | Number of columns in the toolbar.

Comments

To retrieve information about the layout of the toolbar, call LAnnToolBar::GetToolBarInfo.

To modify the layout of the toolbar, call LAnnToolBar::SetToolBarColumns and LAnnToolBar::SetToolBarRows.

See Also

Functions:

LAnnToolBar::GetToolbarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows


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.


HANNOBJECT

LEADTOOLS has defined the following data types for referencing annotation objects: [Document/Medical ]

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.


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.


ANIMATIONEVENTDATA

typedef struct tagANIMATIONEVENTDATA
{
HWND hAnimationWindow;
LAnimationWindow L_FAR *pClass;
L_UINT nEvent;
L_UINT nFrameNumber;
} ANIMATIONEVENTDATA, L_FAR * LPANIMATIONEVENTDATA;

Member | Description
hAnimationWindow | Handle to the animation window.
pClass | Pointer to an LAnimationWindow object.
nEvent | Used only for LAM_PLAYBACK_EVENT. Possible values are:

Value | Meaning
EVENT_PLAYSTATE_START | User started an animation.
EVENT_PLAYSTATE_END | User stopped an animation.
EVENT_PLAYSTATE_PRECLEAR | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_POSTCLEAR | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_PRERENDER | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_RENDER | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_POSTRENDER | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_WAITINPUT | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_WAITDELAY | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_WAITINPUTDELAY | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_PREDISPOSE | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_POSTDISPOSE | Triggered during animation playback. For more information, refer to LPlayBack::GetState.
EVENT_PLAYSTATE_LOOP | Animation playback has looped back to the first frame

nFrameNumber

The frame number.


ANNEVENTDATA

typedef struct tagANIMATIONEVENTDATA
{
HWND hBitmapAnnWindow;
LAnnotationWindow
 L_FAR *pClass;
HANNOBJECT hAnnObject;
} ANNEVENTDATA, L_FAR * pANNEVENTDATA;

Member | Description
hAnimationWindow | Handle to the annotation window.
pClass | Pointer to an LAnnotationWindow object.
hAnnObject | An annotaiton object.


BLISTINFO

typedef struct tagBLISTINFO
{
L_INT nWidth;
L_INT nHeight;
L_UINT uViewPerspective;
L_UINT uCurrentIndex;
L_BOOL bGlobalBackground;
COLORREF crBackground;
L_BOOL bGlobalLoop;
L_UINT uGlobalLoop;
L_BOOL bGlobalPalette;
RGBQUAD Palette[256];

} BLISTINFO, L_FAR * LPBLISTINFO;

Member | Description
nWidth | Global width for the bitmap list items.
nHeight | Global height for the bitmap list items.
uViewPerspective | View perspective for the bitmap list items.
uCurrentIndex | Current index for the bitmap list object.
bGlobalBackground | TRUE if the bitmap list has a global background.
crBackground | The background color for the bitmap list items.
bGlobalLoop | TRUE if the bitmap list has a global loop.
uGlobalLoop | The value of the global loop for the bitmap list.
bGlobalPalette | TRUE if the bitmap list has a global palette.
Palette[256] | Global palette entries for the bitmap list.


DRAGDROPDATA

typedef struct tagDRAGDROPDATA
{
HWND hWnd;
union
{
LBitmapWindow
 L_FAR* pBitmapWindowClass;
LVectorWindow L_FAR* pVectorWindowClass;
} Class;
L_UINT uFilesCount;
L_UINT uFileNumber;
L_TCHAR L_FAR
 * pszFileName;
} DRAGDROPDATA, L_FAR * pDRAGDROPDATA;

Member | Description
hBitmapWindow | Handle to the bitmap window.
pClass | Pointer to an LBitmapWindow object.
nFileCount | Total number of dropped files.
nFileNumber | The number of the dropped file.
pszFileName | The name of the dropped file.


KEYDATA

typedef struct tagKEYDATA
{
HWND hWnd;
union
{
LBitmapWindow
 L_FAR *pBitmapWindowClass;
LVectorWindow L_FAR
 *pVectorWindowClass;
} Class;
L_INT32 nVirtKey;
L_INT32 lKeyData;
} KEYDATA, L_FAR * pKEYDATA;

Member | Description
hWnd | Handle to the bitmap window.
pBitmapWindowClass | Pointer to an LBitmapWindow object.
pVectorWindowClass | Pointer to an LVectorWindow object.
nVirtKey | Virtual-key or character code.
lKeyData | Key data.


MOUSEDATA

typedef struct tagMOUSEDATA
{
HWND hWnd;
union
{
LBitmapWindow
 L_FAR *pBitmapWindowClass;
LVectorWindow L_FAR
 *pVectorWindowClass;
} Class;
L_UINT32 fwKeys;
L_INT16 xPos;
L_INT16 yPos;
} MOUSEDATA, L_FAR * pMOUSEDATA;

Member | Description
hWnd | Handle to the bitmap window.
pBitmapWindowClass | Pointer to an LBitmapWindow object.
pVectorWindowClass | Pointer to an LVectorWindow object.
fwKeys | Key flags.
xPos | Horizontal position of the cursor.
yPos | Vertical position of the cursor.


PAINTEFFECTDATA

typedef struct tagPAINTEFFECTDATA
{
HWND hBitmapWindow;
LBitmapWindow
 L_FAR *pClass;
HWND hPanWindow;
L_UINT uPass;
L_UINT uType;
} PAINTEFFECTDATA, L_FAR * LPPAINTEFFECTDATA;

Member | Description
hBitmapWindow | Handle to the bitmap window.
pClass | Pointer to an LBitmapWindow object.
uPass | The number of completed passes.
uType | The type of effect. Possible values are:

Value | Meaning
EFX_NOTIFY_TRANSITION | painting a transition.
EFX_NOTIFY_IMAGE | painting an image.


PANWINDOWDATA

typedef struct tagPANWINDOWDATA
{
HWND hBitmapWindow;
LBitmapWindow
 L_FAR *pClass;
HWND hPanWindow;
L_UINT uFlag;
LPRECT rcPan;
} PANWINDOWDATA, L_FAR * LPPANWINDOWDATA;

Member | Description
hBitmapWindow | Handle to the bitmap window.
pClass | Pointer to an LBitmapWindow object.
hPanWindow | Handle to the Pan Window.
uFlag | Pan Window notification flag.
rcPan | Pointer to the Pan Rect.


REGIONDATA

typedef struct tagREGIONDATA
{
HWND hBitmapWindow;
LBitmapWindow
 L_FAR *pClass;
L_INT nModificationType;
} REGIONDATA, L_FAR * LPREGIONDATA;

Member | Description
hBitmapWindow | Handle to the bitmap window.
pClass | Pointer to an LBitmapWindow object.
nModificationType | The type of modification made to the region. Possible values are:
Value | Meaning
0 | The region was created.
1 | The region was destroyed.
2 | The region was modified.


SIZEDATA

typedef struct tagSIZEDATA
{
HWND hWnd;
union
{
LBitmapWindow
 L_FAR *pBitmapWindowClass;
LVectorWindow L_FAR
 *pVectorWindowClass;
} Class;
L_INT fwSizeType;
L_INT16 nWidth;
L_INT16 nHeight;
} SIZEDATA, L_FAR * pSIZEDATA;

Member | Description
hWnd | Handle to the bitmap window.
pBitmapWindowClass | Pointer to an LBitmapWindow object.
pVectorWindowClass | Pointer to an LVectorWindow object.
fwSizeType | Resizing flag.
nWidth | Width of the client area.
nHeight | Height of the client area.


ZOOMDATA

typedef struct tagZOOMDATA
{
HWND hWnd;
union
{
LBitmapWindow
 L_FAR *pBitmapWindowClass;
LVectorWindow L_FAR
 *pVectorWindowClass;
} Class;
L_UINT uZoomPercent;
} ZOOMDATA, L_FAR * pZOOMDATA;

Member | Description
hWnd | Handle to the bitmap window.
pBitmapWindowClass | Pointer to an LBitmapWindow object.
pVectorWindowClass | Pointer to an LVectorWindow object.
uZoomPercent | The percent zoom.


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


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 ICCHEADER structure to indicate the color space.


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


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


ICCRENDERINGINTENT

typedef enum
{
Perceptual = 0x00000000,
RelativeColorimetric = 0x00000001,
Saturation = 0x00000002,
AbsoluteColorimetric = 0x00000003
} ICCRENDERINGINTENT;

This enumerated type is used within the ICCHEADER structure to indicate the rendering intent.


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


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.


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:

LFile::FreeICCProfile

LFile::InitICCProfile

LFile::LoadICCProfile


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 LBitmap::ExtractMessage and LBitmap::AddMessage 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 LBitmap::ExtractMessage 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.


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.

The LBitmapBase class contains a data member of type BITMAPHANDLE. You can access the LBitmapBase object's internal BITMAPHANDLE using the following member functions:

LBitmapBase::GetHandle
LBitmapBase::GetWidth
LBitmapBase::GetHeight
LBitmapBase::GetMemSize
LBitmapBase::IsAllocated
LBitmapBase::GetColorOrder
LBitmapBase::GetXResolution
LBitmapBase::GetYResolution
LBitmapBase::SetXResolution
LBitmapBase::SetYResolution
LBitmapBase::IsMemoryLocked
LBitmapBase::GetBitsPerPixel
LBitmapBase::GetBytesPerLine
LBitmapBase::Is1BitCompressed
LBitmapBase::IsUsingDiskMemory
LBitmapBase::GetViewPerspective
LBitmapBase::SetViewPerspective
LBitmapBase::IsUsingConventionalMemory
LBitmapBase::IsProgressive
LBitmapBase::IsPlayBackWaitUserInput
LBitmapBase::IsPlayBackTransparencyEnabled
LBitmapBase::EnablePlayBackTransparency
LBitmapBase::SetPlayBackTransparentColor
LBitmapBase::GetPlayBackTransparentColor
LBitmapBase::IsPixelsSigned
LBitmapBase::GetDitheringMethod
LBitmapBase::SetDitheringMethod
LBitmapBase::GetPlayBackLeft
LBitmapBase::SetPlayBackLeft
LBitmapBase::GetPlayBackTop
LBitmapBase::SetPlayBackTop
LBitmapBase::GetPlayBackDisposalMethod
LBitmapBase::SetPlayBackDisposalMethod
LBitmapBase::GetPlayBackBackGroundColor
LBitmapBase::SetPlayBackBackGroundColor
LBitmapBase::SetPlayBackDelay
LBitmapBase::GetPlayBackDelay
LBitmapBase::IsInterlaced
LBitmapBase::GetPalette
LBitmapBase::SetPalette
LBitmapBase::IsSuperCompressed

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. 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.
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 and ORDER_GRAY.
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 LBitmapSettings::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 to 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.

Support for super compressing bitmaps is available only in the Document/Medical toolkits.


FILEINFO

The FILEINFO structure, which is loaded by the LFile::GetInfo function, provides information about the specified file.

Note: The LTFIL.H header file describes the entire FILEINFO structure.

Member | Data Type | Description
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 multipage file. To determine the total number of pages in a file, call LFile::GetInfo with uFlags set to FILEINFO_TOTALPAGES.
TotalPages | L_INT | The total number of pages present in a file. To update this field, call LFile::GetInfo with uFlags set to FILEINFO_TOTALPAGES. If you do not want this field updated, call LFile::GetInfo 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 Lfile::GetInfo 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. 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.

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];
}

LFileSettings::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;

LFileSettings::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;

LFileSettings::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;
}

LFileSettings::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

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;
}

LFileSettings::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;

LFileSettings::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

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;
}

LFileSettings::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;

LFileSettings::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;

LFileSettings::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

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;
}

LFileSettings::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

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;
}

LFileSettings::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];
}

LFileSettings::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

LFileSettings::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];
}

LFileSettings::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

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);

}

LFileSettings::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 LFile::ReadCommentExt 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 LFile::ReadCommentExt.

The FILECOMMENTS structure must be filled before using LFile::ReadCommentExt:

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 LFile::ReadCommentExt.

********************************************************************************************************************************************************************************************************************************

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_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 LBase::VersionInfo function, provides information about the LEADTOOLS toolkit.

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


BORDERREMOVE

typedef struct tagBORDERREMOVE
{
L_UINT uStructSize;
L_INT32 iSize;
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 LBitmap::BorderRemove function.

Member | Description
uStructSize | Size of this structure in bytes. Use the sizeof() macro to calculate this value.
iSize: | Size of this structure.
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 LBitmap::BorderRemove, if the LBitmap::BorderRemoveCallback callback member function returns SUCCESS_REMOVE, the removed border is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the border is not added to the single region. When LBitmap::BorderRemove 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 LBitmap::BorderRemove 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 LBitmap::BorderRemove returns.
BORDER_IMAGE_UNCHANGED | The original image is unchanged.
BORDER_CALLBACK_REGION | LBitmap::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 member function, if the callback member function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback member function returns SUCCESS_REMOVE results in a 4region identical to the region created when BORDER_SINGLE_REGION is set in uFlags. For an example, refer to LBitmap::BorderRemove. When the region received by the callback member 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 LBitmap::BorderRemove 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 LBitmapRgn::Free when it is no longer needed. Refer to the LBitmap::BorderRemove example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::BorderRemove 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 LBitmap::BorderRemove, try modifying the values for iWhiteNoiseLength, iBorderPercent and iVariance.


DOTREMOVE

typedef struct tagDOTREMOVE
{
L_UINT uStructSize;
L_INT32 iSize;
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 LBitmap::DotRemove function.

Member | Description
uStructSize | Size of this structure in bytes. Use the sizeof() macro to calculate this value.
iSize | Size of this structure.
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 LBitmap::DotRemove, if the LBitmap::DotRemoveCallback callback member function returns SUCCESS_REMOVE, the removed dot is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the dot is not added to the single region. When LBitmap::DotRemove 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 LBitmap::DotRemove 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. Set uFlags to DOT_SINGLE_REGION | DOT_LEAD_REGION. This variable will be updated when LBitmap::DotRemove 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 | LBitmap::DotRemoveCallback callback member function 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 member function, if the callback member 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 LBitmap::DotRemove. 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 LBitmap::DotRemove 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 LBitmapRgn::Free() when it is no longer needed. Refer to the LBitmap::DotRemove example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::DotRemove 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.


HOLEPUNCH

typedef struct tagHOLEPUNCH
{
L_UINT uStructSize;
L_INT32 iSize;
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 LBitmap::HolePunchRemove function.

Member | Description
uStructSize | Size of this structure in bytes. Use the sizeof() macro to calculate this value.
iSize | Size of this structure.
uFlags | Flags that determine the behavior of the border removal process. Flags may be combined using a bitwise OR (|). Possible values are:

Value | Meaning
HOLEPUNCH_SINGLE_REGION: | For each hole punch encountered by LBitmap::HolePunchRemove, if the LBitmap::HolePunchRemoveCallback callback member function returns SUCCESS_REMOVE, the removed hole punch is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the hole punch is not added to the single region. When LBitmap::HolePunchRemove 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 punches. 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 LBitmap::HolePunchRemove 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 LBitmap::HolePunchRemove 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 | LBitmap::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 member function, if the callback member function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback member 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 LBitmap::HolePunchRemove. When the region received by the callback member 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 LBitmap::HolePunchRemove 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 LBitmapRgn::Free() when it is no longer needed. Refer to the LBitmap::HolePunchRemove example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmap. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::HolePunchRemove 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.


INVERTEDTEXT

typedef struct tagINVERTEDTEXT
{
L_UINT uStructSize;
L_INT32 iSize;
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 used by LBitmap::InvertedText to find and modify inverted text.

Member | Description
uStructSize | Size of this structure in bytes. Use the sizeof() macro to calculate this value.
iSize | Size of this structure
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 LBitmap::InvertedText, if the LBitmap::InvertedTextCallback Callback member function returns SUCCESS_REMOVE, the inverted text is corrected and is added to an internal single region. If the callback returns SUCCESS_NOREMOVE, the inverted text is not corrected and is not added to the single region. When LBitmap::InvertedText returns, either pBitmapRegion or hRgn will reference a region that contains all the corrected, 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 corrected inverted text. If INVERTEDTEXT_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the corrected 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 LBitmap::InvertedText returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the corrected 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 LBitmap::InvertedText 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 | LBitmap::InvertedTextCallback Callback member function 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 corrected inverted text by combining the regions received by the callback member function, if the callback member function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback member 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 LBitmap::InvertedText. When the region received by the callback member 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 LBitmap::InvertedText 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 LBitmapRgn::Free() when it is no longer needed. Refer to the LBitmap::InvertedText example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::InvertedText 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.


LINEREMOVE

typedef struct tagLINEREMOVE
{
L_UINT uStructSize;
L_INT32 iSize;
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 LBitmap::LineRemove function.

Member | Description
uStructSize | Size of this structure in bytes. Use the sizeof() macro to calculate this value.
iSize: | size of this structure
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 encountered by LBitmap::LineRemove, if the LBitmap::LineRemoveCallback callback member function returns SUCCESS_REMOVE, the removed line is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the line is not added to the single region. When LBitmap::LineRemove 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 LBitmap::LineRemove 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 LBitmap::LineRemove 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 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 LINEREMOVE structure is pixels.
LINE_CALLBACK_REGION | LBitmap::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 member function, if the callback member function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback member 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 LBitmap::LineRemove. When the region received by the callback member 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 LBitmap::LineRemove 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 LBitmapRgn::Free() when it is no longer needed. Refer to the LBitmap::LineRemove example to see how pBitmapRegion is used and freed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::LineRemove 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 LBitmap::LineRemove, try modifying the values for iWall, iGapLength and iVariance.


SMOOTH

typedef struct tagSMOOTH

{
L_UINT uStructSize;
L_INT32 iSize;
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 LBitmap::Smooth function.

Member | Description
uStructSize | Size of this structure in bytes. 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 encountered by LBitmap::Smooth, if the LBitmap::SmoothCallback member function returns SUCCESS_REMOVE, the removed bump or nick is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the bump or nick is not added to the single region. When LBitmap::Smooth 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.
SMOOTH_LEAD_REGION | When LBitmap::Smooth 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 LBitmap::Smooth 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 LBitmap::Smooth 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 LBitmapRgn::Free() when it is no longer needed.
uBitmapStructSize | Size of the structure pointed to by pBitmapRegion. Use sizeof(BITMAPHANDLE).
hRgn | Handle to a windows region. When LBitmap::Smooth 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.


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.


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

Comments

This structure is used by the LOptimize::OptimizeDirCallBack 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 represents the highest quality and 255 represents the most compression. This value is used only if the original image format is one of the LEAD Supported JPEG Formats. The default value is 35.
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 Format 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 an individual palette for each GIF Frame. (Default)

Comments

This structure is used only by the Image Optimizing functions:

LOptimize::GetDefaultOptions function.

LOptimize::OptimizeBuffer function.

LOptimize::OptimizeDir function.


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

This structure is used by the LBitmap::AddBorder function.

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. 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 LBitmap::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 LBitmap::AddFrame function.


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 LBitmap::ColorIntensityBalance function.

Member | Description
uStructSize | The 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_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 LBitmap::BinaryFilter 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.


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 LBitmap::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 LBitmap::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 LBitmap::ColorReplace 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 LBitmap::ColorThreshold function.

Member | Description
uStructSize | The 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.


L_COMPLEX

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:

LBitmap::AllocFTArray

LBitmap::DFT

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FTDisplay

LBitmap::FrqFilter

LBitmap::FrqFilterMask


CURVE

CURVE (Document/Medical only)

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 LBitmapRgn::SetRgnCurve function and the LBitmapRgn::CurveToBezier function.

Member | Description
uStructSize | Size of the structure. This must be set before passing this structure to the LEAD functions.
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. (Catmull-Rom)
 | CURVE_NATURAL_CUBIC_SPLINE | The points specified in the pPoints field define a standard curve (Natural Cubic Spline)
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 or CURVE_NATURAL_CUBIC_SPLINE, 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 LBitmapRgn::SetRgnCurve function to draw a curve using an array of POINT items. It is also used by the LBitmapRgn::CurveToBezier function to convert a curve to a Bezier. The CURVE structure can define three 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.

nType is CURVE_NATURAL_CUBIC_SPLINE: A smooth curve that passes through all of the points. The field nPointCount must be at least three. This differs from CURVE_STANDARD (Catmull-Rom) in that moving one point causes all curve segments to change. For the CURVE_STANDARD, moving one point affects only the adjacent curve segments.


FILEOVERLAYCALLBACKDATA

The FILEOVERLAYCALLBACKDATA structure passed to the LBase::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 LBitmapbase::free on this bitmap. LEADTOOLS will free it for you once its done overlaying it on the image.

Example

For an example, refer to the LBase::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 LFile::WriteFileTransforms. The next time the image is loaded, you may examine the transforms stored with the image using the LFile::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 LFile::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 LFile::ReadFileTransforms and LFile::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 LFile::GetInfo. 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 LFile::GetInfo. 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:

LBitmap::AllocFTArray

LBitmap::DFT

LBitmap::FFT

LBitmap::FreeFTArray

LBitmap::FTDisplay

LBitmap::FrqFilter

LBitmap::FrqFilterMask


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 LBitmap::ColorizeGray.

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

LBitmap::ColorizeGray 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 LBitmap::ColorizeGray function.


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 LBitmap::ChangeHueSatIntBitmap function.

Member | Description
uStructSize | The 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 the LBitmapRgn::SetRgnColorHSVRange function.


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 LBitmap::Light 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 LBitmap::FunctionalLight 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 the LBitmap::FunctionalLight function.


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 LBitmap::ColorLevel) or to retrieve color-leveling information (when used in LBitmap::AutoColorLevel).

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 LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel 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 LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel 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 LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel 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 LBitmap::ColorLevel. When used in LBitmap::AutoColorLevel with the flag AUTO_LEVEL, it retrieves the color-leveling information of the blue channel.

Comments

When used in the LBitmap::ColorLevel 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 LBitmap::AutoColorLevel 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 LBitmap::ColorLevel function, the effect produced will be the same as if the LBitmap::AutoColorLevel function had been used with the appropriate AUTO_LEVEL, AUTO_CONTRAST, or AUTO_INTENSITY processing flag.

If uFlags in LBitmap::AutoColorLevel is set to AUTO_LEVEL, then the master channel is unchanged. For example, if the bitmap is 8 bits per component then uMinInput, uMaxInput, uMinOutput, uMaxOutput and uGamma will have the values 0, 255, 0, 255 and DEFAULT_GAMMA respectively.

If uFlags in LBitmap::AutoColorLevel 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 uMinInput, uMaxInput, uMinOutput, uMaxOutput and uGamma for 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 functions:

LBitmap::AutoColorLevel

LBitmap::ColorLevel


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_MagGlassPaintOptions
{
L_UINT uStructSize; /* structure size */
L_INT32BasicDataTypes nWidth; /* width of the magnifying glass */
L_INT32BasicDataTypes nHeight; /* height of the magnifying glass */
L_INTBasicDataTypes nZoom; /* zoom factor */
COLORREF clrPen; /* border color */
HCURSOR hMagCursor; /* handle to a custom cursor */
COLORREF clrBack; /* color */
L_BOOLBasicDataTypes bEllipse; /* flag that indicates the shape of the magnifying glass */
L_INT nBorderSize; /* border size */
L_BOOL b3D; /* flag that indicates whether the magnifying glass border is 3D */
L_UINT32 uPaintFlags; /* flags that indicate how the zoomed image will be painted */
COLORREF L_FAR * pMask; /* array of color values */
L_UINT uMaskCount; /* number of colors */
L_UINT32 uMagGlassFlags; /* flags that control two behaviors of the magnifying glass */
L_INT nCrosshair; /* type of crosshair */
L_BOOL bIgnoreRgn; /* flag that indicates whether to magnify a region */
L_BOOL bCenter; /* flag that indicates how to center the magnifie

} MAGGLASSOPTIONS, L_FAR * pMAGGLASSOPTIONS;

The MAGGLASSOPTIONS structure provides magnifying glass options information for the LBitmapWindow::SetMagGlassOptions function.

Member | Description
uStructSize | Size of this structure in bytes. 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. (that is, 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 LBitmapBase::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 manually updating 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.
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.


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 LBitmap::MosaicTiles 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.


OVERLAYATTRIBUTES

The OVERLAYATTRIBUTES structure contains overlay attributes. Each overlay is a 1-bit image. The attributes are stored as member variable or flags inside 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 LPaint::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 LBitmap::PlasmaFilter 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 LBitmap::PlasmaFilter. Otherwise, their values will be ignored.

The PLSCLR_HUE value is a predefined color pattern that is based on the HLS color space. It creates plasma patterns by changing hue values.

The PLSCLR_RGB1 value is a predefined color pattern that is based on the RGB color space. Different combinations of red, green and blue frequencies produce different results.

Like the PLSCLR_RGB1 value, the PLSCLR_RGB2 value is based on the RGB color space, but uses a different combination of red, green and blue frequencies.

The color palette used for 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 LBitmap::SearchRegMarks function. The LBitmap::SearchRegMarks 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. LBitmap::SearchRegMarks 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 LBitmap::SearchRegMarks 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 LBitmap::SelectiveColor


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:

LBitmap::SelectiveColor


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 LBitmap::Slice function, which is used to extract individual slices from radiographic scanned film.

Member | Description
uStructSize | The 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 rotating, 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.


SPATIALFLT

typedef struct tagSPATIALFLT
{
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 LBitmap::SpatialFilter 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
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 LBitmap::DrawStar 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 LBitmap::GetStatisticsInfo function.

Member | Description
uStructSize | The 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.


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 the LFile::CreateThumbnail and the LFile::CreateThumbnailCallBack functions to specify the thumbnail creation options.

Member | Description
uStructSize | Size of this structure in bytes. 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 LBitmapBase::ColorRes 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 LBitmapBase::ColorRes.
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 LFile::CreateThumbnail 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.


USERFLT

typedef struct tagUSERFLT
{
L_UINT uStructSize;
L_UINT ufltWidth; /* number of columns in the user-defined array*/
L_UINT ufltHeight; /* number of rows in the user-defined array */
POINT ufltCenter; /* user-defined array reference point*/
L_UINT ufltDivisor; /* Divide the result by this value*/
L_INT nfltOffset; /* offset the result by this value */
L_UINT ufltFlag; /* Flags */
L_INT ufltMatrix[1]; /* array of (ufltWidth * ufltHeight) integers */
} USERFLT, L_FAR * LPUSERFLT;

Member | Description
uStructSize | Must contain the size of 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 | Any two-dimensional position of 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_UINTuFlags;
}VIGNETTEINFO, L_FAR * LPVIGNETTEINFO;

The VIGNETTEINFO structure provides the information needed for the LBitmap::Vignette 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.


LILCLICK

typedef struct _LILCLICK
{
L_INT32 lStructSize;
HWND hWnd;
L_INT xPos;
L_INT yPos;

} LILCLICK, L_FAR* pLILCLICK;

The LILCLICK structure contains information pertaining to a click event.

Member | Description
lStructSize | Size of the structure.
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.


LILDRAWITEM

typedef struct _LILDRAWITEM
{
L_INT32 lStructSize;
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
lStructSize | Size of the structure.
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 LImageListControl::DrawItem function.


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 LImageListControl::ExportBitmapList function, 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 LImageListControl::ExportBitmapList function.

After calling the LImageListControl::ExportBitmapList function 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 and 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 LImageListControl::ImportBitmapList function.


LILITEM

typedef struct _LILITEM
{
L_INT32 lStructSize;
L_UINT32 uMask;
pBITMAPHANDLE pBitmap;
L_TCHAR L_FAR*
 pText;
L_INT32 lData;
L_BOOL bSelected;
L_INT32 lIndex;
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
lStructSize | Size of the structure.
uMask | Mask for getting and setting the item.
pBitmap | Pointer to a bitmap handle that references the item’s bitmap.
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

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 used
 by the LImageListControl::GetItem,
 LImageListControl::GetSelectedItems,
 LImageListControl::Insert,
 LImageListControl::Update,
 and LImageListControl::SortExt
 functions.

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.


LILITEMOPTION

typedef struct _LILITEMOPTION
{

   L_INT32
 lStructSize;
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 LILITEMOPTION structure contains information about item options.

Member | Description
lStructSize | Size of the structure.
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 LImageListControl::GetItemOptions and LImageListControl::SetItemOptions functions.


LILITEMSEL

typedef struct _LILITEMSEL
{

   L_INT32
 lStructSize;
HWND hWnd ;
L_INT32 lItem;

} LILITEMSEL, L_FAR* pLILITEMSEL;

The LILITEMSEL contains information about the selected item.

Member | Description
lStructSize | Size of the structure.
hWnd | Window handle for the control.
lItem | Index of the selected item.

Comments

This structure is used by the LImageListControl::ItemSelected function and the L_ILN_ITEMSEL command notification.


LILKEYDOWN

typedef struct _LILKEYDOWN
{

WORD wVKey;
L_UINT flags;

} LILKEYDOWN, L_FAR* pLILKEYDOWN;

The LILKEYDOWN structure contains information pertaining to a key down event.

Member | Description
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_INT32
 lStructSize;
L_UINT uAllowSelection;
L_UINT uSelectionStyle;
COLORREF crSelection;
} LILSELOPTION, L_FAR* pLILSELOPTION;

The LILSELOPTION structure contains information about selection options.

Member | Description
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 LImageListControl::GetSelectionOptions and LImageListControl::SetSelectionOptions functions.


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 LImageListControl::SortExt function.


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

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.

[Document/Medical ]

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):

LBitmapBase::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):

LBitmapBase::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


LEADCAPTUREAREAOPTION

typedef struct tagLEADCAPTUREAREAOPTION
{
L_UINT uSize;
L_UINT uAreaType;
L_INT nFillPattern;
COLORREF crFillForeColor
COLORREF crFillBackColor
L_UINT uDrawLineStyle;
COLORREF crDrawLineColor
L_UINT uEllipseWidth;
L_UINT uEllipseHeight;
L_UINT uFlags;
HCURSOR hDrawCursor;
COLORREF crTextForeColor;
COLORREF crTextBackColor;
L_INT nInfoLeft;
L_INT nInfoTop;
L_INT nInfoWidth;
L_INT nInfoHeight;
} LEADCAPTUREAREAOPTION, L_FAR * LPLEADCAPTUREAREAOPTION;

This structure is used to define the options of the LScreenCapture::CaptureArea function.

Member | Description
uSize | size of the structure.
uAreaType | type of area to capture. Possible values are:

Value | Meaning
CAPTURE_AREA_TRIANGLE | [0x1] Triangle
CAPTURE_AREA_RECT | [0x2] Rectangle
CAPTURE_AREA_ROUNDRECT | [0x3] Rounded Rectangle
CAPTURE_AREA_ELLIPSE | [0x4] Ellipse
CAPTURE_AREA_POLYGON | [0x5] Polygon (each click defines point)
CAPTURE_AREA_FREEHAND | [0x6] Freehand (click and drag)
Default is CAPTURE_AREA_RECT. |

nFillPattern

fill pattern for the bitmap.

Value | Meaning
CAPTURE_AREA_PATTERN_HORIZONTAL | HS_HORIZONTAL /* ----- */
CAPTURE_AREA_PATTERN_VERTICAL | HS_VERTICAL /* ||||| */
CAPTURE_AREA_PATTERN_FDIAGONAL | HS_FDIAGONAL /* \\\\\ */
CAPTURE_AREA_PATTERN_BDIAGONAL | HS_BDIAGONAL /* ///// */
CAPTURE_AREA_PATTERN_CROSS | HS_CROSS /* +++++ */
CAPTURE_AREA_PATTERN_DIAGCROSS | HS_DIAGCROSS /* xxxxx */
CAPTURE_AREA_PATTERN_SOLID | HS_DIAGCROSS+1 /*Solid Fill*/
Default is CAPTURE_AREA_PATTERN_SOLID. |

crFillForeColor | foreground color. Default is RGB(0, 0, 0).
crFillBackColor | background color. Default is RGB(255, 255, 255).
uDrawLineStyle | draw line style. Possible values are:

Value | Meaning
CAPTURE_AREA_LINE_SOLID | PS_SOLID /*________*/
CAPTURE_AREA_LINE_DASH | PS_DASH /*----------*/
CAPTURE_AREA_LINE_DOT | PS_DOT /*..........*/
CAPTURE_AREA_LINE_DASHDOT | PS_DASHDOT /*-.-.-.-.-.*/
CAPTURE_AREA_LINE_DASHDOTDOT | PS_DASHDOTDOT /*-..-..-*/
Default is CAPTURE_AREA_LINE_DASH. |

crDrawLineColor | line color for drawing. Default is RGB(255, 255, 255).
uEllipseWidth | width of the ellipse used when drawing a rounded rectangle. Default is 100.
uEllipseHeight | height of the ellipse used when drawing a rounded rectangle. Default is 100.
uFlags | flags for options. Possible values are:

Value | Meaning
CAPTURE_AREA_SHOW_DRAWCURSOR | [0x0001] show cursor during drawing
CAPTURE_AREA_INCLUDE_CURSOR | [0x0002] include cursor in captured image (this is the hCursor from LEADCAPTUREOPTION)
CAPTURE_AREA_ENABLE_KEYBOARD | [0x0004] allow Ctrl, Shift,+,- keys during capture (+/-)are used for Zooming In/Out in the info window (Ctrl) If Area is Rect, RoundRect, or Ellipse, pressing CTRL will center the drawing (Shift) If Area is Rect, RoundRect, or Ellipse, pressing SHIFT will draw regular shapes (that is Ellipse becomes a circle , Rectangle becomes a Square, etc.)
CAPTURE_AREA_SHOW_OPAQUE_TEXT | [0x0008] text for cursor position and capture size should have an opaque back color. (Used only for the above CAPTURE_AREA_SHOW_CURSORPOS and CAPTURE_AREA_SHOW_CAPTURESIZE. The info window has opaque text).
CAPTURE_AREA_SHOW_CURSORPOS | [0x0010] show cursor position during drawing right next to the cursor
CAPTURE_AREA_SHOW_CAPTURESIZE | [0x0020] show the width and height of the capture
CAPTURE_AREA_SHOW_INFOWINDOW | [0x0040] display the info window, the current cursor location, the coordinates of the cursor, and the width and height of the area.
CAPTURE_AREA_SENSITIVE_INFOWINDOW | [0x0080] Enable Sensitive detection for the Info window position.
CAPTURE_AREA_BITMAP_WITH_REGION | [0x0100] captured bitmap will contain a region selected by user. This region will be the shape indicated in Area.
CAPTURE_AREA_USE_DEFAULT_VALUES | [0x0200] use default capture area options, all the other flags will be ignored if this flag is set. When this flag is set, uAreaType and uSize must be set.
CAPTURE_AREA_ZOOM_NORM | [0x1000] the image is not zoomed
CAPTURE_AREA_ZOOM_BY2X | [0x2000] the image is zoomed 2X
CAPTURE_AREA_ZOOM_BY3X | [0x3000] the image is zoomed 3X
CAPTURE_AREA_ZOOM_BY4X | [0x4000] the image is zoomed 4X
CAPTURE_AREA_ZOOM_BY5X | [0x5000] the image is zoomed 5X
CAPTURE_AREA_ZOOM_BY6X | [0x6000] the image is zoomed 6X
CAPTURE_AREA_ZOOM_BY7X | [0x7000] the images is zoomed 7X
CAPTURE_AREA_ZOOM_BY8X | [0x8000] the image is zoomed 8X
CAPTURE_AREA_ZOOM_BY9X | [0x9000] the image is zoomed 9X
CAPTURE_AREA_ZOOM_BY10X | [0xA000] the image is zoomed 10X
CAPTURE_AREA_ZOOM_BY11X | [0xB000] the image is zoomed 11X
CAPTURE_AREA_ZOOM_BY12X | [0xC000] the image is zoomed 12X
CAPTURE_AREA_ZOOM_BY13X | [0xD000] the image is zoomed 13X
CAPTURE_AREA_ZOOM_BY14X | [0xE000] the image is zoomed 14X
CAPTURE_AREA_ZOOM_BY15X | [0xF000] the image is zoomed 15X
CAPTURE_AREA_ZOOM_MASK | [0xF000]

Default is

CAPTURE_AREA_SHOW_DRAWCURSOR|

CAPTURE_AREA_ENABLE_KEYBOARD|

CAPTURE_AREA_SHOW_OPAQUE_TEXT|

CAPTURE_AREA_SHOW_CURSORPOS|

CAPTURE_AREA_SHOW_CAPTURESIZE|

CAPTURE_AREA_SHOW_INFOWINDOW|

CAPTURE_AREA_SENSITIVE_INFOWINDOW|

CAPTURE_AREA_BITMAP_WITH_REGION|

CAPTURE_AREA_ZOOM_BY2X

hDrawCursor | cursor for drawing area. Default is (HCURSOR)CAPTURE_AREA_CROSSLINES_CURSOR
crTextForeColor | foreground color of info text. Default is RGB(0, 0, 0).
crTextbackColor | background color of info text. Default is RGB(255, 255, 0).
nInfoLeft | the left coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define left position for the Info Window may be used.

Value | Meaning
CAPTURE_AREA_INFOWND_POS_LEFT | -1
CAPTURE_AREA_INFOWND_POS_RIGHT | -2
Default is CAPTURE_AREA_INFOWND_POS_LEFT. |

nInfoTop

the top coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define the top position for the Info Window may be used.

Value | Meaning
CAPTURE_AREA_INFOWND_POS_TOP | -3
CAPTURE_AREA_INFOWND_POS_BOTTOM | -4
Default is CAPTURE_AREA_INFOWND_POS_TOP. |

nInfoWidth

the width of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define custom width and height for the info window may be used.

Value | Meaning
CAPTURE_AREA_INFOWND_SIZE_TINY | -1
CAPTURE_AREA_INFOWND_SIZE_SMALL | -2
CAPTURE_AREA_INFOWND_SIZE_MEDIUM | -3
CAPTURE_AREA_INFOWND_SIZE_LARGE | -4
CAPTURE_AREA_INFOWND_SIZE_XLARGE | -5
Default is CAPTURE_AREA_INFOWND_SIZE_TINY. |

nInfoHeight

the height of the info window. Possible values are the same as for nInfoWidth. Both nInfoWidth and nInfoHeight must be positive values or values from the table in nInfoWidth.

Default is CAPTURE_AREA_INFOWND_SIZE_TINY.

Comments

The area of the bitmap outside the user-defined region will be filled with the pattern defined by nFillPattern, crFillForeColor, and crFillBackColor.

The zoom factor can be obtained from the flags as follows:

zoom_factor = ((uFlags & CAPTURE_AREA_ZOOM_MASK) >> 12)

The flag can be obtained from the zoom factor as follows

Flag = (zoom_factor)<< 12

nInfoWidth, nInfoTop, nInfoWidth and nInfoHeight are ignored if CAPTURE_AREA_SHOW_INFOWINDOW is not set.

CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CAPTURESIZE are not mutually exclusive. If both flags are set, you will have both an info window and the size of the captured area. Likewise, if CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CURSORPOS are set, you will have both an info window and the position of the cursor.

After the initial placement of the info window, the window will be moved to another corner of the screen whenever the mouse cursor becomes near the info window. This way, the user will not be disturbed during the selection of the area he wants, and he will be able to see a zoomed image for the current cursor position. The info window will look like this:


LEADCAPTUREINFO

typedef struct tagLEADCAPTUREINFO
{
HWND hWnd;
RECT rcArea;
L_INT nResType;
L_INT nIndex;
LPTSTR pszResID;
L_TCHAR szReserved[256];
LPTSTR pszExeName;
L_INT nMaxExeName;
} LEADCAPTUREINFO, L_FAR * pLEADCAPTUREINFO;

This structure is used by the capture functions to return information about the capture that took place.

Member | Description
hWnd | handle to window being captured. This will be filled by all of the capture functions, with the handle to the window that was captured.
rcArea | area being captured. This will be filled by all of the capture functions, with the bounding rectangle of the area that was captured. The coordinates should be relative to the full screen, left, top being 0,0.
nResType | resource type. In the case of an EXE capture, this will be filled with the type of resource that was captured. Possible values are:
RESTYPE_BITMAP | capture a bitmap resource
RESTYPE_ICON | capture an icon resource
RESTYPE_CURSOR | capture a cursor resource
nIndex | index of the resource that was captured. In the case of an EXE capture, this will be filled with the index of the resource that was captured. In this toolkit, resource indices will begin at 0.
pszResID | character string containing the resource ID.
szReserved | reserved.
pszExeName | character string to be filled with the name of the EXE from which LScreenCapture::CaptureFromEXEDlg captured a resource.
nMaxExeName | maximum length of the pszExeName buffer.


LEADCAPTUREOBJECTOPTION

typedef struct tagLEADCAPTUREOBJECTOPTION
{
L_UINT uFlags;
L_UINT uBorderWidth;
HCURSOR hSelectCursor;
} LEADCAPTUREOBJECTOPTION, L_FAR * pLEADCAPTUREOBJECTOPTION;

This structure is used in LScreenCapture::CaptureSelectedObject.

Member | Description
uFlags | flags that control the selection process. Possible values are:

Value | Meaning
CAPTURE_OBJECT_INVERT | Invert the selected object. If this flag is not specified, a border will be drawn around the object.
CAPTURE_OBJECT_ENABLE_KEYBOARD | Enable the SHIFT key during the selection process. Pressing the SHIFT key will select the client area of the object
Default is CAPTURE_OBJECT_ENABLE_KEYBOARD. |

uBorderWidth | border width when highlighting object. Default is 5.
hSelectedCursor | cursor to be used during selecting. Default is LoadCursor(0, IDC_ARROW).


LEADCAPTUREOPTION

typedef struct tagLEADCAPTUREOPTION
{
HCURSOR hCursor;
HCURSOR hStatusCursor;
L_INT nHotKey;
L_UINT uHotKeyModifiers;
L_INT nCancelKey;
L_INT nDelay;
L_UINT uCount;
L_INT nInterval;
L_UINT32 uFlags;
} LEADCAPTUREOPTION, L_FAR * pLEADCAPTUREOPTION;

This structure is used in LScreenCapture::SetCaptureOptions and LScreenCapture::GetCaptureOptions to set/get the capture options.

Member | Description
hCursor | Cursor to place on image after capture. Default is NULL.
hStatusCursor | Cursor to display as status between multiple captures. Default is NULL.
nHotKey | Key code for activation key. Default is F11.
uHotKeyModifiers | Modifier keys used with nHotKey. Possible values are listed below and may be combined. Default is 0.
 | MOD_ALT | Alt Key pressed.
 | MOD_CONTROL | Control key pressed.
 | MOD_SHIFT | Shift key pressed.
 | 0 | No modifier key was pressed.
nCancelKey | Key code for capture operation cancel key. Default is ESC. You cannot set this to the 'ALT' key (VK_MENU). If you do, it will be ignored internally and set to 'ESC' (VK_ESCAPE).
nDelay | Milliseconds delay before capture. Default is 0.
uCount | Number of times to capture. 0 or 1 means one capture, 2 means 2 captures, etc. Default is 1.
nInterval | Milliseconds delay between captures. Default is 0
uFlags | Flag that indicates whether to optimize hotkey processing. Possible values are:
 | Value | Meaning
 | 0 | [0x0000] Perform normal hot key processing.
 | CAPTURE_OPTIMIZED_HOTKEY | [0x0001] Use a global system hook for hotkey processing.

Comments

Normally, when a capture function is called, the function enters a loop, and waits for the hot key specified in nHotKey to be pressed, before capturing. This loop can cause the CPU usage indicator to appear maxed out. Specifying CAPTURE_OPTIMIZED_HOTKEY in uFlags will cause the capture function to return immediately, if a hotkey has been specified in nHotKey. In this case, a global system hotkey hook is established and used to wait for the hotkey to be pressed. When the hotkey is pressed, the capture is performed and the callback passed to the capture function is called with the result of the capture. Use this option only if the normal behavior is causing your application problems. This option is ignored in Win95/98/Me.


WINDOWCAPTURETYPE

typedef enum tagWINDOWCAPTURETYPE
{
CAPTURE_CLIENT_AREA=1,
CAPTURE_WINDOW,
} WINDOWCAPTURETYPE;

This enumerated type is used in LScreenCapture::CaptureWindow.


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 LBitmap::BalanceColors function.

Member | Description
uStructSize | Size of this structure in bytes. 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 LBitmap::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.


DIMENSION

typedef struct _DIMENSION
{
L_UINT32 nWidth;
L_UINT32 nHeight;
} DIMENSION, L_FAR * pDIMENSION;

The DIMENSION structure is used with the LFile::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 LFile::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 uSize;
L_UINT uFlags;
L_UINT uCount;
EXTENSION aList[1];
} EXTENSIONLIST, L_FAR * LPEXTENSIONLIST;

The EXTENSIONLIST structure contains Exif extension information.

Member | Description
uSize | 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 LFile::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 LFile::ReadStamp, while the extension stamp is loaded with LFile::LoadExtensionStamp.
 | EXTENSION_AUDIO | [0x0002] Embedded audio data is present. The LFile::GetExtensionAudio function can be called to get to the audio data.
uCount | The number of extensions present in a List.
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:

LFile::ReadFileExtensions

LFile::FreeExtensions

LFile::GetExtensionAudio

LFile::LoadExtensionStamp

LFile::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 LFileSettings::SetDJVOptions and LFileSettings::GetDJVOptions to set and get the DJVU file options.

The following functions make use of this structure:

LFileSettings::GetDJVOptions

LFileSettings::SetDJVOptions


FILEJ2KOPTIONS

typedef struct _FILEJ2KOPTIONS
{
L_INT nSize;
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
nSize | Size of this structure.
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 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 | Value 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. Image starts out blurry and becomes clearer and more detailed as additional data is decoded.
J2K_RESOLUTION_LAYER_COMPONENT_POSITION |  |  | [1] Resolution-axis order. Image starts out small and becomes larger as additional data is decoded. Higher compression ratios achieved by leaving lower resolutions in the file.
J2K_RESOLUTION_POSITION_COMPONENT_LAYER |  |  | [2] Resolution-axis order. Image starts out small and becomes larger as additional data is decoded. Higher compression ratios achieved by leaving lower resolutions in the file.
J2K_POSITION_COMPONENT_RESOLUTION_LAYER |  |  | [3] Position–axis order. Image starts out as a series of blocks starting from the top left corner. Additional portions of the image become visible as more data is decoded. Image data stored by spatial location.
J2K_COMPONENT_POSITION_RESOLUTION_LAYER |  |  | [4] Color-axis order. Image starts out gray. Color is added as more data is decoded. Image data stored by color channel, starting with channel Y, then U, then V. If the transform to YUV option is used, the lowest decompressed image level for RGB is grayscale. Otherwise, the output is only the red channel.
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)
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.
uROIControl | Flag that indicates the region of interest to use. For a list of possible values refer to J2KREGIONOFINTEREST.
 | Value | Meaning
 | J2K_USE_OPTION_RECT | Use the rectangle specified in the rcROI member of the FILEJ2KOPTIONS structure to define the region of interest.
 | J2K_USE_LEAD_REGION | Use the LEAD bitmap region to define the region of interest. (Any region shape is acceptable; it will be converted internally by the filter to a rectangle.)

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

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.


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:

LFileSettings::GetJBIG2Options

LFileSettings::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:

LFileSettings::GetPDFOptions

LFileSettings::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 LFileSettings::SetPDFOptions and LFileSettings::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:

LFileSettings::GetPDFSaveOptions

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

Comments

PFILEPDFSAVEOPTIONS is a pointer to a FILEPDFSAVEOPTIONS structure. Use LFileSettings::SetPDFSaveOptions and LFileSettings::GetPDFSaveOptions to set and get the PDF file save options.


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:

LFileSettings::GetPLTOptions

LFileSettings::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 LFileSettings::SetPLTOptions and LFileSettings::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.

The following functions make use of this structure:

LFileSettings::GetPTKOptions

LFileSettings::SetPTKOptions

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. The default is 96.

Comments

pFILEPTKOPTIONS is a pointer to a FILEPTKOPTIONS structure.

Use LFileSettings::SetPTKOptions and LFileSettings::GetPTKOptions to set and get the PTOCA and AFP:PTOCA file options.


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:

LFileSettings::GetRTFOptions

LFileSettings::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 LFileSettings::SetRTFOptions and LFileSettings::GetRTFOptions to set and get the RTF file options.


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:

LFileSettings::GetTXTOptions

LFileSettings::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;

The J2KREGIONOFINTEREST data type is used within the FILEJ2KOPTIONS structure to indicate how to define the region of interest.

Comments

If J2K_USE_LEAD_REGION is used, then any region shape is acceptable. It will be converted internally by the filter to a rectangle.


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 options for reading or writing an image file.

The following functions make use of this structure:

LAnnContainer::Load

LAnnContainer::LoadOffset

LFile::ReadLoadResolutions

LFile::FileConvert

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::GetInfo

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadLayer

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadFileTransforms

LFile::ReadTag

LFile::ReadStamp

LFile::StartFeedLoad

LFileSettings::GetLoadResolution

LMemoryFile::Decompress

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadComment

LMemoryFile::ReadTag

See LBaseFile::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. (Used only with LBitmapBase::Initialize.)
YResolution | Vertical dots per inch. (Used only with LBitmapBase::Initialize.)
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 predicto
 | 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: load the file as TOP_LEFT. If you are loading a TIFF 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, but not when saving, 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:
 | Value | Meaning
 | Any positive number | The LFile::LoadFileCallBack function is called the specified number of times.
 | CALLBACK_ONCE | [0] The LFile::LoadFileCallBack function is called only once at the end.
 | CALLBACK_WHEN_MEANINGFUL | [-1] The LFile::LoadFileCallBack function is called only on significant scans. (This is usually the best option.)
 | CALLBACK_ALWAYS | [-2] The LFile::LoadFileCallBack function is called for the default number of scans.
PageNumber | The page number of a multipage file, which can contain more than one image. When loading a file, this is the exact page number. 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 multipage files refer to Multipage File Formats.
GlobalLoop | Loop count when playing an animation. Use 0 for continuous looping. For no looping, turn off the EFO_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 LFile::GetCompressStamp function.

If EFO_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 LBitmapBase::ClearNegativePixels before loading the image. If EFO_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 LFile::LoadFileCallBack 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 is the number of resolutions present in the file) then the LFile::LoadFileCallBack 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 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_INT Format; /* File format: FILE_PCX, ... */
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 */
} LOADINFO, L_FAR * pLOADINFO;

The LOADINFO structure provides file format information to the LBaseFile::LoadInfoCallBack function, which you can use when loading image data in a format that LEADTOOLS does not recognize. For more information, refer to the LBaseFile::EnableLoadInfoCallBack function.

Member | Description
Format | File format. The following are valid formats:
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
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.
 | 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).
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.

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.

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 override LBaseFile::LoadInfoCallBack. 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 (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.


MAGGLASSDATA

typedef struct _tagMAGGLASSDATA
{
L_INT nWidth;
L_INT nHeight;
L_INT nZoom;
COLORREF clrPen;
COLORREF clrBack;
L_BOOL bEllipse;
L_INT nBorderSize;
L_BOOL b3D;
HCURSOR hCursor;
L_UINT32 uPaintFlags;
COLORREF L_FAR pMask;
L_UINT uMaskCount;
L_INT nCrosshair;
L_BOOL bIgnoreRgn;
L_BOOL bCenter;
} MAGGLASSDATA, L_FAR * pMAGGLASSDATA;

The MAGGLASSDATA structure specifies options for the magnifying glass.

The following functions make use of this structure:

LBitmapWindow::GetMagGlassOptions

LBitmapWindow::SetMagGlassOptions

Member | Description
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 for the border of the magnifying glass.This is ignored when bEllipse = FALSE and b3D = TRUE.
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.

hCursor | 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:
uPaintFlags | Flags that indicate how the zoomed image will be painted. These are the same as Flags for the LBitmapWindow::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.
nCrosshair | Value that indicates the type of crosshair to use. Possible values are:

Value | Meaning
CROSSHAIR_NONE | [0] No crosshair in the magnifying glass.
CROSSHAIR_FINE | [1] The crosshair is one pixel wide and is the color of clrPen.
CROSSHAIR_INVERTPEN | [2] The crosshair is three pixels wide. The center pixel is the color of clrPen and the outer pixels are the inverse of clrPen.
CROSSHAIR_INVERTSCREEN | [3] The crosshair is three pixels wide. The center pixel is the color of clrPen and the outer pixels are 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.

Comments

To use the magnifying glass, call the LBitmapWindow::GetMagGlassOptions function to get the current magnifying glass options. Next call the LBitmapWindow::SetMagGlassOptions function to set any new magnifying glass options to be used. Then call LBitmapWindow::SetToolType to set the tool type to TOOL_MAGGLASS.

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.


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_UINT32 uZoomViewBorderStyle;
COLORREF crZoomViewBorder;
L_INT nZoomViewPenStyle;
HRGN hBorderRgn;
L_UINT32 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 AddZoomView function, which is used to create a Zoom View, the UpdateZoomView which updates a zoomed view, and the 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 AddZoomView and the DestroyZoomView functions. Set this value before calling the GetZoomViewProps or the 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 | This member is obsolete.
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.
 | The following figures display the different border styles that are available:
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.
 | The following figure displays the different border styles that are available:
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. Possible values are:
 | 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 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 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.


PCDINFO

typedef struct pcdinfo
{
L_INT resolution[6];
} PCDINFO, L_FAR * pPCDINFO;

The PCDINFO structure is updated by the LFileSettings::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];
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:

LFile::FileConvert

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LMemoryFile::SaveBitmap

LFile::SaveBitmapWithLayers

LFile::SaveFile

LFile::SaveTile

LFile::SaveOffset

LMemoryFile::StartCompressBuffer

LFile::WriteComment

LFile::WriteStamp

LSegment::MrcSaveBitmap

LSegment::MrcSaveBitmapT44

See LBaseFile::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 ulti-page TIFF file.
 | ESO_DISABLEP3 | [0x00010000] Do not use P3-specific optimized code.
 | ES0_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_PAD4 | [0x00400000] Each line is padded to a multiple of 4 bytes. (raw data only).
 | 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 progressive files:
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:
0 | Save the file with fixed Huffman tables (faster save, lower compression).
<>0 | Save the file with optimized Huffman tables (2-pass compression, 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
 | MPEG_CHROMA_420 | [1] 4:2:0
 | MPEG_CHROMA_422 | [2] 4:2:2
 | MPEG_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 LFile::GetCompressStamp function.

Note: If SAVEFILE_MULTIPAGE is passed to LFile::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 LFile::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 LFile::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 LFileSettings::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 LFile::SaveOffset 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.


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.


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
WRPERR_BITMAP_NOT_ALLOCATED | -1000 | Bitmap is not allocated
WRPERR_INVALID_CLASS | -1001 | Class object is invalid
WRPERR_INVALID_PARAMETERS | -1002 | Invalid parameter(s) passed
WRPERR_BITMAP_BPP | -1003 | Invalid Bits/Pixel
WRPERR_BITMAP_DITHER_NOT_STARTED | -1004 | Dithering engine not started
WRPERR_BITMAP_ALREADY_ALLOCATED | -1005 | Bitmap is already allocated
WRPERR_BITMAP_PREPARE_FAILED | -1006 | Process preparation failed
WRPERR_BITMAP_ITEM_IN_LIST | -1007 | Item is part of a bitmap list
WRPERR_BITMAP_CONVERT | -1008 | Error during conversion
WRPERR_INET_ITEM_NOTFOUND | -1009 | Internet item not found
WRPERR_INET_NOMORE_SPACE | -1010 | Internet no more space
WRPERR_INET_ALREADY_CONNECTED | -1011 | Internet already connected
WRPERR_MMCAPTURE_WINDOW_ALREADY_CREATED | -1012 | Multimedia capture window already created.
WRPERR_MMEDIA_ALREADY_CREATED | -1013 | Multimedia already created
WRPERR_PLAYBACK_ALREADY_CREATED | -1014 | Playback already created
WRPERR_LIST_ALREADY_CREATED | -1015 | Bitmap list already created
WRPERR_LIST_NOT_CREATED | -1016 | Bitmap list has not been created
WRPERR_CLASS_NOT_READY | -1017 | Class object is not ready
WRPERR_BUFFER_NO_MEMORY | -1018 | Buffer has not been allocated
WRPERR_BUFFER_ERRSIZE | -1019 | Invalid buffer size
WRPERR_BUFFER_INVALID_HANDLE | -1020 | Invalid buffer handle
WRPERR_FILE_FEEDLOAD_NOT_STARTED | -1021 | FeedLoad engine not started
WRPERR_MEMFILE_COMP_NOT_STARTED | -1022 | Compression engine not started
WRPERR_ANN_INVALID_FILE | -1023 | Invalid annotation file
WRPERR_ANN_INVALID_FILEMEM | -1024 | Invalid annotation file in memory
WRPERR_ANN_INVALID_OBJECT | -1025 | Invalid annotation object
WRPERR_ANN_DESTROYTOOLBAR_FAILED | -1026 | Failed to destroy ann toolbar
WRPERR_ANN_ALLOCATED_MEMORY | -1027 | Failed to allocate memory
WRPERR_BUFFER_NOTVALID | -1028 | Invalid buffer
WRPERR_BUFFER_REALLOCATE | -1029 | Failed to reallocate buffer
WRPERR_BUFFER_COPY | -1030 | Failed to copy buffer
WRPERR_BUFFER_RESIZE_NOT_STARTED | -1031 | Resize engine not started
WRPERR_BUFFER_LOCKED | -1032 | Buffer was locked
WRPERR_BITMAPWND_PANNOTCREATED | -1033 | PanWindow not created
WRPERR_BITMAPWND_REGISTER | -1034 | Error registering window class
WRPERR_BITMAPWND_CREATEWINDOW | -1035 | Error creating window
WRPERR_ANIMATION_ALREADY_STARTED | -1036 | Animation playback already started
WRPERR_ANIMATION_IS_RUNNING | -1037 | Animation is running.
WRPERR_ANNWND_CANT_CREATE_OBJECT | -1038 | Error creating object.
WRPERR_LTKRN_DLL_NOT_LOADED | -1039 | LTKRN DLL is not loaded.
WRPERR_LTDIS_DLL_NOT_LOADED | -1040 | LTDIS DLL is not loaded.
WRPERR_LTFIL_DLL_NOT_LOADED | -1041 | LTFIL DLL is not loaded.
WRPERR_LTIMG_DLL_NOT_LOADED | -1042 | LTIMG DLL is not loaded.
WRPERR_LTEFX_DLL_NOT_LOADED | -1043 | LTEFX DLL is not loaded.
WRPERR_LTDLG_DLL_NOT_LOADED | -1044 | LTDLG DLL is not loaded.
WRPERR_LTISI_DLL_NOT_LOADED | -1045 | LTISI DLL is not loaded.
WRPERR_LTTWN_DLL_NOT_LOADED | -1046 | LTTWN DLL is not loaded.
WRPERR_LTSCR_DLL_NOT_LOADED | -1047 | LTSCR DLL is not loaded.
WRPERR_LTANN_DLL_NOT_LOADED | -1048 | LTANN DLL is not loaded.
WRPERR_LTCAP_DLL_NOT_LOADED | -1049 | LTCAP DLL is not loaded.
WRPERR_LTNET_DLL_NOT_LOADED | -1050 | LTNET DLL is not loaded.
WRPERR_LTVID_DLL_NOT_LOADED | -1051 | LTVID DLL is not loaded.
WRPERR_BITMAPLIST_ITEM_OPERATION_ERROR | -1052 | RequireError operating on bitmap list itemd.
WRPERR_BITMAPLIST_NOT_CREATED | -1053 | Bitmap list has not been created
WRPERR_ANIMATION_INVALID_FILE | -1054 | Invalid animation file
WRPERR_NOT_LEAD_BITMAP | -1055 | Not a LEAD Bitmap
WRPERR_BITMAP_IS_ALIST_MEMBER | -1056 | Bitmap is part of a bitmap list
WRPERR_WINDOW_NOT_CREATED | -1057 | Object's window has not been created
WRPERR_OPERATION_NOT_ALLOWED | -1058 | Operation is not allowed
WRPERR_OPERATION_CANCELED | -1059 | Operation was canceled
WRPERR_LTTMB_DLL_NOT_LOADED | -1060 | LTTMB.DLL is not loaded
WRPERR_LTLST_DLL_NOT_LOADED | -1061 | LTLST.DLL is not loaded.
WRPERR_IMAGELISTCONTROL_CREATE | -1062 | Error creating the image list control.
WRPERR_LVKRN_DLL_NOT_LOADED | -1063 | LVKRN.DLL is not loaded
WRPERR_NO_VECTOR | -1064 | No LVectorBase object associated with LVectorDialog object
WRPERR_VECTOR_NOT_ALLOCATED | -1065 | No vector loaded into LVectorBase object
WRPERR_LVDLG_DLL_NOT_LOADED | -1066 | LVDLG.DLL is not loaded
WRPERR_FEATURE_NOT_SUPPORTED_IN_DIRECTX | -1067 | Feature not supported when using DirectX engine to process vector images
WRPERR_FEATURE_NOT_SUPPORTED | -1068 | Feature not supported
WRPERR_VECTOR_NOT_ASSOCIATED | -1069 | No LVectorBase object associated with object
WRPERR_VECTOR_INVALID_LAYER | -1070 | Invalid LVectorLayer object
WRPERR_VECTOR_INVALID_OBJECT | -1071 | LVectorObject not associated with valid vector object
WRPERR_VECTOR_INVALID_OBJECT_TYPE | -1072 | LVectorObject has been invalidated (can happen on ExplodeObject)
WRPERR_VECTOR_INVALID_OBJECT_DESC | -1073 | UnlockObject() being called on invalid object descriptor
WRPERR_VECTOR_LOCK_ERROR | -1074 | Returned when calling LockObject() on an already locked object
WRPERR_LTBAR_DLL_NOT_LOADED | -1075 | LTBAR.DLL is not loaded
WRPERR_LTAUT_DLL_NOT_LOADED | -1076 | LTAUT.DLL is not loaded
WRPERR_LTCON_DLL_NOT_LOADED | -1077 | LTCON.DLL is not loaded
WRPERR_LDKRN_DLL_NOT_LOADED | -1078 | LDKRN.DLL is not loaded
WRPERR_LTTLB_DLL_NOT_LOADED | -1080 | LTTLB.DLL is not loaded
WRPERR_LTPNT_DLL_NOT_LOADED | -1081 | LTPNT.DLL is not loaded
WRPERR_LTPDG_DLL_NOT_LOADED | -1082 | LTPDG.DLL is not loaded
WRPERR_VECTOR_INVALID_GROUP | -1083 | Invalid vector group
WRPERR_LTWEB_DLL_NOT_LOADED | -1084 | LTWEB.DLL is not loaded
WRPERR_LTSGM_DLL_NOT_LOADED | -1085 | LTSGM.DLL is not loaded
WRPERR_LTDLGKRN_DLL_NOT_LOADED | -1086 | LTDLGKRN.DLL is not loaded
WRPERR_LTDLGCLR_DLL_NOT_LOADED | -1087 | LTDLGCLR.DLL is not loaded
WRPERR_LTDLGWEB_DLL_NOT_LOADED | -1088 | LTDLGWEB.DLL is not loaded
WRPERR_LTDLGIMG_DLL_NOT_LOADED | -1089 | LTDLGIMG.DLL is not loaded
WRPERR_LTDLGEFX_DLL_NOT_LOADED | -1090 | LTDLGEFX.DLL is not loaded
WRPERR_LTDLGIMGDOC_DLL_NOT_LOADED | -1091 | LTDLGIMGDOC.DLL is not loaded
WRPERR_LTDLGFILE_DLL_NOT_LOADED | -1092 | LTDLGFILE.DLL is not loaded
WRPERR_LTDLGIMGEFX_DLL_NOT_LOADED | -1093 | LTDLGIMGEFX.DLL is not loaded
WRPERR_LTZMV_DLL_NOT_LOADED | -1094 | LTZMV.DLL is not loaded
WRPERR_LTIMGOPT_DLL_NOT_LOADED | -1095 | LTIMGOPT.DLL is not loaded
WRPERR_LCMRC_DLL_NOT_LOADED | -1096 | LCMRC.DLL is not loaded
WRPERR_IMAGEVIEWERCONTROL_DLL_NOT_LOADED | -1097 | IMAGEVIEWERCONTROL.DLL is not loaded
WRPERR_IMAGEVIEWERCONTROL_NOT_CREATED | -1098 | IMAGEVIEWERCONTROL is not created
WRPERR_IMAGEVIEWERCONTROL_ALREADY_CREATED | -1099 | IMAGEVIEWERCONTROL already created
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_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


LEADMARKERCALLBACK Function

#include "ltwrappr.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 * pMarkerData; | /* marker data */
L_VOID * 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 L_FILE::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 LFile::TransformFileCallBack function and is in turn passed on to this function.

This function is called only from within the LFile::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

LFile::TransformFile, LFile::TransformFileCallBack

Example

For an example, refer to LFile::TransformFileCallBack.


Print a Real Image Size in Inches

1.

Define the following global variables:

LBitmapBase BitmapBase; // bitmap
L_FLOAT fRealWidth; // Image's real width in inches
L_FLOAT fRealHeight; // Image's 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:

BitmapBase.Load(TEXT("C:\\IMAGE1.CMP"), 0, ORDER_BGR);

3.

Calculate the real width and height of the bitmap in inches:

fRealWidth = (L_FLOAT)BitmapBase.GetWidth()
 / (L_FLOAT)BitmapBase.GetXResolution();
fRealHeight = (L_FLOAT)BitmapBase.GetHeight()
 / (L_FLOAT)BitmapBase.GetYResolution();

4.

Get the printer device context:

HDC hdcPrinter = NULL; // Printer device context
LPrint LeadPrint(&BitmapBase);
 // LEAD Print

hdcPrinter = LeadPrint.GetPrinterDC();

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 with real size in inches:

if(LeadPrint.IsValid() && hdcPrinter)
LeadPrint.Print(hdcPrinter, 1, 1, (L_INT)(fRealWidth * fPrnDPIX), (L_INT)(fRealHeight * fPrnDPIX));


Combining Images with Regions

1.

Define the following global variables:

CWnd WndClient; /* 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 */
LBitmapBase BitmapDst; /* Destination bitmap */
LBitmapBase 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:

BitmapDst.Load(TEXT("c:\\sample1.cmp"), 0, ORDER_BGR, NULL, NULL);
BitmapSrc.Load(TEXT("C:\\sample2.cmp"), 0, ORDER_BGR, NULL, NULL);

3.

Get the client area of the current child window as follows:

WndClient.GetClientRect(&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 = BitmapDst.GetWidth();
XForm.nXScalarDen = rClientArea.right;
XForm.nYScalarNum = BitmapDst.GetHeight();
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);
LBitmapRgn bmpRegion(&BitmapDst);
bmpRegion.SetRgnRect(&rRgnRect);
bmpRegion.SetRgnXForm(&XForm);

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 = BitmapDst.GetWidth() / 8;
YDst = BitmapDst.GetHeight() / 8;
YSize = BitmapSrc.GetHeight();
XSize = BitmapSrc.GetWidth();
XSrc = 0;
YSrc = 0;

7.

Combine BitmapDst with BitmapSrc, using flags for an ordinary paste:

BitmapDst.Combine(&BitmapSrc, XDst, YDst, XSize, YSize, XSrc, YSrc, CB_OP_ADD | CB_DST_0);

8.

At the end you should free the rectangle:

bmpRegion.Free();


Implementing a Non-Automated Annotations Program (Visual C++ 5.0)

Implementing a Non-Automated Annotations Program (C++ 5.0 and later)

Take the following steps to start a project and to add some code that positions, scales, and displays an image in a dialog box.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify Annotation.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #include statements to your program so you can access the LEAD Class Library constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Annotation files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the header files reside):

#include ""..\..\..\..\include\ClassLib\ltWrappr.h

8. | Add a Button control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the Annotation resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_ANNOTATION_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.

9. | Add a command button to your form and name it as follows:
 | ID | Caption
 | IDC_BITMAPWND | Bitmap Window

10. | Change the command button properties as follows:
 | a. | Right-click on the button then select properties.
 | b. | Click the Styles tab.
 | c. | Select the Flat check box
 | d. | Select the Owner Draw check box
 | e. | Click the General tab.
 | f. | Clear the Visible check box
 | g. | Close the dialog
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.

12. | Add the following Member Variables to CAnnotationDlg Class:
 | LAnnContainer | m_LeadAContainer;
 | LPaint | m_LPaint;
 | LBitmap | m_LBitmap;
 | void | CreateNoteAnn(HWND hWnd);
 | void | AnnStart(HWND hWnd);

13. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the Annotation classes folder to open it.
 | c. | Expand the CAnnotationDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
14. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

LSettings::LoadLibraries (LT_ALL_LEADLIB);
LSettings::UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

15. | Add implementation to the member method in the CAnnotationDlg class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Annotation files folder to open it.
 | c. | Double-click the Source files folder to open it.
 | d. | Double-click the AnnotationDlg.cpp file to edit it.
 | e. | Add the following to the end of the file:

void CAnnotationDlg::AnnStart(HWND hWnd)
{
RECT rcClientArea;
ANNRECT rcContainerRect;
HDC hDC;

m_LBitmap.Load(TEXT("c:\\parrots.jpg"));

::GetClientRect(hWnd,&rcClientArea);
m_LBitmap.SetDstRect(&rcClientArea);

hDC = ::GetDC(hWnd);

/*Display our Bitmap*/
m_LPaint.SetBitmap(&m_LBitmap);
m_LPaint.SetDC(hDC);
m_LPaint.PaintDC();

::ReleaseDC(hWnd,hDC);

// Create Container
rcContainerRect.left = 0;
rcContainerRect.top = 0;
rcContainerRect.right = rcClientArea.right-rcClientArea.left;
rcContainerRect.bottom = rcClientArea.bottom-rcClientArea.top;

m_LeadAContainer.Create(hWnd,&rcContainerRect,TRUE);

m_LeadAContainer.SetOffsetX((L_DOUBLE) 0, 0);
m_LeadAContainer.SetOffsetY((L_DOUBLE) 0, 0);
}

void CAnnotationDlg::CreateNoteAnn(HWND hWnd)
{
LAnnNote AnnNote;
RECT rcAnnBounds;
HDC hDC;
ANNRECT rcContainerRect;
ANNRECT rcNoteRect;

hDC = ::GetDC(hWnd);

m_LeadAContainer.GetRect(&rcContainerRect);
int nRet = AnnNote.Create();

/* Size and position the note */
rcNoteRect.left = rcContainerRect.right / 8;
rcNoteRect.top = rcContainerRect.bottom / 8;
rcNoteRect.right = rcContainerRect.right / 2;
rcNoteRect.bottom = rcContainerRect.bottom / 2;

nRet = AnnNote.SetRect(&rcNoteRect);

nRet = AnnNote.SetText(TEXT("This is my text"), 0);
nRet = AnnNote.SetBackColor(RGB(0, 255, 255), 0);
nRet = AnnNote.SetFontBold(TRUE, 0);
AnnNote.SetFontItalic (FALSE, 0);
AnnNote.SetFontName (TEXT("Arial"), 0);
AnnNote.SetFontSize (16, 0);
AnnNote.SetFontStrikeThrough(FALSE, 0);
AnnNote.SetFontUnderline(TRUE, 0);
AnnNote.SetForeColor (RGB(255, 0, 0), 0);

/* Display the note */

AnnNote.SetVisible(TRUE);
nRet = m_LeadAContainer.Insert(AnnNote);

nRet = m_LeadAContainer.GetBoundingRect(&rcAnnBounds, NULL);
nRet = m_LeadAContainer.Draw(hDC,&rcAnnBounds);
::ReleaseDC(hWnd,hDC);
}

16. | Add a command control to your from and name it as follows:
 | ID | Caption
 | IDC_STARTANN | &Start Annotation

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnotationDlg.
 | c. | In the Object IDs list box, select IDC_STARTANN.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnStartANN).
 | f. | Click the Edit Code button and enter the following code:

AnnStart(GetDlgItem(IDC_BITMAPWND)->GetSafeHwnd());
CreateNoteAnn(GetDlgItem(IDC_BITMAPWND)->GetSafeHwnd());

18. | On the main menu, select Build > Build Annotation.exe to build the project.
19. | On the main menu, select Build > Execute Annotation.exe to run the project.


Implementing an Automated Annotations Program (Visual C++ 5.0)

Implementing an Automated Annotations Program (C++ 5.0 and later)

Take the following steps to start a project and to add some code that positions, scales, and displays an image in a dialog box.

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify Automated.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #include statements to your program so you can access the LEAD Class Library constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Automated files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the header files reside):

#include "..\..\..\..\include\ClassLib\ltWrappr.h"

8. | Add a Button control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the Automated resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_AUTOMATED_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Click the Button control icon; then size and position the control as you want it to appear at run time.

9. | Add a command button to your form and name it as follows:
 | ID | Caption
 | IDC_BITMAPWND | Bitmap Window

10. | Change the command button properties as follows:
 | a. | Right-click on the button then select properties.
 | b. | Click the Styles tab.
 | c. | Select the Flat check box
 | d. | Select the Owner Draw check box
 | e. | Click the General tab.
 | f. | Clear the Visible check box
 | g. | Close the dialog
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.

12. | Add the following Member Variables to CAutomatedDlg Class:
 | LAnnContainer | m_LeadAContainer;
 | LAnnToolBar | m_LeadAToolBar;
 | HANNOBJECT | hAutoObject;
 | LAnnAutomation | m_LeadAAutomation;
 | CBitmapWindow | m_LBitmap;

13. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the Automated classes folder to open it.
 | c. | Expand the CAAutomatedDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
14. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

LSettings::LoadLibraries(LT_ALL_LEADLIB);
LSettings::UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

CWnd* pWnd = GetDlgItem(IDC_BITMAPWND);
//m_LBitmap.SetWndHandle(hWnd);*/
m_LBitmap.EnableAutoScroll(FALSE);

CRect rcRect;
// Get the rectangle of the button
pWnd->GetWindowRect(&rcRect);
ScreenToClient(&rcRect);

// Create the LBitmapWindow control, make it visible, and make it center the image
HWND hWnd = m_LBitmap.CreateWnd(GetSafeHwnd(),
901,
WS_VISIBLE|L_BS_CENTER|WS_HSCROLL,
rcRect.TopLeft().x,
rcRect.TopLeft().y,
rcRect.BottomRight().x,
rcRect.BottomRight().y);

int nRet = 0;
RECT rcClientArea;
ANNRECT rcContainerRect;

nRet = m_LBitmap.Load(TEXT("c:\\parrots.jpg"));

if(nRet == SUCCESS)
{
::GetClientRect(hWnd,&rcClientArea);
m_LBitmap.SetDstRect(&rcClientArea);

rcContainerRect.left = 0;
rcContainerRect.top = 0;
rcContainerRect.right = rcClientArea.right-rcClientArea.left;
rcContainerRect.bottom = rcClientArea.bottom-rcClientArea.top;

m_LeadAContainer.Create(hWnd,&rcContainerRect,TRUE);
m_LeadAContainer.SetOffsetX((L_DOUBLE) 0, 0);
m_LeadAContainer.SetOffsetY((L_DOUBLE) 0, 0);

m_LeadAAutomation.Create();

/* Assign the automation object to the container */
m_LeadAAutomation.SetAutoContainer(&m_LeadAContainer);
/* Enable the automation object */
m_LeadAAutomation.SetActiveState(ANNACTIVE_ENABLED);
/* Set design mode, which allows creation of annotations */
m_LeadAContainer.SetUserMode();
/* Set the dots per inch for interpreting physical measurements */
m_LeadAContainer.SetDpiX(600, 0);
m_LeadAContainer.SetDpiY(600, 0);

/* Set the number of possible undo actions */
m_LeadAAutomation.SetUndoDepth(3);
/* Set the line tool as the initial annotation tool */

m_LeadAToolbar.Create(this->GetSafeHwnd(), NULL, ANNTOOLALIGN_RIGHT | ANNTOOLALIGN_TOP, TRUE);

m_LBitmap.SetContainer(&m_LeadAContainer);
m_LBitmap.SetAutomation(&m_LeadAAutomation);
m_LBitmap.SetToolBar(&m_LeadAToolbar);
}

15. | Add a new class to the project as follows -- this class will be inherited from the LbitmapWindow class:
 | a. | From the Insert menu, select New Class
 | b. | In the Class Type combo box, select Generic class
 | c. | In the Class name text box, specify CBitmapWindow
 | d. | Click on "derived from" and type LBitmapWindow
 | e. | Click the OK button.
16. | Add #include statements to your program so you can access the LEAD Class Library constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Automated files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the AutomatedDlg.h file to edit it.
 | Add the following lines to the end of the file:

#include "BitmapWindow.h"

17.

Add the following Member Variables to the CBitmapWindow Class:

LRESULT MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
L_VOID SetContainer(LAnnContainer * pContainer);
L_VOID SetAutomation(LAnnAutomation * pAutomation);
L_VOID SetToolBar(LAnnToolBar * pToolBar);

L_VOID OnDraw(HDC hdc, RECT & Rect);

private:
LAnnContainer* m_pContainer;
LAnnAutomation *m_pAutomation;
LAnnToolBar *m_pToolBar;

18. | Add implementation to the member method in CBitmapWindow class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the Automated files folder to open it.
 | c. | Double-click the Header files folder to open it.
 | d. | Double-click the BitmapWindow.cpp file to edit it.
 | e. | Add the following:

CBitmapWindow::CBitmapWindow()
{
m_pContainer = NULL;
m_pAutomation = NULL;
}

CBitmapWindow::~CBitmapWindow()
{

}

L_VOID CBitmapWindow::SetContainer(LAnnContainer * pContainer)
{
m_pContainer = pContainer;
}

L_VOID CBitmapWindow::SetAutomation(LAnnAutomation * pAutomation)
{
m_pAutomation = pAutomation;
}

L_VOID CBitmapWindow::SetToolBar(LAnnToolBar * pToolBar)
{
m_pToolBar = pToolBar;
}

L_VOID CBitmapWindow::OnDraw (HDC hdc, RECT & Rect)
{
LBitmapWindow::OnDraw(hdc, Rect);
L_INT nRet;
if (m_pContainer != NULL)
{
nRet = m_pContainer->Draw(hdc, &Rect);
}

}

LRESULT CBitmapWindow::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_LTANNEVENT:
if(m_pAutomation != NULL)
{

int uChecked = m_pToolBar->GetToolChecked() ;
m_pAutomation->SetTool(uChecked);
}
break;
};

return LBitmapWindow::MsgProcCallBack(hWnd,uMsg,wParam,lParam);
}

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAutomatedDlg.
 | c. | In the Messages list box, select WM_CLOSE.
 | d. | Click the Add function button. Choose OK for the default function name (OnClose).
 | e. | Click the Edit Code button and enter the following code:

if (m_LBitmap.IsAllocated())
{
m_LBitmap.Free();
m_LBitmap.SetContainer(NULL);
m_LBitmap.SetAutomation(NULL);
m_LBitmap.SetToolBar(NULL);
m_LeadAAutomation.SetActiveState(ANNACTIVE_DISABLED);
m_LeadAAutomation.Destroy ();
m_LeadAContainer.Destroy();
m_LeadAToolbar.Destroy();
}

20. | On the main menu, select Build > Build Automated.exe to build the project.
21. | On the main menu, select Build > Execute Automated.exe to run the project.


Loading and Saving Annotations Using Databases (Visual C++ 5.0)

Loading and Saving Annotations Using Databases (C++ 5.0 and later)

Note: This topic is for Document/Medical only.

Take the following steps to start a project and to add some code that demonstrates adding annotation objects to or deleting annotation objects from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify AnnBlob.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #include statements to your program so you can access the LEAD Class Library constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the AnnBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the header files reside):

#include ""..\..\..\..\include\ClassLib\ltWrappr.h

8. | Add #import statements to your program so you can access the Microsoft ActiveX Data Object 2.6 Library:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the AnnBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the .tlb files reside):

#import <C:\\Windows\\system32\\msado26.tlb> rename("EOF", "ADOEOF")
using namespace ADODB

9. | Add a Static Text control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the AnnBlob resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_ANNBLOB_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Click the Static Text control icon, then size and position the control as you want it to appear at run time.

10. | Add six command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_CONNECT | &Connect To Database
 | IDC_DISCONNECT | &Disconnect From Data Base
 | IDC_ADDRECORD | &Add Record
 | IDC_DELETERECORD | D&elete Record
 | IDC_MOVENEXT | Move &Next
 | IDC_MOVEPREVIOUS | Move &Previous
11. | Press Ctrl-F4 to close all windows back to the Project Workspace.

12. | Do the following to add m_btnAddRecord to the CAnnBlobDlg class and link the variable to the CButton control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CAnnBlobDlg.
 | d. | In the Control IDs list, select IDC_ADDRECORD.
 | e. | Click the Add Variable... button.
 | f. | Specify m_btnAddRecord as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.

13. | Repeat step 12 for the other buttons, using the following variable names:
 | ID | Member Variable Name
 | IDC_MOVEPREVIOUS | m_btnMovePrevious
 | IDC_MOVENEXT | m_btnMoveNext
 | IDC_DISCONNECT | m_btnDisconnect
 | IDC_DELETERECORD | m_btnDeleteRecord
 | IDC_CONNECT | m_btnConnect
14. | Add the following Member Variables to the CAnnBlobDlg class:
 | _ConnectionPtr | m_pConnection;
 | _RecordsetPtr | m_pRecordset;
 | LAnnotationWindow | m_LAnnoWnd

15. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the AnnBlob classes folder to open it.
 | c. | Expand the CAnnBlobDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
16. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

LBase::LoadLibraries(LT_KRN);
LBase::LoadLibraries(LT_DIS);
LBase::LoadLibraries(LT_FIL);
LBase::LoadLibraries(LT_ANN);
LSettings::UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

RECT rc;
GetDlgItem(IDC_STATIC)->GetWindowRect(&rc);
ScreenToClient(&rc);

HWND hWnd = m_LAnnoWnd.CreateWnd(this->GetSafeHwnd(),0,
WS_VISIBLE|L_BS_CENTER|
L_BS_PROCESSKEYBOARD,
rc.left ,rc.top ,rc.right ,rc.bottom );

if (!m_LAnnoWnd.GetToolBar().IsCreated())
m_LAnnoWnd.GetToolBar().Create(hWnd, NULL, ANNTOOLALIGN_RIGHT | ANNTOOLALIGN_TOP, TRUE, NULL, NULL);

m_LAnnoWnd.EnableAutoScroll(TRUE);
m_LAnnoWnd.SetFileName (TEXT("C:\\parrots.jpg"));
int nRet = m_LAnnoWnd.Load (0,ORDER_BGR, 1);

HRESULT hr;
CoInitialize(NULL);
hr = m_pConnection.CreateInstance(__uuidof( Connection) );
m_pRecordset.CreateInstance(__uuidof(Recordset));

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and enter the following code: (you will have to change to file name to an existing database file name on your computer)

HRESULT hr;
_bstr_t bstrQuery("SELECT * FROM Images");
_variant_t vNull;
vNull.vt = VT_ERROR ;
vNull.scode = DISP_E_PARAMNOTFOUND ;

if (m_pConnection->State == adStateClosed)
{
hr = m_pConnection->Open( _bstr_t(L"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=DB1.mdb;"),
_bstr_t(L""), _bstr_t(L""), adModeUnknown ) ;
}

if (SUCCEEDED(hr))
{
m_pRecordset->PutRefActiveConnection(m_pConnection);
hr = m_pRecordset->Open(_variant_t(bstrQuery), vNull, adOpenKeyset, adLockOptimistic, adCmdText );

if (SUCCEEDED(hr))
{
if(!m_pRecordset->GetBOF())
{
m_pRecordset->MoveFirst();
}

if (!m_pRecordset->GetADOEOF())
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

m_btnAddRecord.EnableWindow(TRUE);
}
}

18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateOpen)
{
m_pConnection->Close();
}

if (m_pRecordset->State == adStateOpen )
{
m_pRecordset->Close();
}

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_ADDRECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddRecord).
 | f. | Click the Edit Code button and enter the following code:

SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
long ix[1];
L_UINT32 nSize ,i;
int nRet;

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

m_pRecordset->AddNew();

HGLOBAL hMem = 0;
nRet = m_LAnnoWnd.GetContainerObject().SaveMemory (ANNFMT_NATIVE, false,&hMem,&nSize, NULL);

sabFldData[0].cElements = nSize ;
sabFldData[0].lLbound = 0;

SAFEARRAY * psaFieldData = SafeArrayCreate(VT_I1, 1, sabFldData);
BYTE * pData = (BYTE *)GlobalLock(hMem);
for (i = 0; i < nSize; ++i)
{
ix[0] = i;
long data = pData[i];
HRESULT hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

VariantInit(&vData);
V_VT(&vData) = VT_ARRAY | VT_UI1;
vData.parray = psaFieldData;

m_pRecordset->Fields->Item[_variant_t( (long) 1)]->Value = _variant_t(vData);
m_pRecordset->Fields->Item[_variant_t( (long) 2)]->Value = _variant_t( (long) nSize);

m_pRecordset->Update();

if(m_pRecordset->RecordCount >= 0)
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

VariantClear(&vData);
GlobalUnlock(hMem);
GlobalFree(hMem);

20. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_DELETERECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDeleteRecord).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF() || !m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveLast();
m_pRecordset->Delete(adAffectCurrent);
m_pRecordset->Update();

if(m_pRecordset->RecordCount <= 0)
{
m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);
}
}

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVENEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMoveNext).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;
unsigned char *pData = NULL;

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveNext();
}

if (m_pRecordset->GetADOEOF())
{
MessageBox(TEXT("Unable to get the Annotation from db"));
m_pRecordset->MovePrevious();
}
else
{
variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;
pData =(BYTE *) malloc(nSize);
memset(pData,0,nSize);

if(vData.vt == (VT_ARRAY | VT_UI1))
{
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pData[i] = (BYTE)data;
}
}
nRet = m_LAnnoWnd.GetContainerObject().LoadMemory(pData, nSize);
if(pData)
{
free(pData);
pData = NULL;
}
}
}

22. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVEPREVIOUS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMovePrevious).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;
BYTE * pData = NULL;
if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF())
{
m_pRecordset->MovePrevious();
}

if (m_pRecordset->GetBOF())
{
MessageBox(TEXT("Unable to get the Annotation from db"));
m_pRecordset->MoveNext();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;
pData =(BYTE *) malloc(nSize);
memset(pData,0,nSize);

if(vData.vt == (VT_ARRAY | VT_UI1))
{
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pData[i] = (BYTE)data;
}
}

nRet = m_LAnnoWnd.GetContainerObject().LoadMemory((L_UCHAR L_FAR *)pData, nSize);
if(pData)
{
free(pData);
pData = NULL;
}
}
}

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CAnnBlobDlg.
 | c. | In the Messages list box, select WM_CLOSE.
 | d. | Click the Add function button. Choose OK for the default function name (OnClose).
 | e. | Click the Edit Code button and enter the following code:

if (m_LAnnoWnd.IsAllocated())
{
m_LAnnoWnd.Free();
}

LBase::UnloadLibraries(LT_KRN);
LBase::UnloadLibraries(LT_DIS);
LBase::UnloadLibraries(LT_FIL);
LBase::UnloadLibraries(LT_ANN);

CoInitialize(NULL);

24. | On the main menu, select Build > Build AnnBlob.exe to build the project.
25. | On the main menu, select Build > Execute AnnBlob.exe to run the project.


Loading and Saving Images Using Databases (Visual C++ 5.0)

Loading and Saving Images Using Databases (C++ 5.0 and later)

Take the following steps to start a project and to add some code that demonstrates adding images to or deleting images from the BLOB field of a database file.

You need to create a database file (DB1.MDB) with the fields listed below, before running this tutorial.

Field Name | Type
Image | OleObject
Size | Number

1. | Start a new project as follows:
 | Run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify ImageBlob.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D Controls is selected.
 | c. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select Use MFC in a Shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #include statements to your program so you can access the LEAD Class Library constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ImageBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the header files reside):

#include ""..\..\..\..\include\ClassLib\ltWrappr.h

8. | Add #import statements to your program so you can access the Microsoft ActiveX Data Object 2.6 Library:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the ImageBlob files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the .tlb files reside):

#import <C:\\Windows\\system32\\msado26.tlb> rename("EOF", "ADOEOF")
using namespace ADODB

9. | Add a Static Text control to the main window as follows:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the ImageBlob resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_IMAGEBLOB_DIALOG to design the form.
 | e. | Select the TODO... text control; then press the Delete key to delete it.
 | f. | Click the Static Text control icon, then size and position the control as you want it to appear at run time.

10. | Add six command buttons to your form and name them as follows:
 | ID | Caption
 | IDC_CONNECT | &Connect To Database
 | IDC_DISCONNECT | &Disconnect From Data Base
 | IDC_ADDRECORD | &Add Record
 | IDC_DELETERECORD | D&elete Record
 | IDC_MOVENEXT | Move &Next
 | IDC_MOVEPREVIOUS | Move &Previous

11. | Press Ctrl-F4 to close all windows back to the Project Workspace.
12. | Do the following to add m_btnAddRecord to the CImageBlobDlg class and link the variable to the CButton control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CImageBlobDlg.
 | d. | In the Control IDs list, select IDC_ADDRECORD.
 | e. | Click the Add Variable... button.
 | f. | Specify m_btnAddRecord as the variable name, and Control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.

13. | Repeat step 12 for the other buttons, using the following variable names:
 | ID | Member Variable Name
 | IDC_MOVEPREVIOUS | m_btnMovePrevious
 | IDC_MOVENEXT | m_btnMoveNext
 | IDC_DISCONNECT | m_btnDisconnect
 | IDC_DELETERECORD | m_btnDeleteRecord
 | IDC_CONNECT | m_btnConnect
14. | Add the following Member Variables to the CImageBlobDlg class:
 | _ConnectionPtr | m_pConnection;
 | _RecordsetPtr | m_pRecordset;
 | LBitmapWindow | m_LBitmapWnd

15. | Go to the OnInitDialog() function as follows:
 | a. | In the Project Workspace, click the ClassView tab.
 | b. | Double-click the ImageBlob classes folder to open it.
 | c. | Expand the CImageBlobDlg class.
 | d. | Double-click the OnInitDialog() function to edit it.
16. | Edit the OnInitDialog() function to add the following code after the line that says //TODO: Add extra initialization here:

LBase::LoadLibraries(LT_KRN);
LBase::LoadLibraries(LT_DIS);
LBase::LoadLibraries(LT_FIL);

RECT rc;
GetDlgItem(IDC_STATIC)->GetWindowRect(&rc);
ScreenToClient(&rc);

HWND hWnd = m_LBitmapWnd.CreateWnd(this->GetSafeHwnd(),0,
WS_VISIBLE|L_BS_CENTER|
L_BS_PROCESSKEYBOARD,
rc.left ,rc.top ,rc.right ,rc.bottom );

m_LBitmapWnd.EnableAutoScroll(TRUE);
m_LBitmapWnd.SetFileName (TEXT("C:\\parrots.jpg"));
int nRet = m_LBitmapWnd.Load (0,ORDER_BGR, 1);

HRESULT hr;
CoInitialize(NULL);
hr = m_pConnection.CreateInstance(__uuidof( Connection) );
m_pRecordset.CreateInstance(__uuidof(Recordset));

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

17. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and enter the following code: (you will have to change to file name to an existing database file name on your computer)

HRESULT hr;
_bstr_t bstrQuery("SELECT * FROM Images");
_variant_t vNull;
vNull.vt = VT_ERROR ;
vNull.scode = DISP_E_PARAMNOTFOUND ;

if (m_pConnection->State == adStateClosed)
{
hr = m_pConnection->Open( _bstr_t(L"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=DB1.mdb;"),
_bstr_t(L""), _bstr_t(L""), adModeUnknown ) ;
}

if (SUCCEEDED(hr))
{
m_pRecordset->PutRefActiveConnection(m_pConnection);
hr = m_pRecordset->Open(_variant_t(bstrQuery), vNull, adOpenKeyset, adLockOptimistic, adCmdText );

if (SUCCEEDED(hr))
{
if(!m_pRecordset->GetBOF())
{
m_pRecordset->MoveFirst();
}

if (!m_pRecordset->GetADOEOF())
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

m_btnAddRecord.EnableWindow(TRUE);
}
}

18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateOpen)
{
m_pConnection->Close();
}

if (m_pRecordset->State == adStateOpen )
{
m_pRecordset->Close();
}

m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnAddRecord.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_ADDRECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnAddRecord).
 | f. | Click the Edit Code button and enter the following code:

SAFEARRAYBOUND sabFldData[1];
VARIANT vData;
long ix[1];
L_UINT32 nSize ,i;
int nRet;
LMemoryFile LeadMemFile ;
LBuffer LeadMemBuffer ;

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

m_pRecordset->AddNew();

LeadMemFile.SetBitmap((LBitmapBase *) &m_LBitmapWnd);
nRet = LeadMemFile.SaveBitmap(&LeadMemBuffer,FILE_LEAD,24,QS);

nSize = LeadMemBuffer.GetSize();

sabFldData[0].cElements = nSize ;
sabFldData[0].lLbound = 0;

SAFEARRAY * psaFieldData = SafeArrayCreate(VT_I1, 1, sabFldData);
BYTE * pData = (BYTE *)LeadMemBuffer.Lock();

for (i = 0; i < nSize; ++i)
{
ix[0] = i;
long data = pData[i];
HRESULT hr = SafeArrayPutElement(psaFieldData, ix, &data);
}

VariantInit(&vData);
V_VT(&vData) = VT_ARRAY | VT_UI1;
vData.parray = psaFieldData;

m_pRecordset->Fields->Item[_variant_t( (long) 1)]->Value = _variant_t(vData);
m_pRecordset->Fields->Item[_variant_t( (long) 2)]->Value = _variant_t( (long) nSize);

m_pRecordset->Update();

if(m_pRecordset->RecordCount >= 0)
{
m_btnMoveNext.EnableWindow(TRUE);
m_btnMovePrevious.EnableWindow(TRUE);
m_btnDeleteRecord.EnableWindow(TRUE);
}

VariantClear(&vData);
LeadMemBuffer.Unlock();
LeadMemBuffer.Free();
}

void CImageBLOBDlg::OnDeleterecord()
{
if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF() || !m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveLast();
m_pRecordset->Delete(adAffectCurrent);
m_pRecordset->Update();

if(m_pRecordset->RecordCount <= 0)
{
m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);
}
}

20. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_DELETERECORD.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDeleteRecord).
 | f. | Click the Edit Code button and enter the following code:

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF() || !m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveLast();
m_pRecordset->Delete(adAffectCurrent);
m_pRecordset->Update();

if(m_pRecordset->RecordCount <= 0)
{
m_btnMoveNext.EnableWindow(FALSE);
m_btnMovePrevious.EnableWindow(FALSE);
m_btnDeleteRecord.EnableWindow(FALSE);
}
}

21. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVENEXT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMoveNext).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;
unsigned char *pData = NULL;
LMemoryFile LeadMemFile;

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetADOEOF())
{
m_pRecordset->MoveNext();
}

if (m_pRecordset->GetADOEOF())
{
MessageBox(TEXT("Unable to get the Image from db"));
m_pRecordset->MovePrevious();
}
else
{
variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;
pData =(BYTE *) malloc(nSize);
memset(pData,0,nSize);

if(vData.vt == (VT_ARRAY | VT_UI1))
{
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pData[i] = (BYTE)data;
}
}

LeadMemFile. SetBitmap ((LBitmapBase *) &m_LBitmapWnd);
LBuffer LeadMemBuffer (pData,nSize);
nRet = LeadMemFile. LoadBitmap (LeadMemBuffer,24,ORDER_BGR, NULL);

if(pData)
{
free(pData);
pData = NULL;
}
}
}

22. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Object IDs list box, select IDC_MOVEPREVIOUS.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnMovePrevious).
 | f. | Click the Edit Code button and enter the following code:

int nSize;
int nRet;
BYTE * pData = NULL;
LMemoryFile LeadMemFile;

if (m_pConnection->State == adStateClosed )
{
MessageBox (TEXT("Connection closed"));
return;
}

if (!m_pRecordset->GetBOF())
{
m_pRecordset->MovePrevious();
}

if (m_pRecordset->GetBOF())
{
MessageBox(TEXT("Unable to get the Image from db"));
m_pRecordset->MoveNext();
}
else
{
_variant_t varSize;
varSize = m_pRecordset->Fields->Item[2L]->Value;
nSize = varSize.intVal;

if(nSize)
{
_variant_t vData;
vData = m_pRecordset->Fields->Item[1L]->Value;
pData =(BYTE *) malloc(nSize);
memset(pData,0,nSize);

if(vData.vt == (VT_ARRAY | VT_UI1))
{
for(int i = 0 ; i < nSize ; ++i)
{
long data = 0;
SafeArrayGetElement(vData.parray , (long*) &i , &data);
pData[i] = (BYTE)data;
}
}

LeadMemFile.SetBitmap((LBitmapBase *) &m_LBitmapWnd);
LBuffer LeadMemBuffer (pData,nSize);
nRet = LeadMemFile. LoadBitmap (LeadMemBuffer,24,ORDER_BGR, NULL);

if(pData)
{
free(pData);
pData = NULL;
}
}
}

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CImageBlobDlg.
 | c. | In the Messages list box, select WM_CLOSE.
 | d. | Click the Add function button. Choose OK for the default function name (OnClose).
 | e. | Click the Edit Code button and enter the following code:

if (m_LBitmapWnd.IsAllocated())
{
m_LBitmapWnd.Free();
}

LBase::UnloadLibraries(LT_KRN);
LBase::UnloadLibraries(LT_DIS);
LBase::UnloadLibraries(LT_FIL);

CoInitialize(NULL);

24. | On the main menu, select Build > Build ImageBlob.exe to build the project.
25. | On the main menu, select Build > Execute ImageBlob.exe to run the project.


LAnimationWindow::LAnimationWindow

#include "ltwrappr.h"

L_VOID LAnimationWindow::LAnimationWindow(L_VOID)

L_VOID
 LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList=NULL, bAutoAnimate=FALSE,
 nID=0, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0,
 nCX=200, nCY=200)

HWND hWndParent; | /* handle to the parent window */
LBitmapList L_FAR * pBitmapList; | /* pointer to an LBitmapList object */
L_BOOL bAutoAnimate; | /* flag that indicates whether to automatically animate the list */
L_INT nID; | /* window ID */
DWORD dwStyle; | /* window style */
L_INT x; | /* x coordinate of the window */
L_INT y; | /* y coordinate of the window */
L_INT nCX; | /* window width */
L_INT nCY; | /* window height */

Constructs and initializes the different member variables of the LAnimationWindow object.

Parameter | Description
hWndParent | Handle to the parent window of the animation control.
pBitmapList | Pointer to a valid LBitmapList object to be played. The passed list will be copied to an internal member and invalidated.
bAutoAnimate | Flag that indicates whether to automatically animate the list. Possible values are:
 | Value | Meaning
 | TRUE | Automatically animate the list.
 | FALSE | Do not automatically animate the list.

nID | Window ID. This is used if the window is created as a child window.
dwStyle | Window style.
x | X coordinate of the origin of the animation window.
y | Y coordinate of the origin of the animation window.
nCX | Width of the animation window.
nCY | Height of the animation window.

Returns

None

Comments

LAnimationWindow::LAnimationWindow() is the default constructor for the LAnimationWindow class. You should stop animation playback before you destroy the object.

LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList, bAutoAnimate, nID, dwStyle, x, y, nCX, nCY) sets the internal bitmap list to the passed pBitmapList. pBitmapList will be invalidated upon return.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::~LAnimationWindow, Class Members

Example

This is an example for LAnimationWindow::LAnimationWindow():

L_VOID TestFunction()
{
LAnimationWindow MyAnimation;

//Constructor is called upon function entry
//...
//Use MyAnimation object
//...
//Destructor is called when the function returns
}

This is an example for LAnimationWindow::LAnimationWindow(hWndParent, pBitmapList, bAutoAnimate, nID, dwStyle, x, y, nCX, nCY):

#include <ltlck.h> //Required for unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

LBitmapList MyBitmapList;
 //Create a bitmaplist

if (MyBitmapList.Load
 (TEXT("eye.gif"))==SUCCESS)
{
LAnimationWindow MyAnimation(hWndParent,
 /*Parent window*/
&MyBitmapList,
 /*Bitmaplist to assign to animation*/
TRUE,
 /*Auto play animation*/
0x0100,
 /*Child Window ID*/
WS_CHILD|WS_VISIBLE,
 /*Window style*/
0,
 /*Left position*/
0,
 /*Top position*/
300,
 /*Width*/
300/*Height*/
 );
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
else
MessageBox(hWndParent, TEXT("Failed
 to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}


LAnimationWindow::~LAnimationWindow

#include "ltwrappr.h"

virtual L_VOID LAnimationWindow::~LAnimationWindow(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LAnimationWindow class.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::StopAnimation, Class Members

Example

For an example, refer to LAnimationWindow::LAnimationWindow().


LAnimationWindow::AnimateEvent

#include "ltwrappr.h"

virtual L_VOID LAnimationWindow::AnimateEvent(nEvent, nFrameNumber)

L_INT nEvent; | /* the animation event */
L_INT nFrameNumber; | /* the current frame number */

Informs you of Animation events.

Parameter | Description
nEvent | The animation event. Possible values are:
Value | Meaning
EVENT_MOVE_FIRST | LAnimationWindow::MoveFirstFrame was called.
EVENT_MOVE_LAST | LAnimationWindow::MoveLastFrame was called.
EVENT_MOVE_NEXT | LAnimationWindow::MoveNextFrame was called.
EVENT_MOVE_PREV | LAnimationWindow::MovePreviousFrame was called.
EVENT_MOVE_TO | LAnimationWindow::MoveToFrame was called.
EVENT_PLAYSTATE_START | LAnimationWindow::PlayAnimation was called and the playback was started.
EVENT_PLAYSTATE_STOP | LAnimationWindow::StopAnimation was called or the playback reached the end.
EVENT_PLAYSTATE_PRECLEAR | The initial state of the playback (index = -1). The target bitmap will be cleared to the Bitmap background color on the next call.
EVENT_PLAYSTATE_POSTCLEAR | The target bitmap has been cleared.
EVENT_PLAYSTATE_PRERENDER | The current image will be rendered to the target bitmap.
EVENT_PLAYSTATE_RENDER | An image has been rendered to the target bitmap.
EVENT_PLAYSTATE_POSTRENDER | An image is in the midst of being rendered to the target bitmap.
EVENT_PLAYSTATE_WAITINPUT | The playback engine is waiting for user input before moving on to PLAYSTATE_PREDISPOSE.
EVENT_PLAYSTATE_WAITDELAY | The playback engine is waiting for a delayed time before moving on to PLAYSTATE_PREDISPOSE.
EVENT_PLAYSTATE_WAITINPUTDELAY | The playback engine is waiting for user input and a delayed time before moving on to PLAYSTATE_PREDISPOSE.
EVENT_PLAYSTATE_PREDISPOSE | The current image will be disposed of.
EVENT_PLAYSTATE_POSTDISPOSE | The current image has been disposed of. The index is incremented after processing this state.
EVENT_PLAYSTATE_LOOP | Animation playback has looped back to the first frame.

nFrameNumber

The current frame number being displayed.

Returns

None

Comments

This function is called to indicate that an animation event has occurred, or that one of the LAnimationWindow::MoveXXX functions has been called.

You must enable the animation events using LAnimationWindow::EnableAnimateEvent before this function will be called.

Override this function in order to be notified of the events.

The events from EVENT_PLAYSTATE_START to EVENT_POSTDISPOSE are generated by LAnimationWindow::PlayAnimation.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, , LAnimationWindow::EnableAnimateEvent, Class Members
Topics: | Implementing Animation

Example

#include < ltlck.h> //Unlock support

class MyClass : public LAnimationWindow
{
public :
virtual L_VOID AnimateEvent(L_INT
 nEvent,L_INT nFrameNumber)
{
L_TCHAR szStr[255];
wsprintf(szStr,TEXT("Event
 number : %d\nFrameNumber : %d"),nEvent, nFrameNumber);
MessageBox(m_hWnd,
 szStr, TEXT("Example"), MB_OK|MB_ICONINFORMATION);
//call base class
LAnimationWindow::AnimateEvent(nEvent,
 nFrameNumber);
}
};

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

MyClass MyAnimation;

MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.EnableAnimateEvent();
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
}


LAnimationWindow::CancelWait

#include "ltwrappr.h"

L_INT LAnimationWindow::CancelWait(L_VOID)

Cancels the wait for user input and any delay during an animation playback.

Returns

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

Comments

Use this function during playback, inside the LAnimationWindow::AnimateEvent callback function, to cancel the wait for delay or user input.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::PlayAnimation, LAnimationWindow::AnimateEvent, Class Members

Example

For an example, refer to LAnimationWindow::GetRemainingDelay.


LAnimationWindow::ColorResItems

#include "ltwrappr.h"

L_INT LAnimationWindow::ColorResItems(nBitsPerPixel, uFlags, pPalette=NULL, hPalette=NULL, uColors=0)

L_INT nBitsPerPixel; | /* the new number of bits per pixel */
L_UINT32 uFlags; | /* flag that indicates 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 the bitmap list from any bits-per-pixel to any bits-per-pixel.

Parameter | Description
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, and 32
uFlags | Flag that indcates the 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 ( | ). Possible values are:
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 Microsoft Internet Explorer.
CRF_USERPALETTE | [0x10] Use the palette specified in the pPalette parameter.
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 LBitmapSettings::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_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.

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

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::DoModalColorResItems, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
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

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
/* Get an optimized palette for the
 whole list */
MyAnimation.ColorResItems(8,
 CRF_NODITHERING|CRF_OPTIMIZEDPALETTE);
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
}


LAnimationWindow::DoEvents

#include "ltwrappr.h"

L_BOOL LAnimationWindow::DoEvents(pbCanceled=NULL, uVKey=VK_ESCAPE) const

L_BOOL L_FAR * pbCanceled; | /* pointer to a boolean flag */
L_UINT uVKey; | /* Virtual key code to be used as an escape key */

Allows events to take action while animation playback is in progress.

Parameter | Description
pbCanceled | Pointer to boolean flag. This parameter can be NULL.

Returns

TRUE | WM_QUIT message received.
FALSE | Otherwise.

Comments

This function passes control to the operating system. Control is returned after the operating system has finished processing the events in its queue (messages).

DoEvents is most useful for allowing a user to cancel a playback after it has started.

If pbCanceled is not NULL, on return it will contain TRUE if the user has pressed the escape key during message processing.

If the DoEvents captured the WM_QUIT message, the return value is TRUE, otherwise it is FALSE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

For an example, refer to LAnimationWindow::PlayAnimation.


LAnimationWindow::DoModalColorResItems

#include "ltwrappr.h"

L_INT LAnimationWindow::DoModalColorResItems(hwndParent=NULL)

HWND hwndParent;

/* handle to the parent window */

Brings up the Color Resolution dialog box and creates an optimized palette for all bitmaps in the list, depending on the user’s options.

Parameter | Description
hwndParent | Handle to the parent window of the dialog.

Returns

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

Comments

For more information, refer to LDialogColor::DoModalColorRes .

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::ColorResItems, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

#include " ltlck.h" //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
/* Get a palette for the animation*/
L_INT nRetCode = MyAnimation.DoModalColorResItems(hWndParent);
if (nRetCode==SUCCESS_DLG_CANCEL)
{
MessageBox(hWndParent,
 TEXT("User aborted the dialog!"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
return;
}
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
}


LAnimationWindow::EnableAnimateEvent

#include "ltwrappr.h"

L_BOOL LAnimationWindow::EnableAnimateEvent(bEnable=TRUE)

L_BOOL bEnable;

/* flag that determines whether to enable animation events */

Enables or disables the animation playback event notifications.

Parameter | Description
bEnable | Flag that determines whether to enable or disable animation events.
 | Value | Meaning
 | TRUE | Enable animation playback event notifications.
 | FALSE | Disable animation playback event notifications.

Returns

The previous setting.

Comments

This function enables or disables the event notifications that are sent to LAnimationWindow::AnimateEvent.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::AnimateEvent, Class Members
Topics: | Implementing Animation

Example

#include < ltlck.h> //Unlock support

class MyClass : public LAnimationWindow
{
public :
virtual L_VOID AnimateEvent(L_INT nEvent,L_INT
 nFrameNumber)
{
L_TCHAR szStr[255];
wsprintf(szStr,TEXT("Event
 number : %d\nFrameNumber : %d"),nEvent, nFrameNumber);
MessageBox(m_hWnd,
 szStr, TEXT("Example"), MB_OK|MB_ICONINFORMATION);
//call base class
LAnimationWindow::AnimateEvent(nEvent,
 nFrameNumber);
}
};

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

MyClass MyAnimation;

MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.EnableAnimateEvent();
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
}


LAnimationWindow::EnableAutoAnimate

#include "ltwrappr.h"

L_BOOL LAnimationWindow::EnableAutoAnimate(bAutoAnimate=TRUE)

L_BOOL bAutoAnimate;

/* flag that indicates whether to enable auto animation */

Enables or disables auto animation.

Parameter | Description
bAutoAnimate | Flag that indicates whether to enable auto animation. Possible values are:
 | Value | Meaning
 | TRUE | Enable auto animation.
 | FALSE | Disable auto animation.

Returns

The previous state.

Comments

When auto animation is enabled, animation playback will begin automatically upon calling LAnimationWindow::Load, LAnimationWindow::SetBitmapList, or when constructing new objects.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsAutoAnimateEnabled, Class Members
Topics: | Implementing Animation

Example

#include "ltlck.h" //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

LAnimationWindow MyAnimation;
L_INT nRetCode;

//Set auto animate to TRUE so we don't need to call PlayAnimation
MyAnimation.EnableAutoAnimate(TRUE);

//create the control's window
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);

//load eye.gif
MyAnimation.SetFileName(TEXT("eye.gif"));
nRetCode = MyAnimation.Load();
 //this will invoke PlayAnimation directly

if (nRetCode!=SUCCESS)
{
MessageBox(hWndParent, TEXT("Failed
 to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
return;
}
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}


LAnimationWindow::EnableAutoLoop

#include "ltwrappr.h"

L_BOOL LAnimationWindow::EnableAutoLoop(bAutoLoop=TRUE)

L_BOOL bAutoLoop;

/* flag that indicates whether to enable auto looping */

Enables or disables auto looping.

Parameter | Description
bAutoLoop | Flag that indicates whether to enable auto looping. Possible values are:
 | Value | Meaning
 | TRUE | Enable auto looping.
 | FALSE | Disable auto looping.

Returns

The previous state.

Comments

When auto loop is enabled, animation playback will always loop, even if you call LAnimationWindow::EnableLoop(FALSE).

When auto loop is disabled, animation playback looping will depend on the last call to LAnimationWindow::EnableLoop.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsAutoLoopEnabled, LAnimationWindow::EnableLoop, Class Members
Topics: | Implementing Animation

Example

For an example, refer to LAnimationWindow::IsAutoLoopEnabled.


LAnimationWindow::EnableLoop

#include "ltwrappr.h"

L_BOOL LAnimationWindow::EnableLoop(bEnableLoop=TRUE)

L_BOOL bEnableLoop;

/* flag that indicates whether to enable animation looping */

Enables or disables animation looping. If animation loop is enabled, animation playback will continuously loop through the items in the associated bitmap list.

Parameter | Description
bEnableLoop | Flag that indicates whether to enable animation looping. Possible values are:
 | Value | Meaning
 | TRUE | Enable animation looping.
 | FALSE | Disable animation looping.

Returns

The previous state.

Comments

The setting for auto loop overrides this setting.

If auto loop is enabled, this function will have no effect.

If auto loop is disabled, then you can use this function to enable or disable animation playback looping for the class object.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsLoopEnabled, LAnimationWindow::EnableAutoLoop, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();

//Set auto loop to TRUE
MyAnimation.EnableLoop();
MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()!=SUCCESS)
{
MessageBox(hWndParent, TEXT("Error
 loading file!"),TEXT("Sample"), MB_OK|MB_ICONSTOP);
return;
}
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);

MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
L_BOOL bCanceled;

L_BOOL bQuit = MyAnimation.DoEvents(&bCanceled);

if (bCanceled || bQuit)
{
MyAnimation.StopAnimation();
break;
}
}
}


LAnimationWindow::EnablePlayWhileLoad

#include "ltwrappr.h"

L_BOOL LAnimationWindow::EnablePlayWhileLoad(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to enable the play while load feature */

Enables or disables the play while load feature.

Parameter | Description
bEnable | Flag that indicates whether to enable the play while load feature. Possible values are:
 | Value | Meaning
 | TRUE | Enable the play while load feature.
 | FALSE | Disable the play while load feature.

Returns

The previous state.

Comments

If play while load is enabled, an animation file will be played while it is being loaded. Each loaded page is displayed directly after it is loaded.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LFile::LoadFile, LAnimationWindow::Load, LAnimationWindow::SetBitmapList, LAnimationWindow::IsPlayWhileLoadEnabled, Class Members
Topics: | Implementing Animation

Example

#include <ltlck.h> //Unlock support

class MyClass : public LAnimationWindow
{
public :
virtual L_VOID AnimateEvent(L_INT nEvent,L_INT
 nFrameNumber)
{
switch (nEvent)
{
case
 EVENT_PLAYSTATE_WAITDELAY:
if
 (GetRemainingDelay()>1)
break;
case
 EVENT_PLAYSTATE_WAITINPUT :
CancelWait();
break;
}
//call base class
LAnimationWindow::AnimateEvent(nEvent,
 nFrameNumber);
}
};

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

MyClass MyAnimation;

MyAnimation.SetFileName(TEXT("image1.gif"));
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.EnableAnimateEvent();
 //Allow user to receive events
//Enable play-while-load feature
if (!MyAnimation.IsPlayWhileLoadEnabled())
MyAnimation.EnablePlayWhileLoad();

MyAnimation.EnableAutoErrorDisplay(TRUE);
if (MyAnimation.Load()!=SUCCESS)
{
return;
}
MessageBox(hWndParent, TEXT("Finished loading..."),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}


LAnimationWindow::EnableTransparency

#include "ltwrappr.h"

L_INT LAnimationWindow::EnableTransparency(bEnable=TRUE, clrTransparent=RGB(0,0,0), nIndex=ANIM_ALL_ITEMS)

L_BOOL bEnable; | /* flag that indicates whether to enable transparency */
COLORREF clrTransparent; | /* transparent color */
L_UINT nIndex; | /* position of the bitmap list item */

Sets the transparency parameters to be used with playback for the bitmap item at position nIndex inside the bitmap list.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable transparency. Possible values are:
Value | Meaning
TRUE | Enable transparency.
FALSE | Disable transparency.
clrTransparent | COLORREF that represents the transparent color to use for animation playback.
nIndex | Position of the bitmap list item. Possible values are:
Value | Meaning
ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list
>=0 | Set the delay only for the specified item

Returns

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

Comments

Passing nIndex = ANIM_ALL_ITEMS will cause all the bitmaps in the list to be set.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsTransparencyEnabled, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation, Implementing Transparency
 | Using Color Values in LEADTOOLS

Example

/*
The following example will change the transparency information
for odd numbered items in the animation list using EnableTransparency,
then reads the new information using IsTransparencyEnabled.
*/

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
L_BOOL bEnabled;
COLORREF crTranparent;

MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//change the transparency...
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
if (i%2)
MyAnimation.EnableTransparency(TRUE, RGB(i*35 % 256, i*50 % 256, i*75 % 256), i);
}

for (i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];

//get current transparenct info for each bitmap...
MyAnimation.IsTransparencyEnabled(&bEnabled, &crTranparent, i);
wsprintf(szStr,TEXT("Bitmap[%d] Transparency Info: Enabled= %s Color = &H%08X"),i, (bEnabled?TEXT("YES"):TEXT("NO")), crTranparent);
MessageBox(hWndParent, szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::EndChanging

#include "ltwrappr.h"

virtual L_VOID LAnimationWindow::EndChanging(nChangeType, nChangeCategory, nRetCode)

L_UINT nChangeType; | /* the type of change */
L_UINT nChangeCategory; | /* the change category */
L_INT nRetCode; | /* the function return code */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change that was done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nRetCode | The function return code.

Returns

None

Comments

This function is called by every function that affects the bitmap. You can override this function to be notified when the operation has completed changing the bitmap. This function is called after the changes to the bitmap have been made. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing, such as updating the display, after the operation has completed.

If the you override this function you must do the following:

Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

For an example, refer to LAnimationWindow::StartChanging.


LAnimationWindow::GetAnimationBitsPerPixel

#include "ltwrappr.h"

L_INT LAnimationWindow::GetAnimationBitsPerPixel(L_VOID) const

Gets the bits per pixel of the playback bitmap.

Returns

The number of bits per pixel for the animation playback bitmap.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::GetAnimationColorOrder, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load(8,
 ORDER_RGB)==SUCCESS)
{
L_TCHAR szStr[255];

wsprintf(szStr, TEXT("Bitmap Bits
 Per Pixel = %d, Width = %d and Height = %d."),
MyAnimation.GetAnimationBitsPerPixel(),
MyAnimation.GetAnimationWidth(),
MyAnimation.GetAnimationHeight());

MessageBox(hWndParent, szStr,TEXT("Example"),MB_OK|MB_ICONSTOP);
return;
}
}


LAnimationWindow::GetAnimationColorOrder

#include "ltwrappr.h"

L_INT LAnimationWindow::GetAnimationColorOrder(L_VOID) const

Gets the color order for the playback bitmap.

Returns

The color order for the playback bitmap. Possible values are:

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::GetAnimationBitsPerPixel, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
L_TCHAR szStr[255];
L_TCHAR L_FAR * pszColorOrder;

switch (MyAnimation.GetAnimationColorOrder())
{
case ORDER_RGB :
 /* RGB ordering */
pszColorOrder
 = TEXT("RGB ordered");
break;
case ORDER_BGR :
 /* BGR ordering */
pszColorOrder
 = TEXT("BGR ordered");
break;
case ORDER_GRAY :
 /*Gray pixels */
pszColorOrder
 = TEXT("Gray pixels");
break;
default :
pszColorOrder
 = TEXT("Unknown");
break;
}
wsprintf(szStr, TEXT("Bitmap Bits
 Per Pixel = %d, Color order = %s."),
MyAnimation.GetAnimationBitsPerPixel(),
 pszColorOrder);

MessageBox(hWndParent, szStr,TEXT("Example"),MB_OK|MB_ICONSTOP);
return;
}
}


LAnimationWindow::GetAnimationHeight

#include "ltwrappr.h"

L_INT LAnimationWindow::GetAnimationHeight(L_VOID) const

Gets the height of the playback bitmap.

Returns

The height of the playback bitmap.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::GetAnimationWidth, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

For an example, refer to LAnimationWindow::GetAnimationBitsPerPixel.


LAnimationWindow::GetAnimationWidth

#include "ltwrappr.h"

L_INT LAnimationWindow::GetAnimationWidth(L_VOID) const

Gets the width of the playback bitmap.

Returns

The width of the playback bitmap.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::GetAnimationHeight, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation

Example

For an example, refer to LAnimationWindow::GetAnimationBitsPerPixel.


LAnimationWindow::GetAnimationWindow

#include "ltwrappr.h"

HWND LAnimationWindow::GetAnimationWindow(L_VOID) const

Gets the window handle of LAnimationWindow object.

Returns

The window handle of the LAnimationWindow object.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LBitmapWindow::GetBitmapWnd, Class Members
Topics: | Implementing Animation

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);

MessageBox(hWndParent, TEXT("Moving
 animation window..."),TEXT("Example"), MB_OK | MB_ICONINFORMATION);
HWND hWnd = MyAnimation.GetAnimationWindow();
if (hWnd)
{
MoveWindow(hWnd,50,50,300,300,TRUE);
MessageBox(hWndParent,
 TEXT("Animation window moved"),TEXT("Example"), MB_OK
 | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::GetBackgroundColor

#include "ltwrappr.h"

COLORREF LAnimationWindow::GetBackgroundColor(L_VOID)

Gets the color used for the animation playback background.

Returns

The background color displayed during animation playback.

Comments

This color appears during playback only.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::SetBackgroundColor, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnimationWindow::SetBackgroundColor.


LAnimationWindow::GetCount

#include "ltwrappr.h"

L_UINT LAnimationWindow::GetCount(L_VOID) const

Gets the number of bitmaps inside the bitmap list.

Returns

The number of bitmap items in the list.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveToFrame, LAnimationWindow::GetCurrentIndex, Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LAnimationWindow::GetCurrentIndex.


LAnimationWindow::GetCurrentIndex

#include "ltwrappr.h"

L_UINT LAnimationWindow::GetCurrentIndex(L_VOID) const

Gets the index of the frame from the bitmap list that is currently displayed.

Returns

The current frame index.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveToFrame, LAnimationWindow::GetCount, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make
 sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
L_TCHAR szStr[255];

MyAnimation.MoveLastFrame();
wsprintf(szStr,TEXT("Current Index
 = %d and Count = %d"),MyAnimation.GetCurrentIndex(),
 MyAnimation.GetCount());
MessageBox(hWndParent, szStr,TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
}


LAnimationWindow::GetDelay

#include "ltwrappr.h"

L_INT LAnimationWindow::GetDelay(nIndex) const

L_UINT nIndex;

/* position of the bitmap list item */

Gets the animation playback delay in milliseconds (ms) for the bitmap item at position nIndex inside the bitmap list.

Parameter | Description
nIndex | Position of bitmap list item.

Returns

The animation playback delay in milliseconds (ms).

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::SetDelay, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//Set the delay for All elements and
 display it...
MyAnimation.SetDelay(3000);
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];

wsprintf(szStr,TEXT("Delay[%d]
 = %d"),i, MyAnimation.GetDelay(i));
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::GetDisposalMethod

#include "ltwrappr.h"

L_INT LAnimationWindow::GetDisposalMethod(nIndex) const

L_UINT nIndex;

/* position of the bitmap list item */

Gets the disposal method for the bitmap item at position nIndex inside the bitmap list.

Parameter | Description
nIndex | Position of bitmap list item.

Returns

The animation playback disposal method. For possible values, refer to Animation Disposal Methods.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::SetDisposalMethod, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT(); //unlock GIF support
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//Set the disposal method for All elements
 and display it...
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
if (i % 2)
MyAnimation.SetDisposalMethod(DISPOSAL_RESTOREPREVIOUS,
 i);
else
MyAnimation.SetDisposalMethod(DISPOSAL_LEAVE,
 i);

//display the result…
for (i=0; i<MyAnimation.GetCount();
 i++)
{
L_TCHAR szStr[255];
L_TCHAR L_FAR *pszDispMethod;

switch (MyAnimation.GetDisposalMethod(i))
{
case
 DISPOSAL_NONE :
pszDispMethod
 = TEXT("No Disposal");
break;
case
 DISPOSAL_LEAVE:
pszDispMethod
 = TEXT("Leave");
break;
case
 DISPOSAL_RESTOREBACKGROUND:
pszDispMethod
 = TEXT("Restore Background");
break;
case
 DISPOSAL_RESTOREPREVIOUS:
pszDispMethod
 = TEXT("Restore Previous");
break;
default
 :
pszDispMethod
 = TEXT("Unkown");
break;
}
wsprintf(szStr,TEXT("BitmapDisposal[%d]
 = %s"),i, pszDispMethod);
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::GetPosition

#include "ltwrappr.h"

L_INT LAnimationWindow::GetPosition(pLeft, pTop, nIndex) const

L_INT L_FAR * pLeft; | /* address of a variable to be updated with the x coordinate */
L_INT L_FAR * pTop; | /* address of a variable to be updated with the y coordinate */
L_UINT nIndex; | /* position of the bitmap list item */

Gets the left and/or top positions for the bitmap item at position nIndex inside the bitmaplist.

Parameter | Description
pLeft | Address of a variable to be updated with the x coordinate of the bitmap list item, or NULL.
pTop | Address of a variable to be updated with the y coordinate of the bitmap list item, or NULL.
nIndex | Position of the bitmap list item.

Returns

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

Comments

You can pass NULL for pLeft or pTop to ignore the returned values, but you must pass at least one valid pointer.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::SetPosition, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

For an example, refer to LAnimationWindow::SetPosition.


LAnimationWindow::GetRemainingDelay

#include "ltwrappr.h"

L_UINT32 LAnimationWindow::GetRemainingDelay(L_VOID)

Gets the time remaining in the current wait state of an animation playback.

Returns

The number of milliseconds remaining.

Comments

Use this function during playback, inside the LAnimationWindow::AnimateEvent callback function, to query for the delay time remaining for the current frame.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::PlayAnimation, LAnimationWindow::CancelWait, LAnimationWindow::AnimateEvent, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

#include <ltlck.h> //Unlock support

class MyClass : public LAnimationWindow
{
public :

      virtual L_VOID AnimateEvent(L_INT
 nEvent,L_INT nFrameNumber)
{
switch (nEvent)
{
case
 EVENT_PLAYSTATE_WAITINPUT :
CancelWait();
break;
case
 EVENT_PLAYSTATE_WAITDELAY :
if
 (GetRemainingDelay()<1000)
CancelWait();
break;
}
//call base class
LAnimationWindow::AnimateEvent(nEvent,
 nFrameNumber);
}
};

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT();//unlock GIF support

MyClass MyAnimation;

MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.SetDelay(2500);
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.EnableAnimateEvent();
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())

{

if (MyAnimation.DoEvents())

break;

}

}
}


LAnimationWindow::IsAutoAnimateEnabled

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsAutoAnimateEnabled(L_VOID) const

Determines whether auto animation is enabled.

Returns

The current state of auto animation. Possible values are:

Value | Meaning
TRUE | Auto animation is enabled.
FALSE | Auto animation is disabled.

Comments

When auto animation is enabled, animation playback will begin automatically upon calling LAnimationWindow::Load, LAnimationWindow::SetBitmapList, or when constructing new objects.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::EnableAutoAnimate, Class Members
Topics: | Implementing Animation

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

LAnimationWindow MyAnimation;
L_INT nRetCode;

MyAnimation.SetFileName(TEXT("eye.gif"));
MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
nRetCode = MyAnimation.Load();

if (nRetCode!=SUCCESS)
{
MessageBox(hWndParent, TEXT("Failed
 to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
return;
}

//see if we need to call PlayAnimation or it has been
 called
if (!MyAnimation.IsAutoAnimateEnabled())
{
MessageBox(hWndParent,TEXT("Now
 invoking PlayAnimation..."),TEXT("Example"),MB_OK|MB_ICONINFORMATION);
MyAnimation.PlayAnimation();
}
else
MessageBox(hWndParent,TEXT("AutoAnimate
 is enabled!"),TEXT("Example"),MB_OK|MB_ICONINFORMATION);

while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}


LAnimationWindow::IsAutoLoopEnabled

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsAutoLoopEnabled(L_VOID) const

Determines whether auto loop is enabled.

Returns

The current state for auto loop. Possible values are:

Value | Meaning
TRUE | Auto loop is enabled.
FALSE | Auto loop is disabled.

Comments

When auto loop is enabled, animation playback will always loop, even if you call LAnimationWindow::EnableLoop(FALSE).

When auto loop is disabled, animation playback looping will depend on the last call to LAnimationWindow::EnableLoop.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::EnableAutoLoop, LAnimationWindow::PlayAnimation, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/*
The following example will set auto loop to TRUE, so every time an animation
 is
played, the play will be continuous, i.e. will loop infinitely.
*/

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded

LAnimationWindow MyAnimation;

//Set auto loop to TRUE
MyAnimation.EnableAutoLoop(TRUE);

if (MyAnimation.IsAutoLoopEnabled())
{
MyAnimation.EnableLoop(FALSE);
 //Has no effect
L_BOOL bLoop = MyAnimation.IsLoopEnabled();
 //bLoop must be TRUE
}
else
MessageBox(hWndParent, TEXT("Auto
 Loop is not enabled"),TEXT("Example"),MB_OK | MB_ICONINFORMATION);
}


LAnimationWindow::IsFirstFrame

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsFirstFrame(L_VOID) const

Determines whether the current frame is the first frame in the bitmap list.

Returns

TRUE | The current frame is the first frame in the bitmap list.
FALSE | The current frame is not the first frame in the bitmap list.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::GetCurrentIndex, LAnimationWindow::IsPreviousFrameAvailable, LAnimationWindow::IsFirstFrame, LAnimationWindow::IsLastFrame, Class Members

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
MyAnimation.MoveToFrame(i);
if (MyAnimation.IsFirstFrame())
{
MessageBox(hWndParent,
 TEXT("First frame..."),TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
else
if
 (MyAnimation.IsLastFrame())
{
MessageBox(hWndParent,
 TEXT("Last frame..."),TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}
}


LAnimationWindow::IsLastFrame

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsLastFrame(L_VOID) const

Determines whether the current frame is the last frame in the bitmap list.

Returns

TRUE | The current frame is the last frame in the bitmap list.
FALSE | The current frame is not the last frame in the bitmap list.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::GetCurrentIndex, LAnimationWindow::IsPreviousFrameAvailable, LAnimationWindow::IsFirstFrame, LAnimationWindow::IsLastFrame, Class Members

Example

For an example, refer to LAnimationWindow::IsFirstFrame.


LAnimationWindow::IsLoopEnabled

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsLoopEnabled(L_VOID) const

Determines whether looping is enabled for the animation playback.

Returns

The current state for animation looping. Possible values are:

Value | Meaning
TRUE | Animation looping is enabled.
FALSE | Animation looping is disabled.

Comments

The setting for auto loop overrides this setting.

If auto loop is enabled, this function will always return TRUE, and animation playback will automatically loop.

If auto loop is disabled, then the return value of this function will indicate the current state for animation playback looping.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::EnableLoop, LAnimationWindow::EnableAutoLoop, LAnimationWindow::PlayAnimation, Class Members

Example

For an example, refer to LAnimationWindow::IsAutoLoopEnabled.


LAnimationWindow::IsNextFrameAvailable

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsNextFrameAvailable(L_VOID) const

Determines whether there is an existing frame after the current frame.

Returns

TRUE | There is a frame after the current frame, so you can use LAnimationWindow::MoveNextFrame.
FALSE | There is not a frame after the current frame, so you cannot use LAnimationWindow::MoveNextFrame.

Comments

You cannot call this function during animation playback.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::GetCurrentIndex, LAnimationWindow::IsPreviousFrameAvailable, LAnimationWindow::IsFirstFrame, LAnimationWindow::IsLastFrame, Class Members

Example

/*
This example uses IsNextFrameAvailable to mimic the PlayAnimation behavior
*/

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
while (MyAnimation.IsNextFrameAvailable())
{
Sleep(500);
MyAnimation.MoveNextFrame();
}
}
}


LAnimationWindow::IsPlaying

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsPlaying(L_VOID) const

Determines whether animation playback is in progress.

Returns

TRUE | Animation playback is in progress.
FALSE | Animation playback is not in progress.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::StopAnimation, LAnimationWindow::AnimateEvent, Class Members

Example

For an example, refer to LAnimationWindow::PlayAnimation.


LAnimationWindow::IsPlayWhileLoadEnabled

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsPlayWhileLoadEnabled(L_VOID)

Determines whether the play while load feature is enabled.

Returns

The current state of the play while load feature. Possible values are:

Value | Meaning
TRUE | The play while load feature is enabled.
FALSE | The play while load feature is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::EnablePlayWhileLoad, LAnimationWindow::Load, LAnimationWindow::SetBitmapList, LAnimationWindow::AnimateEvent, Class Members

Example

For an example, refer to LAnimationWindow::EnablePlayWhileLoad.


LAnimationWindow::IsPreviousFrameAvailable

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsPreviousFrameAvailable(L_VOID) const

Determines whether there is an existing frame prior to the current frame.

Returns

TRUE | There is a frame prior to the current frame, so you can use LAnimationWindow::MovePreviousFrame.
FALSE | There is not a frame prior to the current frame, so you cannot use LAnimationWindow::MovePreviousFrame.

Comments

You cannot call this function during animation playback.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::GetCurrentIndex, LAnimationWindow::IsPreviousFrameAvailable, LAnimationWindow::IsFirstFrame, LAnimationWindow::IsLastFrame, Class Members

Example

/*
The following example behaves oppositely to PlayAnimation using IsPreviousFrameAvailable
*/
#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.MoveLastFrame();
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
while (MyAnimation.IsPreviousFrameAvailable())
{
Sleep(500);
MyAnimation.MovePreviousFrame();
}
}
}


LAnimationWindow::IsTransparencyEnabled

#include "ltwrappr.h"

L_INT LAnimationWindow::IsTransparencyEnabled(pEnabled, pTransparentColor, nIndex) const

L_BOOL L_FAR * pEnabled; | /* pointer to a variable to be updated */
COLORREF L_FAR * pTransparentColor; | /* pointer to a variable to be updated with the transparent color */
L_UINT nIndex; | /* position of the bitmap list item */

Gets the transparency parameters to be used with playback for the bitmap item at position nIndex inside the bitmap list.

Parameter | Description
pEnabled | Pointer to a variable to be updated with a flag that indicates whether transparency is enabled.
pTransparentColor | Pointer to a variable to be updated with the current transparency color.
nIndex | Position of the bitmap list item.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsTransparencyEnabled, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnimationWindow::EnableTransparency.


LAnimationWindow::IsValidAnimation

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsValidAnimation(L_VOID) const

Determines whether the LAnimationWindow object is valid.

Returns

TRUE | The LAnimationWindow object is valid.
FALSE | The LAnimationWindow object is not valid.

Comments

Before you can use any of the animation playback functions, a valid LBitmapList object must be associated with the class object. Until you have associated a bitmap list with the LAnimationWindow object, the object is considered invalid.

You can associate a bitmap list with the LAnimationWindow object using
 the constructor(LAnimationWindow::LAnimationWindow),
 LAnimationWindow::SetBitmapList,
 or LAnimationWindow::Load.

Note: This function also determines whether the current file is an animated GIF or AVI file. If the file contains more than one page, the function will return TRUE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

L_INT nRetCode;
LBitmap Bitmap;
LBitmapList MyBitmapList;
LAnimationWindow MyAnimation;
L_TCHAR L_FAR * pszFiles[] = {TEXT(" image1.cmp"),
TEXT("image2.cmp"),
TEXT(" image3.cmp") };
MyBitmapList.Create();

for (int i = 0 ; i<3; i++)
{
nRetCode = Bitmap.Load(pszFiles[i]);
if (nRetCode !=SUCCESS)
{
MessageBox(hWndParent,
 TEXT("Failed to load file"),TEXT("Error!"),MB_OK |
 MB_ICONSTOP);
return;
}
MyBitmapList.InsertItem(&Bitmap);
}
MyAnimation.SetBitmapList(&MyBitmapList);

if (MyAnimation.IsValidAnimation())
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,800,600);
MyAnimation.SetDelay(1000);
MyAnimation.SetBackgroundColor(RGB(255,255,255));
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
MessageBox(hWndParent, TEXT("Press
 Ok to terminate"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}
}


LAnimationWindow::IsWaitingForUserInput

#include "ltwrappr.h"

L_BOOL LAnimationWindow::IsWaitingForUserInput(nIndex) const

L_UINT nIndex;

/* position of the bitmap list item */

Determines whether the animation playback waits for user input at the specified index in the list.

Parameter | Description
nIndex | Position of the bitmap list item.

Returns

TRUE | The bitmap list item is set to wait for user input.
FALSE | The bitmap list item is not set to wait for user input.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::WaitForUserInput, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

For an example, refer to LAnimationWindow::WaitForUserInput.


LAnimationWindow::Load

#include "ltwrappr.h"

virtual L_INT LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL)

virtual L_INT LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

L_TCHAR L_FAR * pszFileName; | /* name of the file to load */
L_INT nBitsPerPixel; | /* number of bits per pixel for the playback bitmap */
L_INT nColorOrder; | /* color order of the playback bitmap */
L_INT nPage; | /* page number */
pLOADFILEOPTION pLoadFileOption | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file into the animation object.

Parameter | Description
pszFileName | Character string containing the name of the file to load.
nBitsPerPixel | Number of bits per pixel for the playback bitmap.
nColorOrder | Color order of the playback bitmap. 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 toolkits.
nPage | Page number to load from a multi page file. The first page is number 1. If the file is an animated GIF file or an AVI, this is the first page to load. If this is not an animation file, then the function will load page number nPage from the file.
pLoadFileOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

This function loads a file into the animation object. If the file is an animated GIF or AVI, then the bitmap list will be loaded with all the images from the file starting at nPage. If the file is not an animated GIF or AVI, then the function will load the page specified by nPage.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/*This is an example for LAnimationWindow::Load(nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad1(HWND hWnd)
{
LAnimationWindow AnimationWindow;

   LSettings::UnlockSupport(L_SUPPORT_GIFLZW,
 L_KEY_GIFLZW);
AnimationWindow.SetFileName(TEXT("d:\\ltwin14x\\images\\eye.gif"));

if (AnimationWindow.Load(8,
 ORDER_BGR, 1) ==SUCCESS)
{
AnimationWindow.CreateWnd(hWnd,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
AnimationWindow.PlayAnimation();
while (AnimationWindow.IsPlaying())
{
if (AnimationWindow.DoEvents())
break;
}
}
}

/*This is an example for LAnimationWindow::Load(nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad2(HWND hWnd)
{
LAnimationWindow AnimationWindow;
LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
AnimationWindow.SetFileName(TEXT("d:\\ltwin14x\\images\\eye.gif"));

if (AnimationWindow.Load(8,
 ORDER_BGR, NULL) ==SUCCESS)
{
AnimationWindow.CreateWnd(hWnd,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
AnimationWindow.PlayAnimation();
while (AnimationWindow.IsPlaying())
{
if (AnimationWindow.DoEvents())
break;
}
}
}

/*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel, nColorOrder, nPage, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad3(HWND hWnd)
{
LAnimationWindow AnimationWindow;
LSettings::UnlockSupport(L_SUPPORT_GIFLZW,
 L_KEY_GIFLZW);
if (AnimationWindow.Load(TEXT("d:\\ltwin14x\\images\\eye.gif"),
 8, ORDER_BGR, 5) ==SUCCESS)
{
AnimationWindow.CreateWnd(hWnd,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
AnimationWindow.PlayAnimation();
while (AnimationWindow.IsPlaying())
{
if (AnimationWindow.DoEvents())
break;
}
}
}

/*This is an example for LAnimationWindow::Load(pszFileName, nBitsPerPixel=0, nColorOrder=ORDER_BGR, pLoadFileOption=NULL, pFileInfo=NULL):*/

void OnBUTTONLAnimationWindowLoad4(HWND hWnd)
{
LAnimationWindow AnimationWindow;
LSettings::UnlockSupport(L_SUPPORT_GIFLZW,
 L_KEY_GIFLZW);
if (AnimationWindow.Load(TEXT("d:\\ltwin14x\\images\\eye.gif"),
 8, ORDER_BGR, NULL) ==SUCCESS)
{
AnimationWindow.CreateWnd(hWnd,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
AnimationWindow.PlayAnimation();
while (AnimationWindow.IsPlaying())
{
if (AnimationWindow.DoEvents())
break;
}
}
}


LAnimationWindow::MoveFirstFrame

#include "ltwrappr.h"

L_INT LAnimationWindow::MoveFirstFrame(L_VOID)

Moves to the first frame in the animation object.

Returns

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

Comments

You can use this function, if the animation in not currently playing, to move to the first item in the bitmap list. The first bitmap becomes the active bitmap and is displayed.

If animation events are enabled, this function triggers the EVENT_MOVE_FIRST event.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveNextFrame, LAnimationWindow::MovePreviousFrame, LAnimationWindow::MoveLastFrame, LAnimationWindow::MoveToFrame, LAnimationWindow::AnimateEvent , Class Members

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded

   LAnimationWindow
 MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
if (MyAnimation.MoveFirstFrame()==SUCCESS)
{
MessageBox(hWndParent,
 TEXT("This is the first frame"),TEXT("Example"), MB_OK
 | MB_ICONINFORMATION);
}
else
MessageBox(hWndParent,
 TEXT("Failed to move to first frame"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
}


LAnimationWindow::MoveLastFrame

#include "ltwrappr.h"

L_INT LAnimationWindow::MoveLastFrame(L_VOID)

Moves to the last frame in the animation object.

Returns

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

Comments

You can use this function, if the animation in not currently playing, to move to the last item in the bitmap list.

The last bitmap becomes the active bitmap and is displayed. If animation events are enabled, this function triggers the EVENT_MOVE_LAST event.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveFirstFrame, LAnimationWindow::MoveNextFrame, LAnimationWindow::MovePreviousFrame, LAnimationWindow::MoveToFrame, LAnimationWindow::AnimateEvent , Class Members

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
if (MyAnimation.MoveLastFrame()==SUCCESS)
{
MessageBox(hWndParent,
 TEXT("This is the last frame"),TEXT("Example"), MB_OK
 | MB_ICONINFORMATION);
}
else
MessageBox(hWndParent,
 TEXT("Failed to move to last frame"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
}


LAnimationWindow::MoveNextFrame

#include "ltwrappr.h"

L_INT LAnimationWindow::MoveNextFrame(L_VOID)

Moves to the next frame in the animation object, if one exists.

Returns

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

Comments

You can use this function, if the animation in not currently playing, to move to the next item in the bitmap list.

The next bitmap becomes the active bitmap and is displayed.

If animation events are enabled, this function triggers the EVENT_MOVE_NEXT event.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveFirstFrame, LAnimationWindow::MovePreviousFrame, LAnimationWindow::MoveToFrame, LAnimationWindow::MoveLastFrame, LAnimationWindow::AnimateEvent , Class Members

Example

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
if (MyAnimation.MoveNextFrame()==SUCCESS)
{
MessageBox(hWndParent,
 TEXT("This is the second frame"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
else
MessageBox(hWndParent,
 TEXT("Failed to move to next frame"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
}


LAnimationWindow::MovePreviousFrame

#include "ltwrappr.h"

L_INT LAnimationWindow::MovePreviousFrame(L_VOID)

Moves to the previous frame in the animation object, if one exists.

Returns

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

Comments

You can use this function, if the animation in not currently playing, to move to the previous item in the bitmap list.

The previous bitmap becomes the active bitmap and is displayed.

If animation events are enabled, this function triggers the EVENT_MOVE_PREV event.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPreviousFrameAvailable, LAnimationWindow::IsPlaying, LAnimationWindow::MoveFirstFrame, LAnimationWindow::MoveNextFrame, LAnimationWindow::MoveLastFrame, LAnimationWindow::MoveToFrame, LAnimationWindow::AnimateEvent , Class Members

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.MoveLastFrame();
if (MyAnimation.IsPreviousFrameAvailable())
{
MyAnimation.MovePreviousFrame();
MessageBox(hWndParent,
 TEXT("This frame is previous to last"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
else
MessageBox(hWndParent,
 TEXT("Previous frame not available"),TEXT("Example"),
 MB_OK | MB_ICONINFORMATION);
}
}


LAnimationWindow::MoveToFrame

#include "ltwrappr.h"

virtual L_INT LAnimationWindow::MoveToFrame(nIndex)

L_UINT nIndex;

/* position of the bitmap list item */

Moves to the specified frame in the animation object.

Parameter | Description
nIndex | Position of the bitmap list item.

Returns

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

Comments

You can use this function, if the animation in not currently playing, to move to the specified item in the bitmap list.

The nIndex bitmap becomes the active bitmap and is displayed.

If animation events are enabled, this function triggers the EVENT_MOVE_TO event.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::MoveFirstFrame, LAnimationWindow::MoveNextFrame, LAnimationWindow::MovePreviousFrame, LAnimationWindow::MoveLastFrame, LAnimationWindow::AnimateEvent , Class Members

Example

#include < ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];

wsprintf(szStr,TEXT("This
 is frame number %d"),i);
MyAnimation.MoveToFrame(i);
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::PlayAnimation

#include "ltwrappr.h"

L_INT LAnimationWindow::PlayAnimation(L_VOID)

Starts an animation playback.

Returns

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

Comments

This function starts an animation playback. In order to play an animation, you must call LAnimationWindow::Load or LAnimationWindow::SetBitmapList prior to calling this function. You can also pass an LBitmapList object using the constructor.

If the animation is already started, the function will return WRPERR_ANIMATION_ALREADY_STARTED.

If the loaded file is not a valid file, the return value will be WRPERR_ANIMATION_INVALID_FILE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::StopAnimation, LAnimationWindow::IsPlaying, LAnimationWindow::Load, LAnimationWindow::SetBitmapList, LAnimationWindow::AnimateEvent, Class Members

Example

/*
The following example will create an animation, and play it continuously
until the user aborts or closes the program.
The program uses DoEvents to allow the user to stop animation.
*/

#include <ltwrappr.h> //Required by all classes
#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();

//Set auto loop to TRUE
MyAnimation.EnableLoop();
MyAnimation.SetFileName(TEXT("eye.gif"));
if (MyAnimation.Load()!=SUCCESS)
{
MessageBox(hWndParent, TEXT("Error
 loading file!"),TEXT("Sample"), MB_OK|MB_ICONSTOP);
return;
}
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);

MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
L_BOOL bCanceled;

L_BOOL bQuit = MyAnimation.DoEvents(&bCanceled);

if (bCanceled || bQuit)
{
MyAnimation.StopAnimation();
break;
}
}
}


LAnimationWindow::Save

#include "ltwrappr.h"

virtual L_INT LAnimationWindow::Save(L_VOID)

Saves an animation to a file on disk.

Returns

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

Comments

Call this function to save all the images in the animation object's bitmap list to file. This function saves as GIF files only.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::PlayAnimation, Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

/*
The following example will load a bitmap list and save it to a new file using LAnimationWindow.
*/

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWnd)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

LBitmapList MyBitmapList;
 //Create a bitmaplist

if (MyBitmapList.Load
 (TEXT("eye.gif"))==SUCCESS)
{
LAnimationWindow MyAnimation;

MyAnimation.SetBitmapList(&MyBitmapList);
MyAnimation.SetFileName(TEXT("eye2.gif"));

MyAnimation.Save();
}
else
MessageBox(hWnd, TEXT("Failed to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}


LAnimationWindow::SetBackgroundColor

#include "ltwrappr.h"

L_VOID LAnimationWindow::SetBackgroundColor(crBack)

COLORREF crBack;

/* the background color */

Sets the color used for the animation playback background.

Parameter | Description
crBack | The background color for the playback.

Returns

None

Comments

This color appears during playback only.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::GetBackgroundColor, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members
Topics: | Using Color Values in LEADTOOLS

Example

#include <stdlib.h> //for srand and rand functions
#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
L_INT r, g, b;
L_TCHAR szStr[255];

srand(GetTickCount()); //Randomize....
r = rand() %256;
g = rand() %256;
b = rand() %256;

MyAnimation.SetBackgroundColor(RGB(r,g,b));
wsprintf(szStr, TEXT("Animation will play using &h%08X background color"),MyAnimation.GetBackgroundColor());
MessageBox(hWndParent, szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);

MyAnimation.CreateWnd(hWndParent,0, WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
}


LAnimationWindow::SetBitmapList

#include "ltwrappr.h"

L_VOID LAnimationWindow::SetBitmapList(pBitmapList, pBitmapListPrev=NULL, nBitsPerPixel=0, nColorOrder=ORDER_BGRORGRAY)

LBitmapList L_FAR * pBitmapList; | /* pointer to an LBitmapList object */
LBitmapList L_FAR * pBitmapListPrev; | /* pointer to an LBitmapList object */
L_INT nBitsPerPixel; | /* the number of bits per pixel for the playback bitmap */
L_INT nColorOrder; | /* color order of the playback bitmap */

Provides a way to overwrite the internal bitmap list of an LAnimationWindow object.

Parameter | Description
pBitmapList | Pointer to an LBitmapList object. This is the new bitmap to attach to the LAnimationWindow object.
pBitmapListPrev | Pointer to an LBitmapList object to hold the previous bitmaplist used by the LAnimationWindow object.
nBitsPerPixel | Number of bits per pixel for the playback bitmap.
nColorOrder | Color order of the playback bitmap. 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 toolkits.

Returns

None

Comments

The pBitmapList must point to a valid LBitmapList object. If you want to get the previous bitmap list used by the LAnimationWindow object, pass a valid pointer to an LBitmapList object in the pBitmapListPrev parameter. If you do this, you must destroy the LBitmapList object yourself when it is no longer needed. Passing NULL for pBitmapListPrev will cause the previous LBitmapList object to be destroyed by the LAnimationWindow object.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnimationWindow::LAnimationWindow, LAnimationWindow::IsPlaying, LAnimationWindow::PlayAnimation, LAnimationWindow::Load,Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
WRPUNLOCKSUPPORT();//unlock GIF support

LBitmapList MyBitmapList;
 //Create a bitmaplist

if (MyBitmapList.Load
 (TEXT("eye.gif"))==SUCCESS)
{
LAnimationWindow MyAnimation;

MyAnimation.SetBitmapList(&MyBitmapList);
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
}
else
MessageBox(hWndParent, TEXT("Failed
 to load file"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}

Example2:
#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make
 sure all libraries are loaded
WRPUNLOCKSUPPORT(); //unlock GIF support

L_INT nRetCode;
LBitmap Bitmap;
LBitmapList MyBitmapList;
LAnimationWindow MyAnimation;
L_TCHAR L_FAR * pszFiles[] =
{TEXT("image1.cmp"),
TEXT("image2.cmp"),
TEXT("image3.cmp")};
MyBitmapList.Create();

for (int i = 0 ; i<3; i++)
{
nRetCode = Bitmap.Load(pszFiles[i]);
if (nRetCode !=SUCCESS)
{
MessageBox(hWndParent,
 TEXT("Failed to load file"),TEXT("Error!"),MB_OK |
 MB_ICONSTOP);
return;
}
MyBitmapList.InsertItem(&Bitmap);
}
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,800,600);
MyAnimation.SetBitmapList(&MyBitmapList);
MyAnimation.SetDelay(1000);
MyAnimation.SetDisposalMethod(DISPOSAL_RESTOREBACKGROUND);
MyAnimation.SetBackgroundColor(RGB(255,255,255));
MyAnimation.PlayAnimation();
while (MyAnimation.IsPlaying())
{
if (MyAnimation.DoEvents())
break;
}
MessageBox(hWndParent, TEXT("Press Ok to
 terminate"),TEXT("Error!"),MB_OK | MB_ICONSTOP);
}


LAnimationWindow::SetDelay

#include "ltwrappr.h"

L_INT LAnimationWindow::SetDelay(nDelay, nIndex=ANIM_ALL_ITEMS)

L_INT nDelay; | /* delay in milliseconds */
L_UINT nIndex; | /* position of th ebitmap list item */

Sets the animation playback delay for the bitmap list item.

Parameter | Description
nDelay | Delay in milliseconds (ms) for the bitmap.
nIndex | Position of bitmap list item. Possible values are:
 | Value | Meaning
 | ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list
 | >=0 | Set the delay only for the specified item

Returns

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

Comments

This function sets the animation playback delay in milliseconds (ms) for the bitmap item at position nIndex inside the bitmaplist. If you want to set the same delay for all items, set nIndex = ANIM_ALL_ITEMS.

Positioning within the list is zero-based.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::GetDelay, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

For an example, refer to LAnimationWindow::GetDelay.


LAnimationWindow::SetDisposalMethod

#include "ltwrappr.h"

L_INT LAnimationWindow::SetDisposalMethod(nDisposalMethod, nIndex=ANIM_ALL_ITEMS)

L_INT nDisposalMethod; | /* animation playback disposal method */
L_UINT nIndex; | /* position of the bitmap list item */

Gets the disposal method for the bitmap item at position nIndex inside the bitmap list.

Parameter | Description
nDisposalMethod | Animation playback disposal method. For possible values, refer to Animation Disposal Methods.
nIndex | Position of bitmap list item. Possible values are:
 | Value | Meaning
 | ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list
 | >=0 | Set the delay only for the specified item

Returns

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

Comments

If nIndex = ANIM_ALL_ITEMS, then all bitmap list items will be affected by the new nDisposalMethod.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::GetDisposalMethod, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

For an example, refer to LAnimationWindow::GetDisposalMethod.


LAnimationWindow::SetPosition

#include "ltwrappr.h"

L_INT LAnimationWindow::SetPosition(nLeft, nTop, nIndex=ANIM_ALL_ITEMS)

L_INT nLeft; | /* x coordinate for the bitmap list item */
L_INT nTop; | /* y coordinate for the bitmap list item */
L_UINT nIndex; | /* position of the bitmap list item */

Sets the left and top positions for the bitmap item at position nIndex inside the bitmaplist.

Parameter | Description
nLeft | X coordinate for the origin of the bitmap list item.
nTop | Y coordinate for the origin of the bitmap list item.
nIndex | Position of bitmap list item. Possible values are:
 | Value | Meaning
 | ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list
 | >=0 | Set the delay only for the specified item

Returns

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

Comments

If nIndex = ANIM_ALL_ITEMS, then all bitmap list items will be affected by the new position.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::GetPosition, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

/*
This example iterates through all bitmap items, gets the current position
for each bitmap using GetPosition method, displays it, sets the new
position using SetPosition so that the images will be shifted diagonally.
*/

#include "ltwrappr.h" //Required by all classes
#include "ltlck.h" //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT(); //Unlock GIF support
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
L_INT nLeft, nTop;

MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//change the bitmaps positions
 ...
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];

//get current
 position for each bitmap
MyAnimation.GetPosition(&nLeft, &nTop,
 i);
wsprintf(szStr,TEXT("GetPosition[%d]
 : Left = %d and Top = %d"),i, nLeft, nTop);
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
nLeft +=i;
nTop +=i;
//update current
 position
MyAnimation.SetPosition(nLeft, nTop, i);
wsprintf(szStr,TEXT("SetPosition[%d]
 : Left = %d and Top = %d"),i, nLeft, nTop);
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnimationWindow::StartChanging

#include "ltwrappr.h"

virtual L_INT LAnimationWindow::StartChanging(nChangeType, nChangeCategory)

L_UINT nChangeType; | /* type of change */
L_UINT nChangeCategory; | /* the change category */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change to be done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

Returns

SUCCESS | Continue the operation without interrupting it.
< 1 | An error occurred. Refer to Return Codes. This will halt the operation and stop it.

Comments

This function is called by every function that affects the bitmap. You can override this function to have control over the different operations that are done to the bitmap. This function is called before doing any changes to the bitmap. If you want to cancel the operation, you can return an error code that is less than SUCCESS. If you return SUCCESS, the operation will continue executing. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing before starting the changing operation.

If you override this function you must do one of the following:

1 | To stop an operation, return an error code (anything other than SUCCESS). In this case the operation will stop and the parent class will not have a chance to do any default processing for the operation.
2 | Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

class MyBitmap: public LAnimationWindow
{
protected:
L_BOOL m_bChanged;
virtual L_INT StartChanging(L_UINT
 nChangeType,L_UINT nChangeCategory);
virtual L_VOID EndChanging(L_UINT
 nChangeType,L_UINT nChangeCategory,L_INT nRetCode);
};

L_INT MyBitmap::StartChanging(L_UINT nChangeType,L_UINT nChangeCategory)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
/*the image
 is to be flipped*/
break;
/*
case ….:
do other things
*/
}

return(LAnimationWindow::StartChanging(nChangeType,nChangeCategory));
}

L_VOID MyBitmap::EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT
 nRetCode)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
if(nRetCode==SUCCESS)
m_bChanged=TRUE;
break;
/*
case ….:
do other things
*/
}

LAnimationWindow::EndChanging(nChangeType,nChangeCategory,nRetCode);
}


LAnimationWindow::StopAnimation

#include "ltwrappr.h"

L_VOID LAnimationWindow::StopAnimation(L_VOID)

Stops animation playback.

Returns

None

Comments

If no animation is started, the function will simply return.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::PlayAnimation, LAnimationWindow::IsPlaying, LAnimationWindow::Load, LAnimationWindow::SetBitmapList, LAnimationWindow::AnimateEvent, Class Members

Example

For an example, refer to LAnimationWindow::PlayAnimation.


LAnimationWindow::WaitForUserInput

#include "ltwrappr.h"

L_INT LAnimationWindow::WaitForUserInput(bWait=TRUE, nIndex=ANIM_ALL_ITEMS)

L_BOOL bWait; | /* flag that indicates whether playback waits for user input */
L_UINT nIndex; | /* position of the bitmap list item */

Controls whether the animation playback waits for user input.

Parameter | Description
bWait | Flag that indicates whether playback waits for user input.
nIndex | Position of bitmap list item. Possible values are:
 | Value | Meaning
 | ANIM_ALL_ITEMS | [-1] Set the delay for all items in the bitmap list
 | >=0 | Set the delay only for the specified item

Returns

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

Comments

Pass ANIM_ALL_ITEMS for nIndex to set this flag for all bitmap list items.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnimationWindow::LAnimationWindow, LAnimationWindow::IsWaitingForUserInput, LAnimationWindow::Load, LAnimationWindow::PlayAnimation, Class Members

Example

/*
The follwing example will make even numbered bitmap items in the
animation wait for user input, and then reads the new state for each
item in the bitmap list.
*/

#include <ltlck.h> //Unlock support

L_VOID TestFunction(HWND hWndParent)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);
 //make sure all libraries are loaded
LAnimationWindow MyAnimation;

WRPUNLOCKSUPPORT();
MyAnimation.SetFileName(TEXT("eye.gif"));

if (MyAnimation.Load()==SUCCESS)
{
MyAnimation.CreateWnd(hWndParent,0,
 WS_VISIBLE|WS_CHILD|WS_BORDER,0,0,300,300);
//let the even items wait for
 user input
for (L_UINT i=0; i<MyAnimation.GetCount(); i++)
{
if (i%2)
MyAnimation.WaitForUserInput(FALSE,i);
else
MyAnimation.WaitForUserInput(TRUE,i);
}

for (i=0; i<MyAnimation.GetCount(); i++)
{
L_TCHAR szStr[255];

//get current
 wait state
wsprintf(szStr,TEXT("Bitmap[%d]
 Wait For User Input?: %s"),i, (MyAnimation.IsWaitingForUserInput(i)?TEXT("YES"):TEXT("NO")));
MessageBox(hWndParent,
 szStr,TEXT("Example"), MB_OK | MB_ICONINFORMATION);
}
}
}


LAnnAudioClip::LAnnAudioClip

#include "ltwrappr.h"

L_VOID LAnnAudioClip::LAnnAudioClip(hAudioClip)

L_VOID LAnnAudioClip::LAnnAudioClip(bCreate=TRUE)

HANNOBJECT & hAudioClip; | /* handle of the associated annotation object */
L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */

Constructs and initializes the member variables of the LAnnAudioClip object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAudioClip | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnAudioClip::LAnnAudioClip(bCreate) is a constructor for the LAnnAudioClip class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnAudioClip::LAnnAudioClip(hAudioClip) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_AUDIO. The passed annotation object is invalidated.

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:

LAnnAudioClip::~LAnnAudioClip, Class Members

Example

This is an example for LAnnAudioClip::LAnnAudioClip(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor
 when it is out of scope
LAnnAudioClip LeadAudioClip(TRUE) ;

//...
}

This is an example for LAnnAudioClip::LAnnAudioClip(hAudioClip)

L_VOID TestConstructor (HANNOBJECT& hAudioClip)
{
// this will call the constructor and destructor
 when it is out of scope
LAnnAudioClip LeadAudioClip(hAudioClip) ;

//...
}


LAnnAudioClip::~LAnnAudioClip

#include "ltwrappr.h"

virtual L_VOID LAnnAudioClip::~LAnnAudioClip(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnAudioClip class.

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:

Class Members

Example

For an example, refer to LAnnAudioClip::LAnnAudioClip.


LAnnAudioClip::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

// This example adds user handles to the center of the top
 and bottom of an AudioClip object
L_VOID ExampleAnnAddUserHandle(LAnnAudioClip *pLAudioClip)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLAudioClip->GetType();
if (uType == ANNOBJECT_AUDIO)
{
pLAudioClip->GetRect
 (&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;
pLAudioClip->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left
 + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLAudioClip->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation
 object must be an AudioClip object."), TEXT("Error"), MB_OK);
}


LAnnAudioClip::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::ChangeUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of the user handle to change. This index is zero-based.
pAnnHandle | Pointer to an ANNHANDLE 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 AudioClip annotation handle.

This function is used in conjunction with the LAnnAudioClip::AddUserHandle and LAnnAudioClip::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnAudioClip *LAudioClip)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total
 count of user handles
LAudioClip->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
{
memset(&AnnHandle,
 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize
 = sizeof(&AnnHandle);
LAudioClip->GetUserHandle(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;
LAudioClip->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnAudioClip::Create

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::Create(L_VOID)

Creates an AudioClip annotation object. 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 use the LAnnAudioClip::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnAudioClip LeadAudioClip(FALSE); //construct an audio clip object

if (LeadAudioClip.Create()==SUCCESS)
{
//... do something here
}
}


LAnnAudioClip::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::DeleteUserHandle(nIndex)

L_INT32 nIndex;

/* index of the user handle to delete */

Deletes an existing user-defined AudioClip annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 AudioClip annotation object.

Set uIndex to -1 to delete all the user-defined handles for an AudioClip 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnAudioClip *LAudioClip)
{
L_UINT uCount;

// Get the total
 count of user handles
LAudioClip->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
LAudioClip->DeleteUserHandle(0);
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnAudioClip::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::EnumerateHandles()

Calls the LAnnAudioClip::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 AudioClip annotation object.

Note that this function returns information about both default annotation handles and user-defined AudioClip annotation handles.

This function can also be used to change some of the properties of an AudioClip annotation handle.

For more information, refer to the LAnnAudioClip::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnAudioClip: public LAnnAudioClip
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT
 hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnAudioClip::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO
 pHandleInfo)
{
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(MyAnnAudioClip *LAudioClip)
{
LAudioClip->EnableCallBack(TRUE);
LAudioClip->EnumerateHandles();
}


LAnnAudioClip::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnAudioClip::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to an ANNHANDLEINFO structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnAudioClip::EnumerateHandles 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 LAnnAudioClip::ChangeUserHandle.

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.

To enable the LAnnAudioClip::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnAudioClip::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAudioClip::EnumerateHandles.


LAnnAudioClip::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetFixed(pbFixed)

L_BOOL *pbFixed;

/* address of a variable to be updated */

Gets a value that indicates whether the AudioClip annotation object is fixed. This function is available in the Document/Medical Toolkits.

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAudioClip::SetFixed.


LAnnAudioClip::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetRotateAngle(pdAngle)

L_DOUBLE *pdAngle;

/* pointer to a double that returns the rotate angle */

Gets the rotation angle for an AudioClip annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 an AudioClip 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the annotation
 AudioClip object in radians and
 degrees
L_VOID ExampleAnnGetRotateAngle(LAnnAudioClip * pLAudioClip)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLAudioClip->GetRotateAngle(&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);
}
}


LAnnAudioClip::GetText

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnAudioClip L_FAR * pAnnObject)
{
L_TCHAR L_FAR *pText; /* The object's text */
L_UINT TextLength; /* Length of the object's text
 */
LBuffer LeadBuffer
 ;

/* Get the length of the current text */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new
 text */
TextLength += 6;

LeadBuffer.Reallocate((DWORD)TextLength*sizeof(L_TCHAR));

pText = (L_TCHAR L_FAR *)LeadBuffer.Lock()
 ;

/* Get the current text */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current
 text */
lstrcat(pText,TEXT(" - New"));

pAnnObject->SetText(pText,
 0);

LeadBuffer.Unlock()
 ;
}


LAnnAudioClip::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnAudioClip::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object'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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAudioClip::GetText.


LAnnAudioClip::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnAudioClip *LAudioClip)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total
 count of user handles
LAudioClip->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
{
memset(&AnnHandle,
 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize
 = sizeof(&AnnHandle);
LAudioClip->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0,
 &AnnHandle);
}
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnAudioClip::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnAudioClip * LAudioClip)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate
 memory
LAudioClip->GetUserHandles(NULL,
 &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LAudioClip->GetUserHandles(pAnnHandle,
 &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnAudioClip::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
L_UINT uFlags; | /* flags that determine which objects to process */

Indicates whether there are any fixed AudioClip annotations in the client rectangle prc. This function is available in the Document/Medical Toolkits.

Parameter | Description
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

Comments

This function is used primarily as an aid in scrolling AudioClip annotations without using double buffering. For more information on double buffering, see the documentation for:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnAudioClip::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example displays a message box telling if there are
 any fixed AudioClip annotations
// visible in the client area of hWnd. This is useful for handling scrolling
 and zooming
// of fixed AudioClip annotations without double-buffering.
// hWnd -- window displaying annotations
// pLAudioClip -- Pointer to LAnnAudioClip annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnAudioClip *pLAudioClip)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLAudioClip->IsFixedInRect(&rcClient,
 ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed
 AudioClip annotations visible.") : TEXT("There are NO fixed
 AudioClip annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnAudioClip::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::PopFixedState(uFlags)

L_UINT uFlags;

/* flags that determine which objects to process */

Re-enables the ‘fixed’ state of an AudioClip annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 AudioClip annotations. It is to be called after the ‘fixed’ state as been temporarily disabled by a call to LAnnAudioClip::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnAudioClip::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnAudioClip::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnAudioClip::PushFixedState / LAnnAudioClip::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnAudioClip::PushFixedState and LAnnAudioClip::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnAudioClip::PushFixedState (); | Fixed state is temporarily disabled
LAnnAudioClip::PushFixedState (); | Fixed state is temporarily disabled
LAnnAudioClip::PopFixedState (); | Fixed state is still disabled
LAnnAudioClip::PopFixedState (); | Fixed state is enabled

Note that LAnnAudioClip::PushFixedState and LAnnAudioClip::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the "fixed" property of
 all objects in the container that
// have been temporarily disabled with a call to LAnnAudioClip::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnAudioClip *pLAudioClip)
{
pLAudioClip->PopFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnAudioClip::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::PushFixedState(uFlags)

L_UINT uFlags;

/* flags that determine which objects to process */

Temporarily disables the ‘fixed’ state of an AudioClip annotation. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 AudioClip 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnAudioClip::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnAudioClip::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnAudioClip::PushFixedState / LAnnAudioClip::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnAudioClip::PushFixedState and LAnnAudioClip::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnAudioClip::PushFixedState (); | Fixed state is temporarily disabled
LAnnAudioClip::PushFixedState (); | Fixed state is temporarily disabled
LAnnAudioClip::PopFixedState (); | Fixed state is still disabled
LAnnAudioClip::PopFixedState (); | Fixed state is enabled

Note that LAnnAudioClip::PushFixedState and LAnnAudioClip::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed"
 property of all objects in the container
// This is useful when fixed objects need to be temporarily painted larger
 or smaller than
// the fixed size. For an example using the magnifying glass, see the source
 code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnAudioClip *pLAudioClip)
{
pLAudioClip->PushFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnAudioClip::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::SetFixed(bFixed, bAdjust, uFlags)

L_BOOL bFixed; | /* value that specifies whether the AudioClip 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 AudioClip annotation object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFixed | Value that specifies whether the AudioClip 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example toggles the "fixed" property of
 an AudioClip annotation object
// If an object is fixed, it does not move when the underlying image
// is scrolled or zoomed
L_VOID SampleAnnFixed(LAnnAudioClip *pLAudioClip)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLAudioClip->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLAudioClip->SetFixed(bFixed,
 TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed")
 : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""),
 MB_OK);
}
else
{
wsprintf(szMsg, TEXT("LAnnAudioClip::GetFixed
 failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"),
 MB_OK);
}
}


LAnnAudioClip::SetText

#include "ltwrappr.h"

virtual L_INT LAnnAudioClip::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* character string to assign */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | The character string to assign to the annotation object.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

For the AudioClip annotation object, the text property is the filename of the .WAV file to play.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAudioClip::GetText.


LAnnAutomation::LAnnAutomation

#include "ltwrappr.h"

L_VOID LAnnAutomation::LAnnAutomation(bCreate=TRUE)

L_VOID LAnnAutomation::LAnnAutomation(hAutomation)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT& hAutomation; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnAutomation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hAutomation | Handle of the associated annotation object

Returns

None

Comments

LAnnAutomation::LAnnAutomation(bCreate) is a constructor for the LAnnAutomation class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnAutomation::LAnnAutomation(hAutomation) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_AUTOMATION. The passed annotation object is invalidated.

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:

LAnnAutomation::~LAnnAutomation, Class Members

Example

This is an example for LAnnAutomation::LAnnAutomation(bCreate):

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure
 all libraries are loaded

LAnnAutomation MyAutomation;
 //construct an automation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for LAnnAutomation::LAnnAutomation(hAutomation)

L_VOID TestFunction(HANNOBJECT& hAutomationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make
 sure all libraries are loaded

LAnnAutomation MyAutomation(hAutomationObject);
 //construct an automation object

//.... do something here ....
}


LAnnAutomation::~LAnnAutomation

#include "ltwrappr.h"

virtual L_VOID LAnnAutomation::~LAnnAutomation(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnAutomation class.

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:

LAnnAutomation::LAnnAutomation, Class Members

Example

For an example, refer to LAnnAutomation::LAnnAutomation.


LAnnAutomation::AddUndoNode

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::AddUndoNode()

Manually adds an undo node to the automation object. This function is available in the Document/Medical Toolkits.

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 LAnnAutomation::Undo.

The number of actions that can be undone should be set with LAnnAutomation::SetUndoDepth before calling this function.

Calling LAnnAutomation::SetAutoUndoEnable(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 LAnnAutomation::SetAutoUndoEnable(TRUE).

ERROR_NO_UNDO_STACK will be returned if LAnnAutomation::SetUndoDepth has not been called before this function or if LAnnAutomation::SetUndoDepth has been called with uUndoLevels set to 0.

ERROR_UNDO_DISABLED will be returned if the undo has been disabled by calling LAnnAutomation::SetAutoUndoEnable(hObject, FALSE).

Basically, the process is as follows:

1. | Call LAnnAutomation::SetUndoDepth to set the number of undo actions that can take place.
2. | Call LAnnAutomation::AddUndoNode to add an undo node to the automation object.
3. | Disable the undo feature by calling LAnnAutomation::SetAutoUndoEnable (FALSE).
4. | Perform the operations to be combined into one undo.
5. | Re-enable the undo feature by calling LAnnAutomation::SetAutoUndoEnable (TRUE).

Now, all three operations can be undone with one call to LAnnAutomation::Undo instead of three calls to LAnnAutomation::Undo.

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: | LAnnAutomation::SetAutoUndoEnable, LAnnAutomation::GetAutoUndoEnable, LAnnAutomation::GetUndoDepth, LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo, Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnotation::SetAutoDefaults.


LAnnAutomation::ClearTextTokenTable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::ClearTextTokenTable()

Removes all tokens from the text token table. This function is available in the Document/Medical Toolkits.

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:

LAnnAutomation

LAnnButton

LAnnNote

LAnnPushPin

LAnnStamp

LAnnText

LAnnTextPointer

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example removes all of the tokens from the current text token table

L_VOID SampleAnnClearTextTokenTable(LAnnAutomation *pLAutomation)
{
pLAutomation->ClearTextTokenTable();
}


LAnnAutomation::Create

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::Create(L_VOID)

Creates an Automation annotation object. 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 should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT or during the LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | LAnnotation::CreateAnnObject, LAnnPolyline::Define, LAnnPolygon::Define, LAnnFreehand::Define, LAnnContainer::Insert, LAnnotation::Remove, LAnnotation::Destroy, Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnAutomation MyAutomation(FALSE); //construct an automation object

if (MyAutomation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnAutomation::DeleteTextTokenTable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::DeleteTextTokenTable(cToken)

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

LAnnAutomation

LAnnButton

LAnnNote

LAnnPushPin

LAnnStamp

LAnnText

LAnnTextPointer

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnAutomation *pLAutomation)
{
pLAutomation->DeleteTextTokenTable('Y');
}


LAnnAutomation::EnumerateTextTokenTable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::EnumerateTextTokenTable()

Lets you examine the contents of the annotation text token table. This function is available in the Document/Medical Toolkits.

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:

LAnnAutomation

LAnnButton

LAnnNote

LAnnPushPin

LAnnStamp

LAnnText

LAnnTextPointer

The LAnnAutomation::EnumTextTokenTableCallBack 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:

LAnnAutomation::InsertTextTokenTable

LAnnAutomation::DeleteTextTokenTable

LAnnAutomation::ClearTextTokenTable

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This sample enumerates all of the tokens in the text token
 table,
// and displays the result
class MyAnnAutomation: public LAnnAutomation
{
public:
virtual L_INT EnumTextTokenTableCallBack(L_INT
 nTextTokenCount, L_INT nIndex, pANNTEXTTOKEN pTextToken);
L_TCHAR m_szMsg[1000];
};

L_INT MyAnnAutomation::EnumTextTokenTableCallBack(L_INT nTextTokenCount,
 L_INT nIndex, pANNTEXTTOKEN pTextToken)
{
L_TCHAR szTemp[100];
L_TCHAR *pszType;

if (nIndex == 0)
wsprintf(m_szMsg, 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);

return SUCCESS;
}

L_VOID SampleAnnEnumeratTextTokenTable(MyAnnAutomation *pLAutomation)
{
lstrcpy(pLAutomation->m_szMsg, TEXT(""));
pLAutomation->EnableCallBack(TRUE);
pLAutomation->EnumerateTextTokenTable();
MessageBox(NULL, pLAutomation->m_szMsg, TEXT("Text
 Token Table"), MB_OK);
}


LAnnAutomation::EnumTextTokenTableCallBack

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::EnumTextTokenTableCallBack(nTextTokenCount, nIndex, pTextToken)

L_INT nTextTokenCount; | /* total number of tokens in the text token table */
L_INT nIndex; | /* index of the text token */
pANNTEXTTOKEN pTextToken; | /* pointer to a structure that defines the text token */

Processes each text token in the annotation text token table from the LAnnAutomation::EnumerateTextTokenTable function. This function is called zero or more times as a result of a call to LAnnAutomation::EnumerateTextTokenTable. This function is available in the Document/Medical Toolkits.

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 pointer to an ANNTEXTTOKENstructure that defines the the text token. For more information, see the documentation for the ANNTEXTTOKEN structure.

Returns

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

Comments

The LAnnAutomation::EnumerateTextTokenTable function calls the LAnnAutomation::EnumTextTokenTableCallBack 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 LAnnAutomation::EnumerateTextTokenTable() will call your overridden call back LAnnAutomation::EnumTextTokenTableCallBack 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.

To enable this call back function you must call LBase::EnableCallBack before calling LAnnAutomation::EnumerateTextTokenTable 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAutomation::EnumerateTextTokenTable.


LAnnAutomation::GetAutoContainer

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoContainer(pLContainer)

virtual L_INT LAnnAutomation::GetAutoContainer(phContainer)

LAnnContainer L_FAR * pLContainer; | /* pointer to an LAnnContainer object to be updated */
pHANNOBJECT phContainer; | /* pointer to an HANNOBJECT 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
pLContainer | Pointer to an LAnnContainer object 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.
phContainer | Pointer to 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 LAnnAutomation::GetAutoContainer(phContainer), 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.

Before calling LAnnAutomation::GetAutoContainer(pLContainer), you must declare a class object of type LAnnContainer. Then, pass the address of the object in the pLContainer 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.

See Also

Functions: | LAnnAutomation::SetAutoContainer, LAnnAutomation::SetDpiX, LAnnAutomation::SetDpiY, LAnnAutomation::GetDpiX, LAnnAutomation::GetDpiY, LAnnAutomation::SetTool, LAnnAutomation::GetTool, LAnnotation::GetUserMode, LAnnContainer::SetUserMode, LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

This is an example for LAnnAutomation::GetAutoContainer(phContainer):

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make
 sure all libraries are loaded

LAnnAutomation MyAutomation;
 //construct an automation object
HANNOBJECT hAnnContainer;

if (MyAutomation.GetAutoContainer(&hAnnContainer)==SUCCESS)
{
//…. do something here ….
}
}

This is an example for LAnnAutomation::GetAutoContainer(pLContainer):

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make
 sure all libraries are loaded

LAnnAutomation MyAutomation;
 //construct an automation object
LAnnContainer MyContainer;

if (MyAutomation.GetAutoContainer(&MyContainer)==SUCCESS)
{
//…. do something here ….
}
}


LAnnAutomation::GetAutoCursor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoCursor(uItem, phCursor)

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
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.
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 LAnnAutomation::SetAutoCursor.

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: | Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | New Annotation Features of Version 14.5

Example

// This sample swaps the Default and Move annotation cursors

L_VOID SampleAnnGetCursors(LAnnAutomation *plAutomation)
{
HCURSOR hCursorMove, hCursorDefault;

// Get copy of original cursors
plAutomation->GetAutoCursor(ANNAUTOCURSOR_DEFAULT,
 &hCursorDefault);
plAutomation->GetAutoCursor(ANNAUTOCURSOR_MOVE,
 &hCursorMove);

// Change
plAutomation->SetAutoCursor(ANNAUTOCURSOR_DEFAULT,
 hCursorMove);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_MOVE,
 hCursorDefault);

// Cleanup
DestroyCursor(hCursorMove);
DestroyCursor(hCursorDefault);
}


LAnnAutomation::GetAutoDialogFontSize

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoDialogFontSize(pnFontSize)

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
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 LAnnAutomation::SetAutoDialogFontSize 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.

See Also

Functions: | LAnnAutomation::SetAutoDialogFontSize, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | Converting Automation Dialogs to Other Languages

Example

For an example, refer to LAnnAutomation::SetAutoDialogFontSize.


LAnnAutomation::GetAutoOptions

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoOptions(puFlags)

L_UINT L_FAR * puFlags;

/* address of a variable to be updated */

Retrieves the last value set by LAnnAutomation::SetAutoOptions. This function is available in the Document/Medical Toolkits.

Parameter | Description
puFlags | Address of a variable to be updated with the flag values set by LAnnAutomation::SetAutoOptions. 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.

See Also

Functions: | LAnnAutomation::SetAutoOptions, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::SetAutoOptions.


LAnnAutomation::GetAutoText

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoText(uItem, pText)

L_UINT uItem; | /* constant that specifies the menu or dialog box item */
L_TCHAR L_FAR * pText; | /* item’s character string */

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
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
pText | Character string 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 LAnnAutomation::GetAutoTextLen to get the length of the text you want to retrieve.

Use LAnnAutomation::SetAutoText 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.

See Also

Functions: | LAnnAutomation::GetAutoTextLen, LAnnAutomation::SetAutoText, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation

Example

/* This example adds " - New" to the current "&Undo"
 menu item. */
void ChangeMenuText(LAnnAutomation L_FAR * pAnnAutomation)
{
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 */
TextLength = pAnnAutomation->GetAutoTextLen(ANNAUTOTEXT_MENU_UNDO);

/* Add six characters to the length for our new text
 */
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 */
pAnnAutomation->GetAutoText(ANNAUTOTEXT_MENU_UNDO,
 pText);

/* Add " - New" to the end of the current text
 */
lstrcat(pText,TEXT(" - New"));

pAnnAutomation->SetAutoText(ANNAUTOTEXT_MENU_UNDO,
 pText);

/* Free memory that we no longer need */
GlobalFree(hText);

}


LAnnAutomation::GetAutoTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetAutoTextLen(uItem)

L_UINT uItem;

/* constant for the specified item*/

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

Returns

The length of the item's current 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.

See Also

Functions: | LAnnAutomation::GetAutoText, LAnnAutomation::SetAutoText, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation

Example

For an example, refer to LAnnAutomation::GetAutoText.


LAnnAutomation::GetAutoUndoEnable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetAutoUndoEnable(pbEnable)

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
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. Possible values are:
 | Value | Meaning
 | TRUE | The undo mechanism for this annotation object is enabled.
 | FALSE | Theundo mechanism for this annotation object is 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 LAnnAutomation::SetAutoUndoEnable.

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: | LAnnAutomation::AddUndoNode, LAnnAutomation::SetAutoUndoEnable, LAnnAutomation::GetUndoDepth, LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

void TestFunction()
{
LAnnAutomation lAutomation;
L_BOOL IsEnabled = FALSE;
lAutomation.GetAutoUndoEnable(&IsEnabled);
if(!IsEnabled)
lAutomation.SetAutoUndoEnable(TRUE);
}


LAnnAutomation::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnAutomation::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | LAnnAutomation::SetForeColor, LAnnAutomation::SetBackColor, LAnnAutomation::GetForeColor, Class Members, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnAutomation::GetBitmapDpiX

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetBitmapDpiX(L_VOID)

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.

Returns

The current horizontal Bitmap DPI value.

Comments

The Bitmap DPI properties apply only to Automation and Ruler objects. 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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiY, LAnnAutomation::SetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetBitmapDpiX.


LAnnAutomation::GetBitmapDpiY

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetBitmapDpiY(L_VOID)

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.

Returns

The current vertical Bitmap DPI value.

Comments

The Bitmap DPI properties apply only to Automation and Ruler objects. 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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiY, LAnnAutomation::SetBitmapDpiX, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetBitmapDpiX.


LAnnAutomation::GetDistance

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetDistance(pdDistance, pdDistance2=0)

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(s) in the object's unit of measurement, set by LAnnAutomation::SetUnit. This function is available in the Document/Medical Toolkits.

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

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

/* get the current measurement unit settings and display
 them */
/* if unit is not inches, make it so */

L_VOID ModifyAnnUnit(LAnnAutomation L_FAR * pAnnObject)
{
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;

/* first, get unit abbreviation string len */
uLen = pAnnObject->GetUnitLen();

/* 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 */
uUnit = pAnnObject->GetUnit(pUnitAbbrev,
 &uPrecision);

/* and, get the distance */
pAnnObject->GetDistance(&dDistance);

/* display current settings & distance in current
 unit of measurement */
wsprintf(buf, TEXT("Unit: %d\nAbbrev: %s\nPrecision:
 %d\n"),
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)
pAnnObject->SetUnit(ANNUNIT_INCHES,
 TEXT("in"), 2, 0);

GlobalUnlock(hUnitAbbrev);
GlobalFree(hUnitAbbrev);
}


LAnnAutomation::GetDpiX

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetDpiX(L_VOID)

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.

Returns

The current DPI 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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetDpiX, LAnnAutomation::SetDpiY, LAnnAutomation::GetDpiY, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

/* This function gets the current dots per inch of the automation object */

void GetAutomationDPI(LAnnAutomation L_FAR * pAnnAutomation, HWND hWnd)
{
L_DOUBLE DPIx, DPIy; /* Dots per inch, horizontal and vertical */
L_TCHAR szMessage[80]; /* Message buffer */

/* Get the dots per inch */
DPIx = pAnnAutomation->GetDpiX();
DPIy = pAnnAutomation->GetDpiY();

/* Display a message box with the result */
wsprintf (szMessage, TEXT("%d horizontal, %d vertical"), (int)DPIx, (int)DPIy);
MessageBox (hWnd, szMessage, TEXT("Notice"), MB_OK);
}


LAnnAutomation::GetDpiY

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetDpiY(L_VOID)

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.

Returns

The current DPI 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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetDpiX, LAnnAutomation::SetDpiY, LAnnAutomation::GetDpiX, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::GetDpiX.


LAnnAutomation::GetEncryptOptions

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetEncryptOptions(pEncryptOptions)

pANNENCRYPTOPTIONS pEncryptOptions;

/* pointer to a structure to be updated */

Gets the Encrypt options for the specified Automation annotation object. This annotation object may be in the encryptor or decryptor state. This function is available in the Document/Medical Toolkits.

Parameter | Description
pEncryptOptions | Pointer to an ANNENCRYPTOPTIONS structure to be updated with the encryption options for this automation 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 Automation object. To use this function, declare a variable a type ANNENCRYPTOPTIONS, and pass the address of this variable in pEncryptOptions.

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: | LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnAutomation::SetEncryptOptions.


LAnnAutomation::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

Value | Meaning
ANNMODE_TRANSPARENT | [0] Transparent
ANNMODE_TRANSLUCENT | [1] Translucent
ANNMODE_OPAQUE | [2] Opaque

Comments

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.

See Also

Functions: | LAnnAutomation::SetFillMode, LAnnAutomation::GetFillPattern, LAnnAutomation::SetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_UINT FillMode;
 /* Object fill mode */
/* Set the fill
 mode to transparent, unless it already is */

FillMode = pAnnObject->GetFillMode();
if (FillMode
 == ANNMODE_TRANSPARENT)
MessageBox
 (NULL, TEXT("Already transparent"), TEXT("Notice"),
 MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT,
 0);
}


LAnnAutomation::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible 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

Comments

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.

See Also

Functions: | LAnnAutomation::GetFillMode, LAnnAutomation::SetFillMode, LAnnAutomation::SetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */
/* Set the fill pattern to solid, unless it already is
 */
FillPattern = pAnnObject->GetFillPattern();
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already
 solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID,
 0);
}


LAnnAutomation::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAutomation::SetFixed.


LAnnAutomation::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* character string to be updated */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | 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

pFontName must be large enough to hold the returned 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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
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 */
NameLength = pAnnObject->GetFontNameLen();

/* 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 */
pAnnObject->GetFontName(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
pAnnObject->SetFontName(TEXT("Times New Roman"), 0);

/* Free memory that we no longer need */
GlobalFree(hFontname);
}


LAnnAutomation::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetFontNameLen(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the length of the character string that holds the name of the font used by the annotation object. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetFontName.


LAnnAutomation::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetFontSize(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current unscaled value of the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the annotation object.

Comments

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_DOUBLE FontSize;
 /* Object font size */
/* Double the
 font size */
FontSize = pAnnObject->GetFontSize();
pAnnObject->SetFontSize(FontSize * 2, 0);
}


LAnnAutomation::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnAutomation::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current foreground color.

Comments

To see how the foreground color relates to the fill modes, 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.

See Also

Functions: | LAnnAutomation::SetForeColor, LAnnAutomation::SetBackColor, LAnnAutomation::GetBackColor, Class Members, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnAutomation::GetGaugeLength

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetGaugeLength(L_VOID)

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.

Returns

The object's gauge length.

Comments

The gauge length applies only to Automation and Ruler objects. Refer to Annotation Automation Object.

Length is expressed in pixels, not in points. The length is for the whole line, not just from the end point of the ruler to the end point of the gauge - it is from one end of the gauge to the other end of the gauge.

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: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, Class Members, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

L_VOID ModifyAnnGauge(LAnnAutomation L_FAR * pAnnAutomation,
 LAnnContainer L_FAR * pAnnContainer)
{
L_DOUBLE dLength;

/* if gauge length setting for the Automation object
is larger than 5 pixels, then make it 5 pixels. */
dLength = pAnnAutomation->GetGaugeLength();
if(dLength > 5.0f)
{
pAnnAutomation->SetGaugeLength(
 5.0f, 0);
}
}


LAnnAutomation::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible 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

Comments

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.

See Also

Functions: | LAnnAutomation::SetLineStyle, LAnnAutomation::GetLineWidth, LAnnAutomation::SetLineWidth, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_UINT LineStyle;
 /* Line style property of the object */
/* Set the style
 to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle
 == ANNLINE_DASH)
MessageBox
 (NULL, TEXT("Already dashed line"), TEXT("Notice"),
 MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH, 0);
}


LAnnAutomation::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnAutomation::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width

Comments

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.

See Also

Functions: | LAnnAutomation::GetLineStyle, LAnnAutomation::SetLineStyle, LAnnAutomation::SetLineWidth, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_DOUBLE LineWidth;
 /* Object line width */
/* Double the
 line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2,
 0);
}


LAnnAutomation::GetNodes

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetNodes(pbShowNodes, puGapNodes)

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

Comments

Note:

The last node is always shown. Therefore, using a large value for puGapNodes will probably result in only the first and last nodes being shown.

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.

See Also

Functions: | LAnnAutomation::SetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnAutomation::SetNodes.


LAnnAutomation::GetPointOptions

#include "ltwrappr.h"

static L_INT LAnnAutomation::GetPointOptions(pPointOptions, uStructSize)

pANNPOINTOPTIONS pPointOptions; | /* pointer to an ANNPOINTOPTIONS structure that specifies various point options */
L_UINT uStructSize; | /* Size in bytes, of the structure pointed to by pPointOptions, for versioning. Use sizeof(ANNPOINTOPTIONS). */

Gets the options for the specified Automation annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 automation 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.

See Also

Functions: | LAnnPoint::GetPredefinedBitmap , LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

// This example toggles the appearance of a point annotation object

// The appearance toggles between bitmap and circle

L_VOID SampleAnnSetPointOptions(LAnnAutomation *pLAutomation)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;
ANNPOINTOPTIONS PointOptions;
L_UINT uObjectType;

uObjectType = pLAutomation->GetType();
if (uObjectType != ANNOBJECT_AUTOMATION)
{
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;
pLAutomation->GetPointOptions(&PointOptions,
 sizeof(PointOptions));

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;
}
pLAutomation->SetPointOptions(&PointOptions,
 0);
}


LAnnAutomation::GetPolyFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetPolyFillMode(L_VOID)

Determines how a Polygon annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Returns

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.

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: | LAnnAutomation::GetFillMode, LAnnAutomation::SetFillMode, LAnnAutomation::GetFillPattern, LAnnAutomation::SetFillPattern, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_UINT PolyFillMode; /* Object's polygonal fill mode
 */
/* Change the fill mode */
PolyFillMode = pAnnObject->GetPolyFillMode();
if (PolyFillMode == ANNPOLYFILL_WINDING)
pAnnObject->SetPolyFillMode(ANNPOLYFILL_ALTERNATE,
 0);
else
pAnnObject->SetPolyFillMode(ANNPOLYFILL_WINDING,
 0);
}


LAnnAutomation::GetShowFlags

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetShowFlags(puShowFlags)

L_UINT L_FAR * puShowFlags;

/* address of the variable to be updated */

Gets a value that indicates how the Ruler, PolyRuler, Cross-Product, and Protractor objects created by the automation object will be displayed.This function is available in the Document/Medical Toolkits.

Parameter | Description
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

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.

See Also

Functions: | LAnnAutomation::SetShowFlags, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetNodes.


LAnnAutomation::GetText

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

GetText can be used to retrieve text that was set using LAnnAutomation::SetTextRTF, but no formatting information will be preserved. To retrieve the text with formatting, use LAnnAutomation::GetTextRTF.

Note:

The text of the ruler object, which can be retrieved through LAnnRuler::GetText and LAnnRuler::GetTextLen, is the length + unit abbrev. The distance is reset every time the object is changed.

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: | LAnnAutomation::SetText, LAnnAutomation::GetTextLen, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
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 */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new
 text */
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 */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current
 text */
lstrcat(pText,TEXT(" - New"));
pAnnObject->SetText(pText,
 0);

/* Free memory that we no longer need */
GlobalFree(hText);
}


LAnnAutomation::GetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTextAlign(puTextAlign)

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
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 those annotation objects (text, note, or text pointer) that display text.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// Sample for LAnnAutomation::SetTextAlign, LAnnAutomation::GetTextAlign

// This example changes the text alignment of a text, note, or text pointer annotation object

L_VOID SampleAnnSetTextAlign(LAnnAutomation *pLAutomation)
{
L_INT nRet;
L_UINT uTextAlign;
L_TCHAR szMsg[100];
L_UINT uType;

pLAutomation->GetTextAlign(&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= pLAutomation->SetTextAlign(uTextAlign, 0);
if (nRet != SUCCESS)
{
uType
 = pLAutomation->GetType();
wsprintf(szMsg,
 TEXT(" LAnnAutomation::SetTextAlign Error: %d on object type[%d]\n"),
 nRet, uType);
MessageBox(NULL,
 szMsg, TEXT("Error"), MB_OK);
}
}


LAnnAutomation::GetTextExpandTokens

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTextExpandTokens(pbTextExpandTokens)

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

LAnnAutomation

LAnnButton

LAnnNote

LAnnPushPin

LAnnStamp

LAnnText

LAnnTextPointer

If pbTextExpandTokens is updated with TRUE, then all tokens will be expanded.

For example, if you have an LAnnButton 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

//This sample toggles the 'text token expand' property of an annotation

L_VOID SampleAnnTextExpandTokens(LAnnAutomation *pLAutomation)
{
L_BOOL bTextExpandTokens;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLAutomation->GetTextExpandTokens(&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);
pLAutomation->SetTextExpandTokens(bTextExpandTokens,
 0);
}
else
{
wsprintf(szMsg,
 TEXT(" LAnnAutomation::GetTextExpandTokens Failed[%d]"), nRet);
MessageBox(NULL,
 szMsg, TEXT("Error"), MB_OK);
}
}


LAnnAutomation::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object's character string.

Comments

Use this value to allocate a buffer to read the text property.

To get the length of Rich Text formatted text, use LAnnAutomation::GetTextRTF.

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: | LAnnAutomation::SetText, LAnnAutomation::GetText, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetText.


LAnnAutomation::GetTextPointerFixed

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTextPointerFixed(pbPointerFixed)

L_BOOL *pbPointerFixed;

/* pointer to a variable to be updated */

Gets a value that indicates whether text pointer objects created using this automation object have a fixed pointer. This function is available in the Document/Medical Toolkits.

Parameter | Description
pbPointerFixed | Pointer to a variable to be updated with a value that specifies whether the text pointer objects created using this automation object have a fixed pointer. Possible values are:
 | Value | Meaning
 | TRUE | Text pointer objects created using this automation object have a fixed pointer.
 | FALSE | Text pointer objects created using this automation object have a pointer that moves with the object.

Returns

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

Comments

If pbPointerFixed is updated with TRUE, the text pointer objects created using this automation object have a fixed pointer. When the text pointer is fixed, the location that the text pointer points to does not change when moving the object (either programmatically or through automation).

If pbPointerFixed is updated with FALSE, the Text pointer objects created using this automation object have a pointer that is not fixed. This means that when the object is moved, the location the text pointer points to moves along with 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// Sample for LAnnAutomation::GetTextPointerFixed, LAnnAutomation::SetTextPointerFixed

// This example toggles the text pointer fixed state of an LAnnAutomation object.

L_VOID SampleAnnSetTextPointerFixed(LAnnAutomation *pLAutomation)
{
L_INT nRet;
L_BOOL bTextPointerFixed;
L_TCHAR szMsg[100];
L_UINT uType;

pLAutomation->GetTextPointerFixed(
 &bTextPointerFixed);

bTextPointerFixed = !bTextPointerFixed;

nRet= pLAutomation->SetTextPointerFixed(bTextPointerFixed,
 0);
if (nRet != SUCCESS)
{
uType = pLAutomation->GetType();
wsprintf(szMsg, TEXT("
 LAnnAutomation::SetTextPointerFixed Error: %d on object type[%d]\n"),
 nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"),
 MB_OK);
}
}


LAnnAutomation::GetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTextRotate(puTextRotate)

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
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 gets a value that indicates whether the text of certain annotation objects that display text will be rotated. The following annotation objects can display rotated text:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// Sample for LAnnAutomation::SetTextRotate, LAnnAutomation::GetTextRotate

// This example changes the text rotation of a note or text pointer annotation

L_VOID SampleAnnSetTextRotate(LAnnAutomation *pLAutomation)
{
L_INT nRet;
L_UINT uTextRotate;
L_TCHAR szMsg[100];
L_UINT uType;

pLAutomation->GetTextRotate(&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= pLAutomation->SetTextRotate(uTextRotate,
 0);
if (nRet != SUCCESS)
{
uType
 = pLAutomation->GetType();
wsprintf(szMsg,
 TEXT(" LAnnAutomation::SetTextRotate
 Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL,
 szMsg, TEXT("Error"), MB_OK);
}
}


LAnnAutomation::GetTextRTF

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTextRTF(uFormat, pText, puLen)

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

LAnnAutomation lAutomation; // assume this is a valid ANNOBJECT_RTF object

L_UINT uLength;

L_TCHAR *pText;

// Get the length

lAutomation .GetTextRTF(RTFFORMAT_RTF, NULL, &uLength);

// Allocate a buffer

pText = (L_TCHAR )malloc((uLength+1)*sizeof(L_TCHAR));

// Retrieve the text

lAutomation .GetTextRTF(RTFFORMAT_RTF, pText, &uLength);

To get or set the text of other text objects, see the documentation
 for LAnnAutomation::GetTextLen,
 LAnnAutomation::GetText and
 LAnnAutomation::SetText.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This sample gets the text from Rich Text annotation object
 in one of two formats (text, or rich text)
// plAutomation: the Rich Text annotation object
// uFormat: the format of the retrieved text--one of
// RTFFORMAT_TEXT
// RTFFORMAT_RTF
L_VOID SampleAnnGetTextRTF(LAnnAutomation *plAutomation, 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 = plAutomation->GetTextRTF( uFormat, NULL, &uLength);
if (nRet != SUCCESS)
return;

pText = (L_TCHAR
 *)malloc((uLength+1)*sizeof(L_TCHAR));
nRet = plAutomation->GetTextRTF( uFormat, pText, &uLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg,
 TEXT("Format: %s\nLength: %d"), pszFormat, uLength);
MessageBox(NULL,
 pText, szMsg, MB_OK);
}

free(pText);
}


LAnnAutomation::GetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTicMarkLength(pdLength)

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_RULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetTicMarkLength.


LAnnAutomation::GetTool

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetTool(L_VOID)

Gets the default tool, which is maintained by the automation object. This function is available in the Document/Medical Toolkits.

Returns

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

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: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetTool, LAnnotation::GetUserMode, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

void CurrentTool(LAnnAutomation L_FAR * pAnnAutomation)
{
switch (pAnnAutomation->GetTool())
{
case ANNTOOL_SELECT:
break;
case ANNTOOL_LINE:
break;
case ANNTOOL_RECT:
break;
case ANNTOOL_ELLIPSE:
break;
case ANNTOOL_POLYLINE:
break;
case ANNTOOL_POLYGON:
break;
case ANNTOOL_POINTER:
break;
case ANNTOOL_FREEHAND:
break;
case ANNTOOL_HILITE:
break;
case ANNTOOL_REDACT:
break;
case ANNTOOL_TEXT:
break;
case ANNTOOL_NOTE:
break;
case ANNTOOL_STAMP:
break;
case ANNTOOL_BUTTON:
break;
case ANNTOOL_HOTSPOT:
break;
case ANNTOOL_AUDIO:
break;
case ANNTOOL_RULER:
break;
}
}


LAnnAutomation::GetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetTransparentColor(pcrTransparent)

COLORREF L_FAR * pcrTransparent;

/* address of a variable to be updated */

Retrieves the transparent color set by LAnnAutomation::SetTransparentColor. A transparent color is not painted when the image is painted. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::GetPixelColor.

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.

See Also

Functions: | LAnnAutomation::SetTransparentColor, LAnnAutomation::SetTransparent, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnAutomation::SetTransparentColor.


LAnnAutomation::GetUndoDepth

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::GetUndoDepth(puUsedLevels, puMaxLevels)

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 LAnnAutomation::Undo 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 LAnnAutomation::Undo. 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 LAnnAutomation::Undo. This is the value that was set using LAnnAutomation::SetUndoDepth.

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 LAnnAutomation::Undo 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.

See Also

Functions: | LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

//This example uses the following member variables:
// m_AnnotationWindow should be created and initialized prior to the example
LAnnotationWindow m_AnnotationWindow;

void OnButtonAnnGetUndoDepth()
{
L_UINT uUsedLevels,
 uMaxLevels;
L_TCHAR szMsg[100];

m_AnnotationWindow.GetAutomationObject().GetUndoDepth(&uUsedLevels, &uMaxLevels);
wsprintf(szMsg,TEXT("UsedLevels[%d]\nMaxLevels[%d]"),
 uUsedLevels, uMaxLevels);
AfxMessageBox(szMsg);
}


LAnnAutomation::GetUnit

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetUnit(pUnitAbbrev, puPrecision)

L_TCHAR L_FAR * pUnitAbbrev; | /* character string to be updated with the unit abbreviation string */
L_UINT L_FAR * puPrecision; | /* pointer to a variable to be updated */

Gets the current unit of measurement values set by the LAnnAutomation::SetUnit function. This function is available in the Document/Medical Toolkits.

Parameter | Description
pUnitAbbrev | Character string to be updated with the unit abbreviation string to be displayed after the distance.
puPrecision | Pointer to a 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_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 LAnnAutomation::GetUnit function or the LAnnRuler::GetUnit 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 LAnnAutomation::SetUnit or the LAnnRuler::SetUnit 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.

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: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::GetDistance.


LAnnAutomation::GetUnitLen

#include "ltwrappr.h"

virtual L_UINT LAnnAutomation::GetUnitLen(L_VOID)

Gets the size of the buffer required to hold pUnitAbbrev in LAnnAutomation::GetUnit. This function is available in the Document/Medical Toolkits.

Returns

The length of the unit abbreviation string.

Comments

Call this function before calling LAnnAutomation::GetUnit 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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::GetDistance.


LAnnAutomation::InsertTextTokenTable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::InsertTextTokenTable(pTextToken)

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

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 a TextToken as shown in the following code:

ANNTEXTTOKEN TextToken;

TextToken.uStructSize = 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnAutomation *pLAutomation)
{
ANNTEXTTOKEN TextToken;

// Clear the current text token table
pLAutomation->ClearTextTokenTable();

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;
pLAutomation->InsertTextTokenTable(&TextToken);

// Define token for two digit day
TextToken.cToken = '1';
TextToken.pszDesc = TEXT("Two Digit Day");
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_DATE_DD;
pLAutomation->InsertTextTokenTable(&TextToken);

// Define token for four digit year
TextToken.cToken = '2';
TextToken.pszDesc = TEXT("Two Digit Day");
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_DATE_YYYY;
pLAutomation->InsertTextTokenTable(&TextToken);

// Add a separator
TextToken.cToken = 0;
TextToken.pszDesc = NULL;
TextToken.pszTokenString = NULL;
TextToken.nTokenType = ANNTOKEN_SEPARATOR;
pLAutomation->InsertTextTokenTable(&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;
pLAutomation->InsertTextTokenTable(&TextToken);

// Define token for company name
TextToken.cToken = 'c';
TextToken.pszDesc = TEXT("Company Name");
TextToken.pszTokenString = TEXT("Your Company Name");
TextToken.nTokenType = ANNTOKEN_TEXT;
pLAutomation->InsertTextTokenTable(&TextToken);
}


LAnnAutomation::IsAutoDrawEnabled

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsAutoDrawEnabled(L_VOID)

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.

Returns

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.

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: | LAnnAutomation::SetAutoMenuEnabled, LAnnAutomation::SetAutoDrawEnabled, LAnnAutomation::SetAutoText, Class Members, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

/* This example gets and updates the property of the automation
 object passed by the caller */
L_VOID TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_BOOL bEnable; /* Is drawing enabled? */
/* Disable automated drawing, unless it is already disabled
 */
bEnable = pAnnObject->IsAutoDrawEnabled();
if (bEnable == FALSE)
MessageBox (NULL, TEXT("Drawing
 is already disabled"),TEXT("Notice"), MB_OK);
else
pAnnObject->SetAutoDrawEnabled(FALSE);
}


LAnnAutomation::IsAutoMenuEnabled

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsAutoMenuEnabled(L_VOID)

Gets a value that indicates whether the automated menus for annotation are enabled. This function is available in the Document/Medical Toolkits.

Returns

TRUE | Menus are enabled
FALSE | Menus are disabled.

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: | LAnnAutomation::SetAutoMenuEnabled, LAnnAutomation::SetAutoDrawEnabled, LAnnAutomation::SetAutoText, Class Members, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

/* This example gets and updates the property of the automation
 object passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_BOOL bEnable; /* Are menus enabled? */
/* Disable the menus, unless they are already disabled
 */
pAnnObject->IsAutoMenuEnabled();
if (bEnable == FALSE)
MessageBox (NULL, TEXT("Menus
 are already disabled"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetAutoMenuEnabled(FALSE);
}


LAnnAutomation::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnAutomation::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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

// pLAutomation -- Pointer to LAnnAutomation annotation object.

L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnAutomation *pLAutomation)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLAutomation->IsFixedInRect(&rcClient,
 ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed
 annotations visible.") : TEXT("There are NO fixed annotations
 visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnAutomation::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsFontBold(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
/* Set the font to bold, unless it already is */
if (pAnnObject->IsFontBold())
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontBold(TRUE, 0);
}


LAnnAutomation::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsFontItalic(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontBold, LAnnAutomation::SetFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
/* Set the font to italic, unless it already is */

if (pAnnObject->IsFontItalic()== TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontItalic(TRUE, 0);
}


LAnnAutomation::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsFontStrikeThrough(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
/* Set the font
 to have a strike-through, unless it already has one */

if (pAnnObject->IsFontStrikeThrough())
MessageBox
 (NULL, TEXT("Already has strike-through"), TEXT("Notice"),
 MB_OK);
else
pAnnObject->SetFontStrikeThrough(TRUE,
 0);
}


LAnnAutomation::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsFontUnderline(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
void TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
/* Set the font
 to have an underline, unless it already has one */

if (pAnnObject->IsFontUnderline())
MessageBox
 (NULL, TEXT("Already has an underline"), TEXT("Notice"),
 MB_OK);
else
pAnnObject->SetFontUnderline(TRUE,
 0);
}


LAnnAutomation::IsHyperlinkMenuEnabled

#include "ltwrappr.h"

virtual L_BOOL LAnnAutomation::IsHyperlinkMenuEnabled(L_VOID)

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.

Returns

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.

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: | LAnnAutomation::IsHyperlinkMenuEnabled, LAnnotation::SetHyperlink, LAnnotation::GetHyperlinkLen, LAnnotation::GetHyperlink, LAnnAutomation::SetAutoText, Class Members
Topics: | Annotation Functions (Document/Medical only): Hyperlinks

Example

/*
This example determines whether the automation hyperlink menu item is
enabled. If the menu item is enabled, then the example disables it. It
 the
menu item is disabled, the example enables it.
*/
void ToggleMenu(LAnnAutomation L_FAR * pAnnAutomation)
{
L_BOOL bEnabled;

/* toggle display
 of HyperLink menu item */
bEnabled = !pAnnAutomation->IsHyperlinkMenuEnabled();

pAnnAutomation->SetHyperlinkMenuEnabled(bEnabled,
 0);
}


LAnnAutomation::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnAutomation::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnAutomation::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnAutomation::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnAutomation::PushFixedState / LAnnAutomation::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnAutomation::PushFixedState and LAnnAutomation::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnAutomation::PushFixedState (); | Fixed state is temporarily disabled
LAnnAutomation::PushFixedState (); | Fixed state is temporarily disabled
LAnnAutomation::PopFixedState (); | Fixed state is still disabled
LAnnAutomation::PopFixedState (); | Fixed state is enabled

Note that LAnnAutomation::PushFixedState and LAnnAutomation::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of all objects in the container that

// have been temporarily disabled with a call to LAnnAutomation::PushFixedState

// For an example using the magnifying glass, see the source code

// for the main Class Library annotation demo.

L_VOID SampleAnnPopFixedState(LAnnAutomation *pLAutomation)
{
pLAutomation->PopFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnAutomation::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnAutomation::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnAutomation::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnAutomation::PushFixedState / LAnnAutomation::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnAutomation::PushFixedState and LAnnAutomation::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnAutomation::PushFixedState (); | Fixed state is temporarily disabled
LAnnAutomation::PushFixedState (); | Fixed state is temporarily disabled
LAnnAutomation::PopFixedState (); | Fixed state is still disabled
LAnnAutomation::PopFixedState (); | Fixed state is enabled

Note that LAnnAutomation::PushFixedState and LAnnAutomation::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container

// This is useful when fixed objects need to be temporarily painted larger or smaller than

// the fixed size. For an example using the magnifying glass, see the source code

// for the main Class Library annotation demo.

L_VOID SampleAnnPushFixedState(LAnnAutomation *pLAutomation)
{
pLAutomation->PushFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnAutomation::SetAutoContainer

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoContainer(hContainer)

virtual L_INT LAnnAutomation::SetAutoContainer(pLContainer)

HANNOBJECT hContainer; | /* handle to the container */
LAnnContainer L_FAR * pLContainer; | /* pointer to a container object */

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
hContainer | Handle to the container.
pLContainer | Pointer to a container object.

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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetDpiX, LAnnAutomation::SetDpiY, LAnnAutomation::GetDpiX, LAnnAutomation::GetDpiY, LAnnAutomation::SetTool, LAnnAutomation::GetTool, LAnnotation::GetUserMode, LAnnContainer::SetUserMode, LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Displaying and Manipulating Annotation Objects

Example

#include <ltlck.h> //Unlock support
class MyAnnClass
{
public :
LAnnAutomation m_MyAutomation; //Automation
 object
LAnnContainer m_MyContainer; //Container
 object
LAnnToolBar m_MyToolbar; //Toolbar
HWND m_hWnd; //Handle to this window
LBitmapBase m_MyBitmap; //Bitmap image
 to draw on

/*Register a window class and create
 our main window*/
/*Note that your window procedure must
 be static
(CALLBACK functions must be static
 or friend). I use extra bytes per window
to hold the current object's pointer
 (this)
*/
BOOL CreateWnd(HINSTANCE hInst, LPRECT pRect)
{
WNDCLASS wc;

wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = MyWndProc; //static callback
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(MyAnnClass L_FAR *); //In order
 to save this pointer
wc.hInstance = hInst;
wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = TEXT("MyAnnClass");

if (RegisterClass(&wc)==0)
return FALSE;
m_hWnd= CreateWindow(TEXT("MyAnnClass"), NULL,
WS_OVERLAPPEDWINDOW|WS_VISIBLE,
pRect->left,pRect->top,
pRect->right,
pRect->bottom,
NULL,
(HMENU)NULL,
hInst,
NULL);
//Attach the pointer to the window
if (m_hWnd)
SetWindowLong(m_hWnd, 0, (LONG)this);
return (m_hWnd!=NULL);
}

MyAnnClass(HINSTANCE hInst, L_TCHAR L_FAR * pszFileName)
{
if (m_MyBitmap.Load(pszFileName)==SUCCESS)
{
ANNRECT rcContainer ={0, 0, m_MyBitmap.GetWidth(), m_MyBitmap.GetHeight()};
RECT rcClient ={0,0,640,480};
POINT pt = {0,0};

CreateWnd(hInst, &rcClient);

m_MyContainer.Create(m_hWnd,
 &rcContainer, TRUE);
m_MyContainer.SetScalarX((L_DOUBLE)rcClient.right/m_MyBitmap.GetWidth(),0);
m_MyContainer.SetScalarY((L_DOUBLE)rcClient.bottom/m_MyBitmap.GetHeight(),0);
m_MyContainer.SetOffsetX(0);
m_MyContainer.SetOffsetY(0);
m_MyContainer.SetUserMode(ANNUSER_DESIGN);

//Assign the automation object to the
 container
m_MyAutomation.SetAutoContainer(&m_MyContainer);
m_MyAutomation.SetActiveState(ANNACTIVE_ENABLED);
m_MyAutomation.SetDpiX(600);
m_MyAutomation.SetDpiY(600);
m_MyAutomation.SetUndoDepth(3);
m_MyToolbar.Create(m_hWnd,
 &pt, ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP, TRUE);
}
}
virtual ~MyAnnClass()
{
m_MyAutomation.SetActiveState(ANNACTIVE_DISABLED);
m_MyAutomation.Destroy();
m_MyContainer.Destroy();
m_MyToolbar.Destroy();
}

static LRESULT CALLBACK MyWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM
 lParam)
{
MyAnnClass L_FAR * This = (MyAnnClass L_FAR *) GetWindowLong(hWnd,
 0);

if (This==NULL)
return DefWindowProc(hWnd, uMsg, wParam,
 lParam);

switch(uMsg)
{
case WM_PAINT:
{
PAINTSTRUCT
 ps;

BeginPaint(hWnd,&ps);

if
 (This->m_MyBitmap.IsAllocated())
{
This->m_MyBitmap.SetClipDstRect(&ps.rcPaint);
This->m_MyBitmap.CreatePaintPalette(ps.hdc);
This->m_MyBitmap.Paint()->SetDC(ps.hdc);
This->m_MyBitmap.Paint()->PaintDC();
}
if
 (This->m_MyContainer.IsValid())
This->m_MyContainer.Draw(ps.hdc, &ps.rcPaint);
EndPaint(hWnd,
 &ps);
}
break;
case WM_SIZE:
{
if(This->m_MyContainer.IsCreated())
{
RECT
 rcDst;

This->m_MyBitmap.GetRects(0,0,&rcDst,0);
rcDst.right-=rcDst.left;
rcDst.bottom-=rcDst.top;

L_DOUBLE
 sx = (L_DOUBLE)((L_DOUBLE)(rcDst.right)/(L_DOUBLE)This->m_MyBitmap.GetWidth());
L_DOUBLE
 sy = (L_DOUBLE)((L_DOUBLE)(rcDst.bottom)/(L_DOUBLE)This->m_MyBitmap.GetHeight());

This->m_MyContainer.SetScalarX(sx,ANNFLAG_NOINVALIDATE);
This->m_MyContainer.SetScalarY(sy,ANNFLAG_NOINVALIDATE);

This->m_MyContainer.SetOffsetX(rcDst.left,ANNFLAG_NOINVALIDATE);
This->m_MyContainer.SetOffsetY(rcDst.top,ANNFLAG_NOINVALIDATE);
}
}
break;
case WM_LTANNEVENT:
if
 (wParam==LTANNEVENT_TOOLCHECKED)
This->m_MyAutomation.SetTool((L_UINT)lParam);
break;
default:
return
 DefWindowProc(hWnd, uMsg,wParam,lParam);
}

return FALSE;
}
};

L_VOID TestFunction(HINSTANCE hInst)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all
 libraries are loaded
LBase::EnableAutoErrorDisplay(TRUE);

UNLOCKSUPPORT();

MyAnnClass MyAnnotationObject(hInst,TEXT("image1.cmp"));

//loop till the user cancels the operation

MSG msg;

for (;;)
{
while (PeekMessage(&msg, NULL,
 0,0, PM_REMOVE))
{
switch (msg.message)
{
case
 WM_KEYDOWN:
if
 (msg.wParam != VK_ESCAPE)
break;
case
 WM_QUIT:
PostQuitMessage(0);
return;
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}


LAnnAutomation::SetAutoCursor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoCursor(uItem, hCursor)

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
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 gripper rotate handle.
 | ANNAUTOCURSOR_ROTATE_CENTER | [9] Displayed when hovering over rotate center handle.
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 the used object is not Created, 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 the used object is Created, 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 LAnnAutomation::SetAutoCursor 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 LAnnAutomation::GetAutoCursor.

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: | Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetRotateOptions, LAnnotation::SetRotateOptions, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | New Annotation Features of Version 14.5
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

// This sample changes the annotation cursors for the automation object hAutomation

L_VOID SampleAnnSetCursors(LAnnAutomation *plAutomation)
{
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"));

plAutomation->SetAutoCursor(ANNAUTOCURSOR_DEFAULT, hCursorDefault);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_DRAWNEW, hCursorDrawNew);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_HANDLE, hCursorHandle);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_HOTSPOT, hCursorHotspot);

plAutomation->SetAutoCursor(ANNAUTOCURSOR_MOVE, hCursorMove);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_SELECT, hCursorSelect);
plAutomation->SetAutoCursor(ANNAUTOCURSOR_TEXT, hCursorText);
}


LAnnAutomation::SetAutoDialogFontSize

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoDialogFontSize(nFontSize)

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
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 LAnnAutomation::GetAutoDialogFontSize function.

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.

See Also

Functions: | LAnnAutomation::GetAutoDialogFontSize, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | Converting Automation Dialogs to Other Languages

Example

void TestFunction()
{
LAnnAutomation lAutoObject;
L_INT nfontsize;
/* Get and Set the font size for the dialogs */
lAutoObject.GetAutoDialogFontSize(&nfontsize);
nfontsize *= 2;
lAutoObject.SetAutoDialogFontSize(nfontsize);
return;
}


LAnnAutomation::SetAutoDrawEnabled

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoDrawEnabled(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to enable automated drawing */

Enables or disables automated drawing in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
bEnable | 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.

See Also

Functions: | LAnnAutomation::SetAutoMenuEnabled, LAnnAutomation::IsAutoDrawEnabled, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Displaying and Manipulating Annotation Objects

Example

/* This example gets and updates the property of the automation
 object passed by the caller */
L_VOID TestModifyAnn(LAnnAutomation L_FAR * pAnnObject)
{
L_BOOL bEnable; /* Is drawing enabled? */
/* Disable automated drawing, unless it is already disabled
 */
bEnable = pAnnObject->IsAutoDrawEnabled();
if (bEnable == FALSE)
MessageBox (NULL, TEXT("Drawing
 is already disabled"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetAutoDrawEnabled(FALSE);
}


LAnnAutomation::SetAutoHilightPen

#include "ltwrappr.h"

L_INT LAnnAutomation::SetAutoHilightPen(crHilightPen)

COLORREF crHilightPen;

/* the color of the pen that is used for highlighting */

Sets the color of the pen that is used for highlighting. This function is available in the Document/Medical Toolkits.

Parameter | Description
crHilightPen | The color of the pen that is used for highlighting.

Returns

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

Comments

This function allows you 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, choose ANY tool and click/drag the mouse draw an outline. The outline is displayed using the highlight pen.

In automated annotation design mode, choose the Select tool and click 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 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. For images with many mid-range grays, these cursors will not be visible. To avoid this, define your own cursors and use the LAnnAutomation::SetAutoCursor function. The main annotation demo (ClAnno32.EXE) demonstrates how to change the highlight pen and the annotation cursors.

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: | LAnnotation::GetAutoBackColor, LAnnotation::GetBackColor, LAnnotation::SetBackColor, LAnnAutomation::SetAutoCursor, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Implementing Custom Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LAnnContainer m_LeadAContainer;
LAnnToolBar m_LeadAToolbar;
LAnnAutomation m_LeadAAutomation;
CBitmapWindow m_LBitmap;

BOOL CAutomatedDlg::OnInitDialog()
{
.
.
.
.
// TODO: Add extra initialization here
LSettings::LoadLibraries(LT_ALL_LEADLIB);
LSettings::UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

CWnd* pWnd = GetDlgItem(IDC_BITMAPWND);

CRect rcRect;
// Get the rectangle of the button
pWnd->GetWindowRect(&rcRect);
ScreenToClient(&rcRect);

// Create the LBitmapWindow control, make it visible, and make it center the image
HWND hWnd = m_LBitmap.CreateWnd(GetSafeHwnd(),
901,
WS_VISIBLE,
rcRect.TopLeft().x,
rcRect.TopLeft().y,
rcRect.BottomRight().x,
rcRect.BottomRight().y);

int nRet = 0;
RECT rcClientArea;
ANNRECT rcContainerRect;

nRet = m_LBitmap.Load(TEXT("c:\\1.bmp"));

if(nRet == SUCCESS)
{
::GetClientRect(hWnd,&rcClientArea);
m_LBitmap.SetDstRect(&rcClientArea);

rcContainerRect.left = 0;
rcContainerRect.top = 0;
rcContainerRect.right = rcClientArea.right-rcClientArea.left;
rcContainerRect.bottom = rcClientArea.bottom-rcClientArea.top;

m_LeadAContainer.Create(hWnd,&rcContainerRect,TRUE);
m_LeadAContainer.SetOffsetX((L_DOUBLE) 0, 0);
m_LeadAContainer.SetOffsetY((L_DOUBLE) 0, 0);

m_LeadAAutomation.Create();

/* Assign the automation object to the container */
m_LeadAAutomation.SetAutoContainer(&m_LeadAContainer);
/* Enable the automation object */
m_LeadAAutomation.SetActiveState(ANNACTIVE_ENABLED);
/* Set design mode, which allows creation of annotations */
m_LeadAContainer.SetUserMode();
/* Set the dots per inch for interpreting physical measurements */
//m_LeadAContainer.SetDpiX(600, 0);
m_LeadAContainer.SetDpiY(600, 0);

/* Set the number of possible undo actions */
m_LeadAAutomation.SetUndoDepth(3);
/* Set the line tool as the initial annotation tool */

m_LeadAToolbar.Create(GetSafeHwnd(), NULL, ANNTOOLALIGN_RIGHT | ANNTOOLALIGN_TOP, TRUE);

m_LBitmap.SetContainer(&m_LeadAContainer);
m_LBitmap.SetAutomation(&m_LeadAAutomation);
m_LBitmap.SetToolBar(&m_LeadAToolbar);
}

return TRUE; // return TRUE unless you set the focus to a control
}

void CAutomatedDlg::OnAnnHilightPen()
{
UpdateData(TRUE);
m_LeadAAutomation.SetAutoHilightPen(m_bAnnHilightPen ? RGB(0xC0, 0xC0, 0xC0) : RGB(0xFF, 0xFF, 0xFF));
UpdateData(FALSE);
}


LAnnAutomation::SetAutoMenuEnabled

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoMenuEnabled(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to enable automated annotation menus */

Enables or disables the automated menus for annotation, which appear when the user clicks the right mouse button. This function is available in the Document/Medical Toolkits.

Parameter | Description
bEnable | Flag that indicates whether to enable or 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 LAnnAutomation::SetAutoText.

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: | LAnnAutomation::IsAutoMenuEnabled, LAnnAutomation::SetAutoDrawEnabled, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::IsAutoMenuEnabled.


LAnnAutomation::SetAutoOptions

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoOptions(uFlags)

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

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.

See Also

Functions: | LAnnAutomation::GetAutoOptions, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

//This example uses the following member variables:
// m_AnnotationWindow should be created and initialized prior to the example
//This example toggles the tabbed dialog box behavior
LAnnotationWindow m_AnnotationWindow;

void OnButtonAnnSetAutoDefaults()
{
L_UINT uFlags;

m_AnnotationWindow.GetAutomationObject().GetAutoOptions(&uFlags);
uFlags = uFlags ? 0 : ANNAUTO_TABBEDDIALOG;
m_AnnotationWindow.GetAutomationObject().SetAutoOptions(uFlags);
}


LAnnAutomation::SetAutoText

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoText(uItem, pText)

L_UINT uItem; | /* constant for the specified item*/
L_TCHAR L_FAR * pText; | /* character string for the item */

Specifies 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
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
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 LAnnAutomation::GetAutoTextLen to determine the length of the string and to allocate a buffer of appropriate size. Then call LAnnAutomation::GetAutoText to retrieve the string.

When you call LAnnAutomation::SetAutoText, 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 LAnnAutomation::SetAutoText and pass a valid 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.

See Also

Functions: | LAnnAutomation::GetAutoText, LAnnAutomation::GetAutoTextLen, LAnnAutomation::IsAutoMenuEnabled, LAnnAutomation::SetAutoMenuEnabled, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Converting Automation Dialogs to Other Languages

Example

For an example, refer to LAnnAutomation::GetAutoText.


LAnnAutomation::SetAutoUndoEnable

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetAutoUndoEnable(bEnable)

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
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 LAnnAutomation::AddUndoNode to combine multiple changes into a single undo call. For more information on this process, refer to LAnnAutomation::AddUndoNode.

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: | LAnnAutomation::AddUndoNode, LAnnAutomation::GetAutoUndoEnable, LAnnAutomation::GetUndoDepth, LAnnAutomation::SetUndoDepth, LAnnAutomation::Undo, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAutomation::GetAutoUndoEnable.


LAnnAutomation::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color to set */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

Use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color value.

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

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: | LAnnAutomation::SetForeColor, LAnnAutomation::GetBackColor, LAnnAutomation::GetForeColor, Class Members, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnAutomation::GetBackColor.


LAnnAutomation::SetBitmapDpiX

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetBitmapDpiX(dDpiX, uFlags=0)

L_DOUBLE dDpiX; | /* horizontal DPI value to set */
L_UINT uFlags; | /* reserved for future use */

Sets the horizontal Bitmap DPI (dots per inch) value that is used to translate the horizontal distance for Ruler objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 versions, use 0.

Returns

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

Comments

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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

L_VOID ChangeDpiX(LAnnAutomation L_FAR * pAutomation, LBitmapBase
 L_FAR * pBitmap)
{
L_DOUBLE xRes;
L_DOUBLE yRes;

/* get the bitmap x and y res from the object */

xRes = pAutomation->GetBitmapDpiX();
yRes = pAutomation->GetBitmapDpiY();

/* set all selected items to have the same dpi for ruler
 tool as the bitmap */

if(xRes != (L_DOUBLE) pBitmap->GetXResolution())
pAutomation->SetBitmapDpiX((L_DOUBLE)
 pBitmap->GetXResolution(), ANNFLAG_RECURSE | ANNFLAG_SELECTED);
if(yRes != (L_DOUBLE) pBitmap->GetYResolution())
pAutomation->SetBitmapDpiY((L_DOUBLE)
 pBitmap->GetYResolution(),
 ANNFLAG_RECURSE | ANNFLAG_SELECTED);
}


LAnnAutomation::SetBitmapDpiY

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetBitmapDpiY(dDpiY, uFlags=0)

L_DOUBLE dDpiY; | /* vertical DPI value to set */
L_UINT uFlags; | /* reserved for future use */

Sets the vertical Bitmap DPI (dots per inch) value that is used to translate the vertical distance for Ruler objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Reserved for future versions, use 0.

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.

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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetBitmapDpiX.


LAnnAutomation::SetDpiX

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetDpiX(dDpiX, uFlags=0)

L_DOUBLE dDpiX; | /* horizontal DPI value to set */
L_UINT uFlags; | /* flag */

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

Typically, if you are matching annotations to a bitmap, you can use the bitmap object'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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::GetDpiX, LAnnAutomation::SetDpiY, LAnnAutomation::GetDpiY, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::SetAutoContainer.


LAnnAutomation::SetDpiY

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetDpiY(dDpiY, uFlags=0)

L_DOUBLE dDpiY; | /* vertical DPI value to set */
L_UINT uFlags; | /* flag */

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
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 | Reserved for future use. You can pass 0.

Returns

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

Comments

Typically, if you are matching annotations to a bitmap, you can use the bitmap object’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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::GetDpiX, LAnnAutomation::SetDpiX, LAnnAutomation::GetDpiY, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::SetAutoContainer.


LAnnAutomation::SetEncryptOptions

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetEncryptOptions(pEncryptOptions, uFlags)

pANNENCRYPTOPTIONS pEncryptOptions; | /* pointer to a structure that specifies various Encryption options */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the options for the specified Automation annotation object. This object may be in the encryptor or the decryptor state. This function is available in the Document/Medical Toolkits.

Parameter | Description
pEncryptOptions | Pointer to an ANNENCRYPTOPTIONS structure that specifies the various encryption 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 Automation annotation object. To use this function, declare a variable of type ANNENCRYPTOPTIONS, and pass the address of this variable for pEncryptOptions.

Use the LAnnAutomation::GetEncryptOptions function to get the encrypt options of an Automation 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

L_VOID SampleAnnGetSetEncryptOptions(LAnnAutomation *pLAuto)
{
L_BOOL bEncryptorOriginal;
ANNENCRYPTOPTIONS
 EncryptOptions;

L_UINT uObjectType;

uObjectType =
 pLAuto->GetType();
if (uObjectType
 != ANNOBJECT_AUTOMATION)
{
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;
pLAuto->GetEncryptOptions(&EncryptOptions);

bEncryptorOriginal
 = EncryptOptions.bEncryptor;

// Set state
 to encryptor, and set encryptor metafile
EncryptOptions.uFlags
 = ANNENCRYPT_TYPE;
EncryptOptions.bEncryptor
 = TRUE;
pLAuto->SetEncryptOptions(&EncryptOptions,
 0);

// Set state
 to decryptor, and set decryptor metafile
EncryptOptions.bEncryptor
 = FALSE;
pLAuto->SetEncryptOptions(&EncryptOptions,
 0);

// Set encryptor
 to oringal state
EncryptOptions.bEncryptor
 = bEncryptorOriginal;
pLAuto->SetEncryptOptions(&EncryptOptions,
 0);
}


LAnnAutomation::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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

Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::GetFillMode, LAnnAutomation::GetFillPattern, LAnnAutomation::SetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetFillMode.


LAnnAutomation::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFillPattern(uFillPattern=ANNPATTERN_SOLID, uFlags=0)

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* reserved for future use */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::GetFillMode, LAnnAutomation::SetFillMode, LAnnAutomation::GetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetFillPattern.


LAnnAutomation::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnAutomation *pLAutomation)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLAutomation->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLAutomation->SetFixed(bFixed,
 TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed")
 : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""),
 MB_OK);
}
else
{
wsprintf(szMsg, TEXT("
 LAnnAutomation::GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"),
 MB_OK);
}
}


LAnnAutomation::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | Make the font not bold.
uFlags | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::IsFontBold.


LAnnAutomation::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic. Possible values are:
 | Value | Meaning
 | TRUE | Make the font italic.
 | FALSE | Make the font not italic.
uFlags | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::IsFontItalic.


LAnnAutomation::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* name of the font */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | Character string containing the name of the font to assign.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

Specify the name of the font in a 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.

See Also

Functions: | LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties
 | Converting Automation Dialogs to Other Languages

Example

For an example, refer to LAnnAutomation::GetFontName.


LAnnAutomation::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* font size to set */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
dFontSize | The font size to set, expressed as an unscaled value relative to the container.
uFlags | Reserved for future versions, use 0.

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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetFontSize.


LAnnAutomation::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply a strike-through */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the value of the strike-through property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply a strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through.
 | FALSE | Remove the strike-through.
uFlags | Reserved for future, use 0.

Returns

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

Comments

This property determines whether the font has a line through the middle of the text.

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: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::SetFontUnderline, LAnnAutomation::IsFontUnderline, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::IsFontStrikeThrough.


LAnnAutomation::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply an underline */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font-underline property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply an underline. Possible values are:
 | Value | Meaning
 | TRUE | Apply an underline.
 | FALSE | Remove the underline.
uFlags | Reserved for future, use 0.

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.

See Also

Functions: | LAnnAutomation::SetFontName, LAnnAutomation::GetFontName, LAnnAutomation::GetFontNameLen, LAnnAutomation::SetFontSize, LAnnAutomation::GetFontSize, LAnnAutomation::IsFontUnderline, LAnnAutomation::SetFontStrikeThrough, LAnnAutomation::IsFontStrikeThrough, LAnnAutomation::SetFontItalic, LAnnAutomation::IsFontItalic, LAnnAutomation::SetFontBold, LAnnAutomation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::IsFontUnderline.


LAnnAutomation::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* reserved for future versions */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

Use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color value.

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

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: | LAnnAutomation::GetForeColor, LAnnAutomation::SetBackColor, LAnnAutomation::GetBackColor, Class Members, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example,refer to LAnnAutomation::GetForeColor.


LAnnAutomation::SetGaugeLength

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetGaugeLength(dLength, uFlags=0)

L_DOUBLE dLength; | /* the new gauge length */
L_UINT uFlags; | /* reserved for future versions */

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
dLength | The new length of the ruler object's gauge.
uFlags | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetUnit, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::GetGaugeLength.


LAnnAutomation::SetHyperlinkMenuEnabled

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetHyperlinkMenuEnabled(bEnable=TRUE, uFlags=0)

L_BOOL bEnable; | /* 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
bEnable | 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

Set bEnable 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 LAnnAutomation::SetAutoText).

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: | LAnnAutomation::IsHyperlinkMenuEnabled, LAnnAutomation::SetAutoMenuEnabled, LAnnotation::SetHyperlink, LAnnotation::GetHyperlinkLen, LAnnotation::GetHyperlink, LAnnAutomation::SetAutoText, Class Members
Topics: | Annotation Functions (Document/Medical only): Hyperlinks

Example

For an example, refer to LAnnAutomation::IsHyperlinkMenuEnabled.


LAnnAutomation::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* reserved for future versions */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::GetLineStyle, LAnnAutomation::GetLineWidth, LAnnAutomation::SetLineWidth, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetLineStyle.


LAnnAutomation::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width*/
L_UINT uFlags; | /* reserved for future use */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Reserved for future versions, use 0.

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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | LAnnAutomation::GetLineStyle, LAnnAutomation::SetLineStyle, LAnnAutomation::GetLineWidth, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetLineWidth.


LAnnAutomation::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a Polygon object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the next polyline, polygon, freehand, or freehand hotspot objects, created in automated mode, will be displayed.

If bShowNodes is 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.

See Also

Functions: | LAnnAutomation::GetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void OnButtonAutoGetnode()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnAutomation MyAnnAutomation;

L_BOOL bShowNodes;
L_UINT uGapNodes;
MyAnnAutomation.GetNodes(&bShowNodes,
 &uGapNodes);

//skip more nodes than currently skipping
MyAnnAutomation.SetNodes(bShowNodes,
 uGapNodes + 1);

//Get default ShowFlags
L_UINT uShowFlags;
MyAnnAutomation.GetShowFlags(&uShowFlags);

//Do not display ruler gauge
uShowFlags &= ~ANNSHOW_GAUGE;
MyAnnAutomation.SetShowFlags(uShowFlags);
}


LAnnAutomation::SetPointOptions

#include "ltwrappr.h"

static L_INT LAnnAutomation::SetPointOptions(pPointOptions, uFlags)

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 Automation annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 automation 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnAutomation::GetPointOptions.


LAnnAutomation::SetPolyFillMode

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetPolyFillMode(uPolyFillMode=ANNPOLYFILL_WINDING, uFlags=0)

L_UINT uPolyFillMode; | /* constant that specifies the polygon fill mode */
L_UINT uFlags; | /* reserved for future use */

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
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 | Reserved for future versions, use 0.

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.

See Also

Functions: | LAnnAutomation::GetFillMode, LAnnAutomation::SetFillMode, LAnnAutomation::GetFillPattern, LAnnAutomation::SetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::SetPolyFillMode.


LAnnAutomation::SetShowFlags

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetShowFlags(uShowFlags=0, uFlags=0)

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, PolyRulers, Cross-Products, and Protractors created by the automation object will be displayed. This function is available in the Document/Medical Toolkits.

Parameter | Description
uShowFlags | Flag that indicates how to display the rulers. Possible values are:
 | Value | Meaning
 | 0 | Display neither the ruler length or the ruler gauge.
 | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 determines whether the length and gauge will be shown for the next Ruler, PolyRuler, Cross-Product, or Protractor object created in automated mode.

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.

See Also

Functions: | LAnnAutomation::GetShowFlags, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetNodes.


LAnnAutomation::SetText

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* the character string to assign */
L_UINT uFlags; | /* reserved for future versions */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | The character string to assign to the annotation object.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

This function can be used to load unformatted text. Use LAnnAutomation::SetTextRTF to load rich text.

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: | LAnnAutomation::GetText, LAnnAutomation::GetTextLen, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnAutomation::GetText.


LAnnAutomation::SetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTextAlign(uTextAlign, uFlags)

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 a (text, note, or text pointer) object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 those objects (text, note, or text pointer) that display text.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAutomation::GetTextAlign.


LAnnAutomation::SetTextExpandTokens

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTextExpandTokens (bTextExpandTokens, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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:

LAnnAutomation

LAnnButton

LAnnNote

LAnnPushPin

LAnnStamp

LAnnText

LAnnTextPointer

If bTextExpandTokens is set to TRUE, then all tokens will be expanded.

For example, if you have an LAnnButton 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnAutomation::GetTextExpandTokens.


LAnnAutomation::SetTextPointerFixed

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTextPointerFixed(bPointerFixed, uFlags)

L_BOOL bPointerFixed; | /* value that specifies whether the pointer of a Text Pointer object is fixed */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the point of any TextPointer object, created using this Automation object, is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
bPointerFixed | Value that specifies whether the pointer of any TextPointer object, created using this Automation object, is fixed. Possible values are:
 | Value | Meaning
 | TRUE | All TextPointer objects created using this automation object will have a fixed pointer.
 | FALSE | All TextPointer objects created using this automation object will have a pointer that moves 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Passing TRUE for bPointerFixed fixes the pointer of any text pointer object created using this automation object. When the text pointer is fixed, the location that the text pointer points to does not change when moving the object (either programmatically or through automation).

Passing FALSE for bPointerFixed frees the pointer of any text pointer object created using this automation object. This means that when the object is moved, the location the text pointer points to moves along with 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example refer to LAnnAutomation::GetTextPointerFixed.


LAnnAutomation::SetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTextRotate(uTextRotate, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 following annotation objects can display rotated text:

ANNOBJECT_AUTOMATION

ANNOBJECT_NOTE

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

For an example refer to LAnnAutomation::GetTextRotate.


LAnnAutomation::SetTextRTF

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTextRTF(uFormat, pText, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

To get or set the text of other text objects, see the documentation
 for LAnnAutomation::GetTextLen,
 LAnnAutomation::GetText, and
 LAnnAutomation::SetText.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// 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\\anicpg1252\\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(LAnnAutomation *plAutomation, L_UINT uFormat)
{
L_TCHAR *pszFormat;
L_TCHAR szMsg[200];
L_INT nRet;

switch(uFormat)
{
case RTFFORMAT_TEXT:
pszFormat
 = TEXT("RTFFORMAT_TEXT");
nRet = plAutomation->SetTextRTF(uFormat, RICH_STRING, 0);
break;

case RTFFORMAT_RTF:
pszFormat
 = TEXT("RTFFORMAT_RTF");
nRet = plAutomation->SetTextRTF(uFormat, RICH_STRING, 0);
break;

default:
return;
break;
}

wsprintf(szMsg, TEXT("SetTextRTF returned
 %d\nFormat: %s"), nRet, pszFormat);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


LAnnAutomation::SetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTicMarkLength(dLength, uFlags)

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_RULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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.

See Also

Functions: | Class Members, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | 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

L_VOID SampleAnnTicMarkLength(LAnnAutomation *pObject)
{
L_INT nRet;
L_DOUBLE dLength;
L_TCHAR szMsg[200];

nRet = pObject->GetTicMarkLength(&dLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Old Tic
 Mark Length: %f\nNew Tic Mark Length %f"),
dLength,
2 * dLength);

pObject->SetTicMarkLength(2
 * dLength, 0);
MessageBox(NULL, szMsg, TEXT(""),
 MB_OK);
}
}


LAnnAutomation::SetTool

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTool(uTool=ANNTOOL_SELECT)

L_UINT uTool;

/* constant that specifies the selected tool */

Specifies the default tool, which is maintained by the Automation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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_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

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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::GetTool, LAnnotation::GetUserMode, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::SetAutoContainer.


LAnnAutomation::SetTransparent

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTransparent(bTransparent, uFlags=0)

L_BOOL bTransparent; | /* flag that indicates whether to make the bitmap transparent */
L_UINT uFlags; | /* reserved for future versions */

Sets 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
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 | Reserved for future versions, use 0.

Returns

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

Comments

Only Point and Stamp objects that are using a bitmap can be set 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.

The next stamp created will be transparent.

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: | Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions (Document/Medical only) Displaying Annotations

Example

void TestAnnWnd(LAnnAutomation L_FAR*pLAnnAutomation)
{
pLAnnAutomation->SetTransparent(TRUE);
}


LAnnAutomation::SetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetTransparentColor(crTransparent, uFlags=0)

COLORREF crTransparent; | /* transparent color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
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.
 | Document/Medical toolkits 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 LBitmapBase::GetPixelColor.
uFlags | Flags that determine which objects to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only Point and Stamp objects that are using a bitmap can be set to use a transparent color.

This transparent color is used only if the object is set to transparent using the LAnnAutomation::SetTransparentfunction.

By default, the transparent color is white (0x00FFFFFF).

All objects created by this automation object will have this transparent color.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

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: | LAnnAutomation::GetTransparentColor, LAnnAutomation::SetTransparent, LAnnAutomation::SetAutoHilightPen
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

//This example uses the following member variables:
// m_AnnotationWindow should be created and initialized prior to the example
LAnnotationWindow m_AnnotationWindow;
void OnButton6()
{
COLORREF ColorRef;
L_TCHAR szTemp[100];

m_AnnotationWindow.GetAutomationObject().SetTransparentColor(RGB(255,0,0));
m_AnnotationWindow.GetAutomationObject().SetTransparent(TRUE);
m_AnnotationWindow.GetAutomationObject().GetTransparentColor(&ColorRef);

wsprintf(szTemp,TEXT("Transparent Color: %x"),ColorRef);
AfxMessageBox(szTemp);
}


LAnnAutomation::SetUndoDepth

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetUndoDepth(uLevels=5)

L_UINT uLevels;

/* number of levels */

Specifies the number of user actions that can be reversed using the LAnnAutomation::Undo function. This function is available in the Document/Medical Toolkits.

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

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetTool, LAnnotation::GetUserMode, LAnnAutomation::Undo, LAnnAutomation::GetTool, LAnnContainer::SetUserMode, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnAutomation::SetAutoContainer.


LAnnAutomation::SetUnit

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::SetUnit(uUnit, pUnitAbbrev, uPrecision, uFlags=0)

L_UINT uUnit; | /* the unit of measurement to set */
L_TCHAR L_FAR * pUnitAbbrev; | /* character string containing the unit abbreviation string */
L_UINT uPrecision; | /* number of digits to be displayed after the decimal place */
L_UINT uFlags; | /* reserved for future versions */

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
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 | 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.
uFlags | Reserved for future versions, use 0.

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_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 LAnnAutomation::GetUnit function or the LAnnRuler::GetUnit 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 LAnnAutomation::SetUnit or the LAnnRuler::SetUnit 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.

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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::GetUnit, LAnnAutomation::GetDistance, LAnnAutomation::SetGaugeLength, LAnnAutomation::GetGaugeLength, Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnAutomation::GetDistance.


LAnnAutomation::Undo

#include "ltwrappr.h"

virtual L_INT LAnnAutomation::Undo(uLevels=1)

L_UINT uLevels;

/* number of undo operations */

Reverses the last user action that was executed using the automated annotation functions. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLevels | Number of undo operations to be done.

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 LAnnAutomation::SetUndoDepth 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.

See Also

Functions: | LAnnAutomation::GetAutoContainer, LAnnAutomation::SetTool, LAnnotation::GetUserMode, LAnnAutomation::SetUndoDepth, LAnnAutomation::GetTool, LAnnContainer::SetUserMode, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

/* This example reverses the last user action in automation
 mode. */
L_VOID TestUndo(LAnnAutomation L_FAR * pAnnAutomation)
{
pAnnAutomation->Undo();
}


LAnnButton::LAnnButton

#include "ltwrappr.h"

L_VOID LAnnButton::LAnnButton(bCreate=TRUE)

L_VOID LAnnButton::LAnnButton(hButton)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hButton; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnButton object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hButton | Handle of the associated annotation object.

Returns

None

Comments

LAnnButton::LAnnButton(bCreate) is a constructor for the LAnnButton class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnButton::LAnnButton(hButton) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_BUTTON. The passed annotation object is invalidated.

The parameter hButton is passed by reference, and is a required 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.

See Also

Functions:

LAnnButton::~LAnnButton, Class Members

Example

This is an example for LAnnButton::LAnnButton(bCreate):

L_VOID TestConstructor()
{
// this will call the default constructor and
 destructor when it is out of scope
LAnnButton LeadAButton(TRUE)
 ;

//...
}

This is an example for LAnnButton::LAnnButton(hButton):

L_VOID TestConstructor (HANNOBJECT& hButton)
{
// this will call the default constructor and
 destructor when it is out of scope
LAnnButton LeadAButton(hButton)
 ;

//...
}


LAnnButton::~LAnnButton

#include "ltwrappr.h"

virtual L_VOID LAnnButton::~LAnnButton(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnButton class.

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:

Class Members

Example

For an example, refer to LAnnButton::LAnnButton.


LAnnButton::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnButton::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a Button object
L_VOID ExampleAnnAddUserHandle(LAnnButton *pLButton)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLButton->GetType();
if (uType == ANNOBJECT_BUTTON)
{
pLButton->GetRect (&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;
pLButton->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLButton->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Button."), TEXT("Error"), MB_OK);
}


LAnnButton::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnButton::ChangeUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of the user handle to change. This index is zero-based.
pAnnHandle | Pointer to an ANNHANDLE 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 LAnnButton::AddUserHandle and LAnnButton::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnButton *LButton)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LButton->GetUserHandles(NULL,
 &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LButton->GetUserHandle(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;
LButton->ChangeUserHandle(0,
 &AnnHandle);
}
else
MessageBox(NULL, TEXT("No
 User Handles!"), TEXT("Error"), MB_OK);
}


LAnnButton::Create

#include "ltwrappr.h"

virtual L_INT LAnnButton::Create(L_VOID)

Creates a Button annotation object. 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 use the LAnnButton::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnButton LeadButton(FALSE); //construct an annotation button object

if (LeadButton.Create()==SUCCESS)
{
//... do something here
}
}


LAnnButton::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnButton::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnButton *LButton)
{
L_UINT uCount;

// Get the total
 count of user handles
LButton->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
LButton->DeleteUserHandle(0);
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnButton::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnButton::EnumerateHandles()

Calls the LAnnButton::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object This function is available in the Document/Medical Toolkits.

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 LAnnButton::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnButton: public LAnnButton
{
public:
virtual
 L_INT EnumHandleCallBack(HANNOBJECT
 hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnButton::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO
 pHandleInfo)
{
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(MyAnnButton *LButton)
{
LButton->EnableCallBack(TRUE);
LButton->EnumerateHandles();
}


LAnnButton::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnButton::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object*/
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnButton::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to an ANNHANDLEINFO structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnButton::EnumerateHandles 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 LAnnButton::ChangeUserHandle.

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.

To enable the LAnnButton::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnButton::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnButton::EnumerateHandles.


LAnnButton::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnButton::GetFixed(pbFixed)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnButton::SetFixed.


LAnnButton::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnButton::GetForeColor(L_VOID)

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnButton L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnButton::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnButton::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the annotation
 Button in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnButton * pLButton)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLButton->GetRotateAngle(&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);
}
}


LAnnButton::GetText

#include "ltwrappr.h"

virtual L_INT LAnnButton::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated with the annotation object's character string */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

The LAnnButton class gets and sets text without formatting. Use the LAnnRTF class to use formatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object
 passed by the caller */
L_VOID TestModifyAnn (LAnnButton L_FAR * pAnnObject)
{
L_TCHAR L_FAR *pText; /* The object's text */
L_UINT TextLength; /* Length of the object's text
 */
LBuffer LeadBuffer
 ;

/* Get the length of the current text */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new
 text */
TextLength += 6;

LeadBuffer.Reallocate((DWORD)TextLength*sizeof(L_TCHAR));

pText = (L_TCHAR L_FAR *)LeadBuffer.Lock()
 ;

/* Get the current text */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current
 text */
lstrcat(pText,TEXT(" - New"));

pAnnObject->SetText(pText,
 0);

LeadBuffer.Unlock()
 ;
}


LAnnButton::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnButton::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object'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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnButton::GetText.


LAnnButton::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnButton::GetUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to an ANNHANDLE 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 Button 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnButton *LButton)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total
 count of user handles
LButton->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
{
memset(&AnnHandle,
 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize
 = sizeof(&AnnHandle);
LButton->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0,
 &AnnHandle);
}
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnButton::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnButton::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of ANNHANDLEstructures 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
pAnnHandle | Array of ANNHANDLEstructures 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnButton * LButton)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate
 memory
LButton->GetUserHandles(NULL,
 &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LButton->GetUserHandles(pAnnHandle,
 &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle
 + i);

free(pAnnHandle);
}


LAnnButton::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnButton::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnButton::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLButton -- Pointer to LAnnButton annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnButton *pLButton)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLButton->IsFixedInRect(&rcClient,
 ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed
 annotations visible."): TEXT("There are NO fixed annotations
 visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnButton::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnButton::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnButton::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnButton::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnButton::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnButton::PushFixedState / LAnnButton::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnButton::PushFixedState and LAnnButton::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnButton::PushFixedState (); | Fixed state is temporarily disabled
LAnnButton::PushFixedState (); | Fixed state is temporarily disabled
LAnnButton::PopFixedState (); | Fixed state is still disabled
LAnnButton::PopFixedState (); | Fixed state is enabled

Note that LAnnButton::PushFixedState and LAnnButton::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of
 all objects in the container that
// have been temporarily disabled with a call to LAnnButton::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnButton *pLButton)
{
pLButton->PopFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnButton::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnButton::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnButton::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnButton::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnButton::PushFixedState / LAnnButton::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnButton::PushFixedState and LAnnButton::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnButton::PushFixedState (); | Fixed state is temporarily disabled
LAnnButton::PushFixedState (); | Fixed state is temporarily disabled
LAnnButton::PopFixedState (); | Fixed state is still disabled
LAnnButton::PopFixedState (); | Fixed state is enabled

Note that LAnnButton::PushFixedState and LAnnButton::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed"
 property of all objects in the container
// This is useful when fixed objects need to be temporarily painted larger
 or smaller than
// the fixed size. For an example using the magnifying glass, see the source
 code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnButton *pLButton)
{
pLButton->PushFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnButton::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnButton::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnButton *pLButton)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLButton->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLButton->SetFixed(bFixed,
 TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed"):
 TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""),
 MB_OK);
}
else
{
wsprintf(szMsg, TEXT("LAnnButton::GetFixed
 failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"),
 MB_OK);
}
}


LAnnButton::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnButton::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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 the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnButton::GetForeColor.


LAnnButton::SetText

#include "ltwrappr.h"

virtual L_INT LAnnButton::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* the character string to assign */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | The character string to assign to the annotation object.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 LAnnButton class gets and sets text without formatting. Use the LAnnRTF class to use formatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnButton::GetText.


LAnnContainer::LAnnContainer

#include "ltwrappr.h"

L_VOID LAnnContainer::LAnnContainer(L_VOID)

L_VOID LAnnContainer::LAnnContainer(hContainer)

L_VOID LAnnContainer::LAnnContainer(hWnd, pRect, bVisible)

HANNOBJECT& hContainer; | /* handle of the associated annotation object */
HWND hWnd; | /* handle to the window */
pANNRECT pRect; | /* pointer to a structure */
L_BOOL bVisible; | /* flag that indicates whether the container will be visible */

Constructs and initializes the member variables of the LAnnContainer object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hContainer | Handle of the associated annotation object.
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.
bVisible | Flag that indicates whether the container will be visible or not. Possible values are:
 | Value | Meaning
 | TRUE | The container is visible (although transparent).
 | FALSE | The container is not visible.

Returns

None

Comments

LAnnContainer::LAnnContainer() is the default constructor for the LAnnContainer class.

LAnnContainer::LAnnContainer(hWnd, pRect, bVisible) creates the associated Container annotation object with the specified bounding rectangle and window handle.

LAnnContainer::LAnnContainer(hContainer) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_CONTAINER. The passed annotation object is invalidated.

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:

LAnnContainer::~LAnnContainer, Class Members

Example

This is an example for LAnnContainer::LAnnContainer():

L_VOID TestConstructor()
{
// this will call the default constructor and
 destructor when it is out of scope
LAnnContainer LeadAContainer ;

//...
}

This is an example for LAnnContainer::LAnnContainer(hWnd, pRect, bVisible):

L_VOID TestConstructor (HWND hWnd)
{
ANNRECT AnnRect ;

AnnRect.left = 10 ;
AnnRect.top = 10 ;
AnnRect.right = 60 ;
AnnRect.bottom = 60;

// this will call the default constructor and
 destructor when it is out of scope
LAnnContainer LeadAContainer(hWnd,&AnnRect,TRUE)
 ;

//...

LeadAContainer.SetUserMode(ANNUSER_RUN);

//...
}

This is an example for LAnnContainer::LAnnContainer(hContainer):

L_VOID TestConstructor (HANNOBJECT& hContainer)
{
// this will call the default constructor and
 destructor when it is out of scope
LAnnContainer LeadAContainer(hContainer) ;

//...
}


LAnnContainer::~LAnnContainer

#include "ltwrappr.h"

virtual L_VOID LAnnContainer::~LAnnContainer(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnContainer class.

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:

LAnnContainer::LAnnContainer, Class Members

Example

For an example, refer to LAnnContainer::LAnnContainer.


LAnnContainer::Convert

#include "ltwrappr.h"

virtual LAnnotation L_FAR * LAnnContainer::Convert(pPoints, pAnnPoints, nCount, nConvert)

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

See Also

Functions: | LAnnContainer::HitTest, Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnContainer::RestrictCursor.


LAnnContainer::CopyFromClipboard

#include "ltwrappr.h"

virtual L_INT LAnnContainer::CopyFromClipboard(hWnd)

HWND hWnd;

/* handle to the window */

Copies an annotation object from the clipboard to the 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.

Returns

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

Comments

You can use LAnnotation::CopyToClipboard or LAnnotation::CutToClipboard to place valid annotation data on the clipboard.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnContainer::Create.


LAnnContainer::Create

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Create(hWnd, pRect, bVisible=FALSE)

HWND hWnd; | /* handle to the window */
pANNRECT pRect; | /* pointer to a structure */
L_BOOL bVisible; | /* Flag that indicates whether the container will be visible */

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

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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(HWND hWnd,LAnnLine& LeadAnnLine)
{
LAnnContainer LeadAContainer;
ANNRECT AnnRect ;

AnnRect.left = 30 ;
AnnRect.top = 20 ;
AnnRect.right = 100 ;
AnnRect.bottom = 100 ;

LeadAContainer.Create(hWnd,&AnnRect,TRUE) ;

LeadAContainer.Insert(LeadAnnLine,FALSE) ;

if (LeadAContainer.CopyFromClipboard(hWnd) == SUCCESS)
MessageBox(hWnd,TEXT("The clipboard has annotations ..."), TEXT("Clipboard"),MB_OK) ;
}


LAnnContainer::DeletePage

#include "ltwrappr.h"

virtual L_INT LAnnContainer::DeletePage(pszFile, nPage)

L_TCHAR * 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 LAnnContainer::FileInfo.

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: | LAnnContainer::DeletePageMemory, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, LAnnContainer::Load, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

For an example, refer to LAnnContainer::FileInfo.


LAnnContainer::DeletePageMemory

#include "ltwrappr.h"

virtual L_INT LAnnContainer::DeletePageMemory(hMem, puMemSize, nPage)

HGLOBAL hMem; | /* 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
hMem | Handle to the allocated memory where the file is stored.
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 LAnnContainer::FileInfoMemory.

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: | LAnnContainer::DeletePage, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, LAnnContainer::Load, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, Class Members
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

For an example, refer to LAnnContainer::FileInfoMemory.


LAnnContainer::DeletePageOffset

#include "ltwrappr.h"

virtual L_INT LAnnContainer::DeletePageOffset(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 LAnnContainer::FileInfoOffset.

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: | LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, LAnnContainer::Load, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, Class Members
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

For an example, refer to LAnnContainer::FileInfoOffset.


LAnnContainer::EncryptApply

#include "ltwrappr.h"

virtual L_INT LAnnContainer::EncryptApply(uEncryptFlags, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnContainer::EncryptApply 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.

LAnnContainer::EncryptApply calls LBitmap::Scramble internally to shuffle the pixels. For more information, refer to LBitmap::Scramble.

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: | Class Members, LBitmap::Scramble, LAnnEncrypt Class Members
Topics: | Annotation Functions (Document/Medical only)Realizing to a Bitmap
 | Encrypt Tool
 | Encrypt Annotation Object

Example

// This example takes a pointer to an LAnnEncrypt 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 continuev
// 5. Removes the scrambling by applying the decryptor
L_VOID ExampleEncryptor(LAnnContainer *pLContainer, LAnnEncrypt *pLEncrypt)
{
L_UINT uObjectType;
ANNENCRYPTOPTIONS EncryptOptions;
L_INT nRet;

uObjectType = pLContainer->GetType();
if (uObjectType != ANNOBJECT_CONTAINER)
{
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;
pLEncrypt->GetEncryptOptions(&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;
pLEncrypt->SetEncryptOptions(&EncryptOptions,
 0);

// Apply the encryptor
pLContainer->EncryptApply(ANNENCRYPTAPPLY_ENCRYPTOR,
 0);

nRet = MessageBox(NULL, TEXT("Encryptor has
 been applied. Would you like to remove the encryption?"), TEXT(""),
 MB_YESNO);
if (nRet == IDYES)
{
pLContainer->EncryptApply(ANNENCRYPTAPPLY_DECRYPTOR,
 0);
}
}


LAnnContainer::Enumerate

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Enumerate(uFlags=ANNFLAG_SELECTED, pUserList=NULL)

L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR *pUserList; | /* list of users */

Let’s you process all of the annotation objects in a Container. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.
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 LAnnContainer::Enumerate function calls LAnnContainer::EnumerateCallBack 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations

Example

For an example, refer to LAnnotation::SetUser.


LAnnContainer::EnumerateCallBack

#include "ltwrappr.h"

virtual L_INT LAnnContainer::EnumerateCallBack(hObject)

HANNOBJECT hObject;

/* handle of the object to be processed */

Processes each annotation object from the LAnnContainer::Enumerate function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the object to be processed.

Returns

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

Comments

The LAnnContainer::Enumerate function calls this callback function as it gets the handle of each annotation object.

Override this callback function in order to be called when enumerating container objects.

You can attach hObject to an LAnnotation class object and call LAnnotation::GetType to determine the annotation object type.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations

Example

For an example, refer to LAnnContainer::Enumerate.


LAnnContainer::FileInfo

#include "ltwrappr.h"

virtual L_INT LAnnContainer::FileInfo(pszFile, pAnnFileInfo, uStructSize)

L_TCHAR * 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 LAnnContainer::FileInfo 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

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: | LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, LAnnContainer::Load, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

L_VOID TestFunction(LAnnContainer & AnnContainer, L_TCHAR * szFile, L_UINT uFormat)
{
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMessage[256];
L_TCHAR * szFormat;

// Save the annotations as the first page of the file
AnnContainer.Save(szFile, uFormat, FALSE);

// Flip and then save as the second page of the file
AnnContainer.Flip(NULL, ANNFLAG_RECURSE);

SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;
AnnContainer.Save(szFile, uFormat, FALSE, &SaveFileOption);

// Rotate and then save as the third page of the file
AnnContainer.Rotate(45.0, NULL, ANNFLAG_RECURSE);

SaveFileOption.PageNumber = 3;
AnnContainer.Save(szFile, uFormat, FALSE, &SaveFileOption);

// Get information about the file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
AnnContainer.FileInfo(szFile, &AnnFileInfo, sizeof(AnnFileInfo));

switch (AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
szFormat = TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
szFormat = TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
szFormat = TEXT("ANNFMT_ENCODED");
break;

default:
szFormat = TEXT("Unknown");
break;
}

wsprintf(szMessage, TEXT("File Name: %s\nVersion: %d\nFormat: %s\nTotal Pages: %d"), szFile, AnnFileInfo.nVersion, szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL, szMessage, TEXT("Information"), MB_OK);

// Now, delete the second page
AnnContainer.DeletePage(szFile, 2);

// Again, get information about the file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = 0;
AnnContainer.FileInfo(szFile, &AnnFileInfo, sizeof(AnnFileInfo));

wsprintf(szMessage, TEXT("File Name: %s\nVersion: %d\nFormat: %s\nTotal Pages: %d"), szFile, AnnFileInfo.nVersion, szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL, szMessage, TEXT("Information"), MB_OK);
}


LAnnContainer::FileInfoMemory

#include "ltwrappr.h"

virtual L_INT LAnnContainer::FileInfoMemory(pMem, uMemSize, pAnnFileInfo, uStructSize)

L_UCHAR * 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.
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 stored in memory.

To use this function, do the following:

1. | Assign variables for the memory location of the file located in memory and for its size.
2. | Declare a variable of type 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 LAnnContainer::FileInfoMemory 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

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: | LAnnContainer::FileInfo, LAnnContainer::FileInfoOffset, LAnnContainer::Load, LAnnContainer::LoadOffset, LAnnContainer::LoadMmeory, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, Class Members
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

L_VOID TestFunction(LAnnContainer & AnnContainer, L_UINT
 uFormat)
{
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMessage[256];
L_TCHAR * szFormat;
HGLOBAL hMem = NULL;
L_UINT32 uMemSize;
L_UCHAR * pMem;

// Save the annotations as the first page of the
 file in memory
AnnContainer.SaveMemory(uFormat,
 FALSE, &hMem, &uMemSize);

// Flip and then save as the second page
AnnContainer.Flip(NULL,
 ANNFLAG_RECURSE);

SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;
AnnContainer.SaveMemory(uFormat,
 FALSE, &hMem, &uMemSize, &SaveFileOption);

// Rotate and then save as the third page
AnnContainer.Rotate(45.0,
 NULL, ANNFLAG_RECURSE);

SaveFileOption.PageNumber = 3;
AnnContainer.SaveMemory(uFormat,
 FALSE, &hMem, &uMemSize, &SaveFileOption);

// Get information
 about the file in memory
AnnFileInfo.uStructSize
 = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset
 = 0;
pMem = (L_UCHAR
 *) GlobalLock(hMem);
AnnContainer.FileInfoMemory(pMem, uMemSize, &AnnFileInfo,
 sizeof(AnnFileInfo));
GlobalUnlock(hMem);

switch (AnnFileInfo.uFormat)
{
case
 ANNFMT_NATIVE:
szFormat
 = TEXT("ANNFMT_NATIVE");
break;

case
 ANNFMT_WMF:
szFormat
 = TEXT("ANNFMT_WMF");
break;

case
 ANNFMT_ENCODED:
szFormat
 = TEXT("ANNFMT_ENCODED");
break;

default:
szFormat
 = TEXT("Unknown");
break;
}

wsprintf(szMessage,
 TEXT("Version: %d\nFormat: %s\nTotal Pages: %d"), AnnFileInfo.nVersion,
 szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL,
 szMessage, TEXT("Information"), MB_OK);

// Now, delete
 the second page
AnnContainer.DeletePageMemory(hMem,
 &uMemSize, 2);

// Again, get
 information about the file in memory
AnnFileInfo.uStructSize
 = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset
 = 0;
pMem = (L_UCHAR
 *) GlobalLock(hMem);
AnnContainer.FileInfoMemory(pMem, uMemSize, &AnnFileInfo,
 sizeof(AnnFileInfo));
GlobalUnlock(hMem);

wsprintf(szMessage
 TEXT("Version: %d\nFormat: %s\nTotal Pages: %d"), AnnFileInfo.nVersion,
 szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL,
 szMessage, TEXT("Information"), MB_OK);

GlobalFree(hMem);
}


LAnnContainer::FileInfoOffset

#include "ltwrappr.h"

virtual L_INT LAnnContainer::FileInfoOffset(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 LAnnContainer::FileInfoOffset 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

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: | LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory, LAnnContainer::Load, LAnnContainer::LoadMemory, LAnnContainer::LoadOffset, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations

Example

L_VOID TestFunction(LAnnContainer & AnnContainer, L_TCHAR
 * szFile, L_UINT uFormat)
{
HFILE hFile;
SAVEFILEOPTION SaveFileOption;
ANNFILEINFO AnnFileInfo;
L_TCHAR szMessage[256];
L_TCHAR * szFormat;
L_UINT32 uOffset = 30;

#ifdef UNICODE
hFile = _wcreat(szFile, 0);
#else
hFile = _lcreat(szFile, 0);
#endif

   _lwrite(hFile,
 "This is a 29-character string", uOffset);

// Save the annotations as the first page of the
 file
AnnContainer.SaveOffset(hFile,
 uOffset, uFormat, FALSE);

// Flip and then save as the second page
AnnContainer.Flip(NULL,
 ANNFLAG_RECURSE);

SaveFileOption.uStructSize = sizeof(SAVEFILEOPTION);
SaveFileOption.Flags = ESO_INSERTPAGE;
SaveFileOption.PageNumber = 2;
AnnContainer.SaveOffset(hFile,
 uOffset, uFormat, FALSE, &SaveFileOption);

// Rotate and then save as the third page
AnnContainer.Rotate(45.0,
 NULL, ANNFLAG_RECURSE);

SaveFileOption.PageNumber = 3;
AnnContainer.SaveOffset(hFile,
 uOffset, uFormat, FALSE, &SaveFileOption);

// Get information about the file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = uOffset;
AnnContainer.FileInfoOffset(hFile,
 &AnnFileInfo, sizeof(AnnFileInfo));

switch (AnnFileInfo.uFormat)
{
case ANNFMT_NATIVE:
szFormat =
 TEXT("ANNFMT_NATIVE");
break;

case ANNFMT_WMF:
szFormat =
 TEXT("ANNFMT_WMF");
break;

case ANNFMT_ENCODED:
szFormat =
 TEXT("ANNFMT_ENCODED");
break;

default:
szFormat =
 TEXT("Unknown");
break;
}

wsprintf(szMessage, TEXT("File Name: %s\nVersion:
 %d\nFormat: %s\nTotal Pages: %d"), szFile, AnnFileInfo.nVersion,
 szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL, szMessage, TEXT("Information"),
 MB_OK);

// Now, delete the second page
AnnContainer.DeletePageOffset(hFile,
 uOffset, 2);

// Again, get information about the file
AnnFileInfo.uStructSize = sizeof(ANNFILEINFO);
AnnFileInfo.nOffset = uOffset;
AnnContainer.FileInfoOffset(hFile,
 &AnnFileInfo, sizeof(AnnFileInfo));

wsprintf(szMessage, TEXT("File Name: %s\nVersion:
 %d\nFormat: %s\nTotal Pages: %d"), szFile, AnnFileInfo.nVersion,
 szFormat, AnnFileInfo.nTotalPages);

MessageBox(NULL, szMessage, TEXT("Information"),
 MB_OK);

_lclose(hFile);
}


LAnnContainer::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnContainer::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color of the annotation object.

Comments

Default is white.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn (LAnnContainer L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnContainer::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnContainer::GetFillMode(L_VOID)

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

Value | Meaning
ANNMODE_TRANSPARENT | [0] Transparent
ANNMODE_TRANSLUCENT | [1] Translucent
ANNMODE_OPAQUE | [2] Opaque

Comments

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

Default is transparent.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnContainer L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */

/* Set the fill mode to transparent, unless it
 already is */
FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already
 transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT,
 0);
}


LAnnContainer::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnContainer::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible 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

Comments

To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.

Default is solid.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnContainer L_FAR * pAnnObject)
{
L_UINT FillPattern;
 /* Object fill pattern */

/* Set the fill
 pattern to solid, unless it already is */
FillPattern =
 pAnnObject->GetFillPattern();
if (FillPattern
 == ANNPATTERN_SOLID)
MessageBox
 (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID,
 0);
}


LAnnContainer::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnContainer::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current foreground color.

Comments

Default is black.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnContainer L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnContainer::GetGrouping

#include "ltwrappr.h"

virtual L_INT LAnnContainer::GetGrouping(pbAutoGroup)

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

See Also

Functions: | LAnnContainer::SetGrouping, LAnnotation::Group, LAnnotation::Ungroup, Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

// this example will toggle grouping for a particular sub-container.
// the parameter for this function should be a sub-container
void ToggleGrouping(LAnnContainer * plContainer)
{
L_BOOL bGrouping;
plContainer->GetGrouping(&bGrouping);
plContainer->SetGrouping(!bGrouping, 0);
}


LAnnContainer::GetItem

#include "ltwrappr.h"

virtual LAnnotation L_FAR * LAnnContainer::GetItem(L_VOID)

virtual L_INT LAnnContainer::GetItem(phItem)

pHANNOBJECT phItem;

/* address of the variable to be updated */

LAnnContainer::GetItem() gets a pointer to the first annotation object in the Container.

LAnnContainer::GetItem(phItem) gets the handle to the first annotation object in the Container.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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

LAnnContainer::GetItem() returns the following:

A pointer to the first annotation object.

LAnnContainer::GetItem(phItem) returns the following:

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 LAnnContainer::GetItem(phItem), 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.

You can attach phItem to an LAnnotation class object and call LAnnotation::GetType to determine the annotation object type.

When using LAnnContainer::GetItem(), you can call LAnnotation::GetType to determine the annotation object type of the returned 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnContainer::GetItem(phItem):

L_VOID TestFunction(LAnnContainer& LeadAContainer)
{
HANNOBJECT hAnnObject ;
LAnnotation LeadAnn ;
L_INT nRet ;

nRet = LeadAContainer.GetItem(&hAnnObject) ;

if (nRet == SUCCESS)
LeadAnn.SetHandle(hAnnObject);

//...
}

This is an example for LAnnContainer::GetItem():

L_VOID TestFunction (LAnnContainer& LeadAContainer)
{
LAnnotation L_FAR *pLeadAnn ;

pLeadAnn = LeadAContainer.GetItem() ;

pLeadAnn->CopyToClipboard() ;

//...
}


LAnnContainer::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnContainer::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style property. Possible 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

Comments

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.

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnContainer L_FAR * pAnnObject)
{
L_UINT LineStyle;
 /* Line style property of the object */
/* Set the style
 to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle
 == ANNLINE_DASH)
MessageBox
 (NULL, TEXT("Already dashed line"), TEXT("Notice"),
 MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnContainer::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnContainer::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width

Comments

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.

Default is 1.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnContainer L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth
 * 2);
}


LAnnContainer::GetObjectFromTag

#include "ltwrappr.h"

virtual L_INT LAnnContainer::GetObjectFromTag(uTag, phTagObject, uFlags=ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER)

L_UINT32 uTag; | /* unsigned 32-bit integer used as the object's tag */
pHANNOBJECT phTagObject; | /* handle to the associated annotation object */
L_UINT uFlags; | /* flags that determine which objects to process */

Retrieves a handle to the object that has the specified tag. This function is available in the Document/Medical Toolkits.

Parameter | Description
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.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

For more information on getting and setting tags, refer to LAnnotation::GetTag and LAnnotation::SetTag.

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.

See Also

Functions: | LAnnotation::GetTag, LAnnotation::SetTag
Topics: | Annotation Functions: Object Information

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized prior to the example

void CVCAnnotationToolbar11Dlg::OnButtonGetObjectFromTag()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

ANNRECT annContainerRect = {0,0,200,200};
LAnnContainer AnnContainer(m_hWnd, &annContainerRect,
 TRUE);
LAnnButton AnnButton;
HANNOBJECT TagObject;

ANNRECT annRect = {50,50,60,60};
AnnButton.SetRect(&annRect);
AnnButton.SetVisible(TRUE);
AnnButton.SetTag(2);

AnnContainer.Insert(AnnButton);

L_INT nRet = AnnContainer.GetObjectFromTag(2,&TagObject);

if (nRet==SUCCESS)
AfxMessageBox(TEXT("Object
 found"));
}


LAnnContainer::GetSelectCount

#include "ltwrappr.h"

virtual L_UINT LAnnContainer::GetSelectCount(L_VOID)

Gets the number of selected items in the Container. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnContainer::GetSelectItems.


LAnnContainer::GetSelectItems

#include "ltwrappr.h"

virtual L_INT LAnnContainer::GetSelectItems(pItems)

pHANNOBJECT pItems;

/* pointer to an array to be updated */

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
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 LAnnContainer::GetSelectCount 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction (LAnnContainer& LeadAContainer)
{
L_UINT uCount ;
LBuffer LeadBuffer ;
pHANNOBJECT pBuffer ;

uCount = LeadAContainer.GetSelectCount() ;

LeadBuffer.Reallocate(uCount * sizeof (HANNOBJECT));
pBuffer = (pHANNOBJECT)LeadBuffer.Lock() ;

LeadAContainer.GetSelectItems(pBuffer) ;

LeadBuffer.Unlock() ;

//...
}


LAnnContainer::GetSelectRect

#include "ltwrappr.h"

virtual L_INT LAnnContainer::GetSelectRect(pRect)

LPRECT pRect;

/* pointer to a RECT variable to be updated */

Gets the rectangle in the associated window that surrounds all selected annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
pRect | Pointer to a 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnContainer& LeadAContainer)
{
RECT Rect ;
L_INT nRet = 0 ;
L_TCHAR szMessage[256] ;

nRet = LeadAContainer.GetSelectRect(&Rect) ;

if (nRet == SUCCESS)
{
wsprintf(szMessage, TEXT("Rectangle: Left = %d\n Top = %d\n Right = %d \n Bottom = %d \n"),
Rect.left,Rect.top,Rect.right,Rect.bottom) ;
MessageBox(NULL,szMessage, TEXT("Boundaries"),MB_OK);
}
}


LAnnContainer::HitTest

#include "ltwrappr.h"

virtual LAnnotation L_FAR * LAnnContainer::HitTest(pPoint, puResult)

virtual L_INT LAnnContainer::HitTest(pPoint, puResult, phObjectHit)

LPPOINT pPoint; | /* pointer to the POINT structure */
L_UINT L_FAR * puResult; | /* position on the annotation object that was hit */
pHANNOBJECT phObjectHit; | /* handle to the annotation object that was hit */

LAnnContainer::HitTest(pPoint, puResult, phObjectHit) gets the handle to the annotation object that is located at a specified point. If objects overlap, this function gets the front object.

LAnnContainer::HitTest(pPoint, puResult) gets 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
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

LAnnContainer::HitTest(pPoint, puResult, phObjectHit) returns the following:

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

LAnnContainer::HitTest(pPoint, puResult) returns the following:

A pointer to the annotation object that is located at the specified point. The user is responsible for deleting the returned object.

Comments

Before calling LAnnContainer::HitTest(pPoint, puResult, phObjectHit), you must declare a variable of data type HANNOBJECT. Then pass the address of the variable in the phObjectHit parameter. This function will update the variable with the handle of the object located at the specified point.

You can attach phObjectHit to an LAnnotation class object and call LAnnotation::GetType to determine the annotation object type.

When using LAnnContainer::HitTest(pPoint, puResult), you can call LAnnotation::GetType to determine the annotation object type of the returned 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

This is an example forLAnnContainer::HitTest(pPoint, puResult, phObjectHit):

L_VOID TestHitTest (LAnnContainer& LeadAContainer,pHANNOBJECT phAnnObject,
L_INT xFromWindow, L_INT yFromWindow)
{
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
LeadAContainer.HitTest( &PointToTest, &TestResult, &ThisObject);

// Update the caller's object variable
if (TestResult == ANNHIT_NONE)
*phAnnObject = 0;
else
*phAnnObject = ThisObject;
}

This is an example for LAnnContainer::HitTest(pPoint, puResult):

L_VOID TestHitTest (LAnnContainer& LeadAContainer,LAnnotation L_FAR * pLeadAnn,
L_INT xFromWindow, L_INT yFromWindow)
{
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
pLeadAnn = LeadAContainer.HitTest( &PointToTest, &TestResult);
}


LAnnContainer::HitTestExt

#include "ltwrappr.h"

virtual LAnnotation L_FAR * LAnnContainer::HitTestExt(pPoint, puResult, pHitTestInfo, uStructSize)

virtual L_INT LAnnContainer::HitTestExt(pPoint, puResult, phObjectHit, pHitTestInfo, uStructSize)

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 */
pHITTESTINFO pHitTestInfo; | /* pointer to a structure that provides hit test information */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pHitTestInfo */

This function encapsulates LAnnContainer::HitTest, which gets the handle to the annotation object that is located at a specified point. (If objects overlap, it gets the front object.)

LAnnContainer::HitTestExt provides 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
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.
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 HITTESTINFO 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(HITTESTINFO).

Returns

LAnnContainer::HitTestExt(pPoint, puResult, phObjectHit, pHitTestInfo, uStructSize) returns the following:

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

LAnnContainer::HitTestExt(pPoint, puResult, pHitTestInfo, uStructSize) returns the following:

A pointer to the annotation object that is located at the specified point. The user is responsible for deleting the returned object.

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.

See Also

Functions: | LAnnContainer::HitTest, Class Members, LAnnotation::GetRotateOptions, LAnnotation::SetRotateOptions
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information

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(LAnnContainer *pLContainer, 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 = pLContainer->HitTestExt(&ptPointToTest,
 &uResult, &hObject, &HitTestInfo, sizeof(HitTestInfo));
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;
}


LAnnContainer::Insert

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Insert(LAnnObject, bStripContainer=FALSE)

LAnnotation& LAnnObject; | /* the annotation object to insert */
L_BOOL bStripContainer; | /* flag that indicates whether to insert a container */

Inserts the specified annotation object into the Container. This function is available in the Document/Medical Toolkits.

Parameter | Description
LAnnObject | The annotation object to insert.
bStripContainer | Flag that indicates whether to insert a container. Possible values are:
Value | Meaning
TRUE | If the LAnnObject parameter specifies a container, only the objects in the container will be inserted into the new container. In this case, the container specified in LAnnObject is destroyed.
FALSE | If the LAnnObject 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 LAnnObject 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 LAnnObject is a single annotation object, set bStripContainer to FALSE. That way the object itself is inserted.

If LAnnObject is a container, setting bStripContainer to TRUE will insert only the objects within the container, not the container itself.

If LAnnObject is a container, setting bStripContainer 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnContainer::Create.


LAnnContainer::Load

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Load(pFile, pLoadFileOption=NULL)

L_TCHAR L_FAR * pFile; | /* name of the file to load */
pLOADFILEOPTION pLoadFileOption; | /* 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.
pLoadFileOption | 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

LAnnContainer::Load 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.

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: | LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

L_VOID TestLoadSave(HWND hWnd)
{
LAnnContainer LeadAContainer
 ;
RECT rcClient ;
ANNRECT AnnRect ;

GetClientRect(hWnd,&rcClient) ;

AnnRect.left = rcClient.left + 15 ;
AnnRect.top = rcClient.top + 15 ;
AnnRect.right = rcClient.right - 15 ;
AnnRect.bottom = rcClient.bottom - 15;

LeadAContainer.Create(hWnd,&AnnRect,TRUE)
 ;

LeadAContainer.Save(
 TEXT("TEST.ANN")) ;

//...

LeadAContainer.Load(TEXT("TEST.ANN"))
 ;
}


LAnnContainer::LoadMemory

#include "ltwrappr.h"

virtual L_INT LAnnContainer::LoadMemory(pMem, uMemSize)

L_UCHAR L_FAR * pMem; | /* pointer to the file in memory to be loaded */
L_UINT32 uMemSize; | /* size of the file in memory */

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

Returns

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

Comments

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.

See Also

Functions: | LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

L_VOID TestLoadSaveAnnMem(LAnnContainer L_FAR * pLeadAContainer)
{
LAnnContainer 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

// Load the initial annotations
TmpContainer.Load(
 TEXT("TEST.ANN"));

hFileInMemory = GlobalAlloc(GMEM_MOVEABLE,1024) ;

// Save the annotations as a file in memory
TmpContainer.SaveMemory(
 ANNFMT_NATIVE, FALSE, &hFileInMemory, &uMemSize);

// Destroy the temporary container
TmpContainer.Destroy(
 ANNFLAG_RECURSE);

// Get the pointer to the memory-resident file
pData = (L_UCHAR L_FAR *) GlobalLock (hFileInMemory);

// Load the new file from memory
pLeadAContainer->LoadMemory((L_UCHAR
 L_FAR *)pData, uMemSize);

/* Clean up */
GlobalUnlock (hFileInMemory);
GlobalFree (hFileInMemory);
}


LAnnContainer::LoadOffset

#include "ltwrappr.h"

virtual L_INT LAnnContainer::LoadOffset(fd, nOffset, nLength, pLoadFileOption)

L_INT fd; | /* the Windows file handle */
L_INT32 nOffset; | /* position of the first byte to load */
L_UINT32 nLength; | /* number of bytes of annotation data to read */
pLOADFILEOPTION pLoadFileOption; | /* pointer to a LOADFILEOPTION structure */

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 LAnnContainer::SaveOffset, 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.
pLoadOptions | Pointer to the LOADFILEOPTIONstructure to be updated with the current extended values.

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.

See Also

Functions: | LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, LAnnContainer::DeletePageOffset, LAnnContainer::FileInfo, LAnnContainer::FileInfoMemory, LAnnContainer::FileInfoOffset, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

L_VOID TestLoadSaveOffset(LAnnContainer& LeadAContainer)
{
HFILE OffsetFile; // File handle
L_UINT32 ulSizeWritten; // Variable to be updated with the size written

// Create a file
#ifdef UNICODE

OffsetFile = _wcreat(TEXT("TOFFSET.ANN"), 0);
#else

   OffsetFile = _lcreat("TOFFSET.ANN",
 0);
#endif
// Write header information -- 29 characters and a terminator
_lwrite(OffsetFile, "This is a 29-character string",
 30);

// Save the file with an offset
ulSizeWritten = LeadAContainer.SaveOffset(OffsetFile,
 30, ANNFMT_NATIVE, FALSE);

// Close the file
_lclose(OffsetFile);

/* Loading */

// Open the file and get the file handle
#ifdef UNICODE

OffsetFile = _wopen(TEXT("TOFFSET.ANN"), OF_READ|OF_SHARE_DENY_WRITE );
#else

   OffsetFile = _lopen("TOFFSET.ANN",
 OF_READ|OF_SHARE_DENY_WRITE );
#endif
// Load the file with a 30-byte offset
LeadAContainer.LoadOffset(OffsetFile,
 30, ulSizeWritten, NULL);

// Close the file
_lclose(OffsetFile);
}


LAnnContainer::Realize

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly=TRUE)

virtual L_INT LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly=TRUE)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT prcBounds; | /* pointer to a structure */
L_BOOL bRedactOnly; | /* 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.
pBitmap | Pointer to the LBitmapBase object 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.
bRedactOnly | 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

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 LAnnContainer::Unrealize.

This function is implemented by treating the bitmap as a device context and drawing the annotations in the device context.

When you call LAnnContainer::Realize with bRedactOnly 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 LAnnContainer::Unrealize. 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 LAnnContainer::Realize with bRedactOnly 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 LAnnContainer::Unrealize must be called each time a Redact object is unlocked.

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 LBitmapBase::ColorRes to change the image to a supported bits per pixel before calling LAnnContainer::Realize.

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: | Class Members
Topics: | Annotation Functions: Input and Output
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly) with pBitmap of type pBITMAPHANDLE:

L_VOID TestRealize(pBITMAPHANDLE pBitmap,LAnnLine& LeadAnnLine)
{
LAnnContainer LeadAContainer ;
LeadAnnLine.GetTopContainer(&LeadAContainer) ;

LeadAContainer.Realize(pBitmap,NULL);
}

This is an example for LAnnContainer::Realize(pBitmap, prcBounds, bRedactOnly) with pBitmap of type LBitmapBase L_FAR * :

L_VOID TestRealize (LBitmapBase L_FAR * pLBitmap,LAnnLine& LeadAnnLine)
{
LAnnContainer LeadAContainer ;
LeadAnnLine.GetTopContainer(&LeadAContainer) ;

LeadAContainer.Realize(pLBitmap,NULL);
}


LAnnContainer::RestrictCursor

#include "ltwrappr.h"

virtual L_INT LAnnContainer::RestrictCursor(lpRect, pPoint, prcOldClip, bRestrictClient)

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

See Also

Functions: | Class Members, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions (Document/Medical only)Realizing to a Bitmap
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

// Example for LAnnContainer::Convert, LAnnContainer::RestrictCursor
// 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(LAnnContainer *pLContainer)
{
L_UINT uType;
ANNRECT arcBounds;
RECT rcBounds;
HANNOBJECT hContainer;
RECT rcClipOld;

uType = pLContainer->GetType();

if ((uType != ANNOBJECT_AUTOMATION) && (uType
 != ANNOBJECT_CONTAINER))
{
pLContainer->GetTopContainer(&hContainer);
pLContainer->GetRect(&arcBounds,
 NULL);
pLContainer->Convert((LPPOINT)&rcBounds,
 (pANNPOINT)&arcBounds, 2, ANNCONVERT_TO_CLIENT);

rcBounds.left -= 10;
rcBounds.top -= 10;
rcBounds.right += 10;
rcBounds.bottom += 10;

pLContainer->RestrictCursor(&rcBounds,
 NULL, &rcClipOld, FALSE);

// When done with restricting cursor,
 call the line below
// ClipCursor(&rcClipOld);
}
}


LAnnContainer::Save

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Save(pFile, uFormat=ANNFMT_NATIVE, bSelected=TRUE, pSaveOptions=NULL)

L_TCHAR L_FAR * pFile; | /* name of the file to save */
L_UINT uFormat; | /* format for saving annotation data */
L_BOOL bSelected; | /* 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.
uFormat | Format for saving annotation data. Possible values are:
Value |  | Meaning
 | ANNFMT_NATIVE | [0x0000] Save the file in the native format for LEAD annotations. NOTE: This format is being replaced by ANNFMT_XML.
 | ANNFMT_WMF | [0x0001] Save the file in the Windows WMF format.
 | ANNFMT_ENCODED | [0x0004] Save the file in a binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | [0x0005] Save the file in an XML text format. This is LEAD’s new text-based format which is upward-compatible. It should be used instead of ANNFMT_NATIVE.
bSelected | 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 text-based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

Save annotations in the WMF format only for use in another application.

To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the bSelected parameter as follows:

To save only selected objects in a container, set bSelected to TRUE.

To save all objects in a container, set bSelected to FALSE.

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 LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, or LAnnContainer::DeletePageOffset.

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: | LAnnContainer::SaveMemory, LAnnContainer::SaveOffset, LAnnContainer::SaveTag, LAnnContainer::FileInfo, LAnnContainer::DeletePage, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnContainer::Load.


LAnnContainer::SaveMemory

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SaveMemory(uFormat, bSelected, phMem, puMemSize, pSaveOptions=NULL)

L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL bSelected; | /* flag that indicates which objects to save */
HGLOBAL L_FAR * phMem; | /* address of a variable to be updated with the memory handle */
L_UINT32 L_FAR * puMemSize; | /* address of a variable to be updated with the size of the file */
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
uFormat | Format for saving annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | [0x0000] Save the file in the LEADTOOLS native format for annotations. NOTE: This format is being replaced by ANNFMT_XML
 | ANNFMT_WMF | [0x0001] Save the file in 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 the file in a binary format. This file size is smaller and upward compatible. It also provides better security.
 | ANNFMT_XML | [0x0005] Save the file in an XML text format. This is LEADTOOLS new text-based format which is upward-compatible. It should be used instead of ANNFMT_NATIVE.
bSelected | 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 text based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

Save annotations in the WMF format only for use in another application.

To retain scaling and positioning information, this function always saves the root container, along with the specified object or selected objects. Use the bSelected parameter as follows:

To save only selected objects in a container, set bSelected to TRUE.

To save all objects in a container, set bSelected to FALSE.

Both the ANNFMT_TIFFTAG and the ANNFMT_WANGTAG can be saved inside a TIFF file using LFileSettings::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 LFileSettings::GetTag 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 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 LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, or LAnnContainer::DeletePageOffset.

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 LAnnContainer::SaveMemory.

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: | LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveTag, LAnnContainer::FileInfoMemory, LAnnContainer::DeletePageMemory, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnContainer::LoadMemory.


LAnnContainer::SaveOffset

#include "ltwrappr.h"

virtual L_UINT32 LAnnContainer::SaveOffset(fd, nOffset, uFormat=ANNFMT_NATIVE, bSelected=TRUE, pSaveOptions=NULL)

L_INT fd; | /* Windows file handle */
L_INT32 nOffset; | /* offset within the specified file to embed the saved annotation file */
L_UINT uFormat; | /* file format for saving annotation data */
L_BOOL bSelected; | /* 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.
uFormat | Format for saving annotation data. Possible values are:
 | Value | Meaning
 | ANNFMT_NATIVE | [0x0000] Save the file in the native format for LEAD annotations. NOTE: This format is being replaced by ANNFMT_XML.
 | ANNFMT_WMF | [0x0001] Save the file in the Windows WMF format.
 | ANNFMT_ENCODED | [0x0004] Save the file in a binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | [0x0005] Save the file in an XML text format. This is LEAD’s new text-based format which is upward-compatible. It should be used instead of ANNFMT_NATIVE.
bSelected | 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

The size of the embedded file.

Comments

In version 14.5, the text-based format ANNFMT_XML is being introduced. It has many advantages over ANNFMT_NATIVE and ANNFMT_ENCODED including:

It is both forward- and backward-compatible.

It is human readable.

It can be easily modified using a standard text editor (i.e. notepad.exe).

It can be easily parsed using any standard XML parser.

It can be used with any of the growing number of utilities that work with XML.

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 bSelected parameter as follows:

To save only selected objects in a container, set bSelected to TRUE.

To save all objects in a container, set bSelected 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 LAnnContainer::LoadOffset function. The offset is specified in bytes. You must open the file and get a Windows file handle before calling this function.

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 LAnnContainer::DeletePage, LAnnContainer::DeletePageMemory, or LAnnContainer::DeletePageOffset.

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: | LAnnContainer::Save, LAnnContainer::SaveMemory, LAnnContainer::SaveTag, LAnnContainer::FileInfoOffset, LAnnContainer::DeletePageOffset, Class Members, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Input and Output
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnContainer::LoadOffset.


LAnnContainer::SaveTag

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SaveTag(uFormat=ANNFMT_TIFFTAG, bSelected=FALSE)

L_UINT uFormat; | /* format for saving annotation data */
L_BOOL bSelected; | /* 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
uFormat | Format for saving 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.
bSelected | 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

The annotations will not be saved unless you also save an image in one of the TIFF formats (FILE_TIF_JPEG, FILE_LEAD1JTIF, FILE_LEAD2JTIF, 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).

This tag can be cleared using LFileSettings::SetTag.

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: | LFile::DeleteTag, LAnnotationWindow::AnnSave, LFile::SaveBitmap, Class Members
Topics | Annotation Functions (Document/Medical only): Saving Annotation Files

Example

L_VOID TestSaveTag(LAnnContainer& LeadAContainer)
{
L_INT nRet;

// set Wang Compatibility mode for annotations
nRet = LeadAContainer.SaveTag(
 ANNFMT_WANGTAG, FALSE);
if(nRet != SUCCESS)
MessageBox(NULL, TEXT("Error creating
 annotation data.\n The file will be saved without annotations.\n\n"),TEXT("Annotation
 Error"),MB_OK);
}


LAnnContainer::SelectPoint

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SelectPoint(pPoint)

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

See Also

Functions: | LAnnContainer::SelectRect, LAnnotation::IsSelected, Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

L_VOID Test(LAnnContainer L_FAR* pAnnContainer)
{
POINT pt={10,20};
pAnnContainer->SelectPoint(&pt);
}


LAnnContainer::SelectRect

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SelectRect(pRect)

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

See Also

Functions: | LAnnContainer::SelectPoint, LAnnotation::IsSelected, Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

L_VOID Test(LAnnContainer L_FAR* pAnnContainer)
{
RECT rc={10,20,40,70};
pAnnContainer->SelectRect(&rc);
}


LAnnContainer::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetBackColor(RGB(200,200,120));
}


LAnnContainer::SetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetBitmap(pBitmap, uFlags=0)

virtual L_INT LAnnContainer::SetBitmap(pBitmap, uFlags=0)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that indicate the objects to process */

Sets the bitmap of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap handle referencing the bitmap to assign to the specified object.
pBitmap | Pointer to the LBitmapBase object referencing the bitmap object 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

This is an example for LAnnContainer::SetBitmap(pBitmap, uFlags) with pBitmap of type pBITMAPHANDLE:

void TestAddAnn(pBITMAPHANDLE pBitmap, LAnnContainer L_FAR
 * pAnnContainer)
{
pAnnContainer->SetBitmap(pBitmap,0);
}

This is an example for LAnnContainer::SetBitmap(pBitmap, uFlags) with pBitmap of type LBitmapBase L_FAR *:

void TestAddAnnBitmap(LBitmapBase L_FAR * pLBitmap, LAnnContainer
 L_FAR * pAnnContainer)
{
pAnnContainer->SetBitmap(pLBitmap,0);
}


LAnnContainer::SetDpiX

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetDpiX(dDpiX, uFlags=0)

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

Typically, if you are matching annotations to a bitmap, you can use the bitmap object'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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetDpiX(150);
pAnnContainer->SetDpiY(150);
}


LAnnContainer::SetDpiY

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetDpiY(dDpiY, uFlags=0)

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
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 | Reserved for future use. You can pass 0.

Returns

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

Comments

Typically, if you are matching annotations to a bitmap, you can use the bitmap object’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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnContainer::SetDpiX.


LAnnContainer::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

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 the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFillMode(ANNMODE_TRANSPARENT,ANNFLAG_RECURSE);
}


LAnnContainer::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFillPattern(uFillPattern=ANNPATTERN_SOLID, uFlags=0)

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that indicate which objects to process */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFillPattern(ANNPATTERN_DIAGCROSS,ANNFLAG_RECURSE);
}


LAnnContainer::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold
 | FALSE | Make the font not bold.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontBold(FALSE);
}


LAnnContainer::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontItalic(FALSE);
}


LAnnContainer::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* name of the font to assign */
L_UINT uFlags; | /* flags that indicate which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font property of the annotation object. You specify the name of the font in a character string. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontName(TEXT("Times
 New Roman"));
}


LAnnContainer::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* the font size to set */
L_UINT uFlags; | /* flags that indicate which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontSize(50);
}


LAnnContainer::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply a strike-through */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the value of the strike-through property of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply or remove the strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through
 | FALSE | Remove the strike-through.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontStrikeThrough(TRUE);
}


LAnnContainer::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to underline the text */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font-underline property of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply or remove an underline. Possible values are:
 | Value | Meaning
 | TRUE | Underline the text.
 | FALSE | Remove the underline from the text.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetFontUnderline(TRUE);
}


LAnnContainer::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetForeColor(RGB(0,0,255));
}


LAnnContainer::SetGrouping

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetGrouping(bAutoGroup, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

See Also

Functions: | LAnnContainer::GetGrouping, LAnnotation::Group, LAnnotation::Ungroup , Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

void TestFunction()
{

/*
this example will temporarily disable the grouping in all objects
and re-enable the grouping later
*/
// disable grouping in all groups

LAnnContainer lContainer;

lContainer.SetGrouping(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!
lContainer.SetGrouping(TRUE, ANNFLAG_RECURSE|ANNFLAG_NOTTHIS);
}


LAnnContainer::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the line style of the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetLineStyle(ANNLINE_DASH);
}


LAnnContainer::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetLineWidth(dLineWidth, uFlags=0)

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 the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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
 |  | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetLineWidth(20);
}


LAnnContainer::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a the polygon, polyline, freehand, and freehand hotspot objects within the Container object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the polyline, polygon, freehand, and freehand hotspot objects within the container will be displayed in design mode.

If bShowNodes is 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.

See Also

Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void CVCAnnotation11Dlg::OnButtonContainerSetnode()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

ANNRECT annRect = {0,0,200,200};

LAnnContainer MyAnnContainer(this->m_hWnd,
 &annRect, TRUE);

L_BOOL bShowNodes = TRUE;
L_UINT uGapNodes = 1;

//Show every other node for relevant objects in
 container
MyAnnContainer.SetNodes(bShowNodes,
 uGapNodes);
}


LAnnContainer::SetPolyFillMode

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetPolyFillMode(uPolyFillMode=ANNPOLYFILL_WINDING, uFlags=0)

L_UINT uPolyFillMode; | /* the polygon fill mode */
L_UINT uFlags; | /* flags that indicate which objects to process */

Sets the value of the property that determines how a Polygonal annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetPolyFillMode(ANNPOLYFILL_ALTERNATE);
}


LAnnContainer::SetText

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* the character string to assign */
L_UINT uFlags; | /* flags that indicate which objects to process */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void Test(LAnnContainer L_FAR * pAnnContainer)
{
pAnnContainer->SetText(TEXT(
 "Test SetText() Function"));
}


LAnnContainer::SetTransparent

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetTransparent(bTransparent, uFlags=0)

L_BOOL bTransparent; | /* flag that indicates whether to make the bitmap transparent */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets one or more bitmap stamp objects to use white as a transparent color.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only bitmap stamps can be transparent. In transparent stamps, all the white pixels are considered transparent. 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.

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: | Class Members
Topics | Annotation Functions (Document/Medical only) Displaying Annotations

Example

void TestAnnWnd(LAnnContainer L_FAR*pLAnnContainer)
{
pLAnnContainer->SetTransparent(TRUE);
}


LAnnContainer::SetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetTransparentColor(crTransparent, uFlags=0)

COLORREF crTransparent; | /* transparent color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Only stamp objects that have a bitmap will use the transparent color.

This transparent color is used only if the object is set to transparent using LAnnContainer::SetTransparent.

By default, the transparent color is white (0x00FFFFFF).

The objects that will have this transparent color is determined by the uFlags settings.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

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: | LAnnContainer::SetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Color Values in LEADTOOLS


LAnnContainer::SetUserMode

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetUserMode(uMode=ANNUSER_DESIGN)

L_UINT uMode;

/* constant that specifies the user mode */

Sets the user mode for all objects in the Container.

This function is available in the Document/Medical Toolkits.

Parameter | Description
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

Design mode is for creating objects; run mode is for viewing them.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations

Example

For an example, refer to LAnnContainer::LAnnContainer.


LAnnContainer::SetWnd

#include "ltwrappr.h"

virtual L_INT LAnnContainer::SetWnd(hWnd)

HWND hWnd;

/* the window handle */

Sets the window handle for the annotation object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | The window handle.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations

Example

void TestAnnWnd(LAnnContainer L_FAR*pLAnnContainer,HWND hWnd)
{
/* Set the window
 to the current window, unless it is already current */
if(pLAnnContainer->GetWnd()!=hWnd)
pLAnnContainer->SetWnd(hWnd);
}


LAnnContainer::Unrealize

#include "ltwrappr.h"

virtual L_INT LAnnContainer::Unrealize(pBitmap, prcBounds, bSelected=TRUE)

virtual L_INT LAnnContainer::Unrealize(pBitmap, prcBounds, bSelected=TRUE)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
LPRECT prcBounds; | /* pointer to a RECT structure */
L_BOOL bSelected; | /* 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.
pBitmap | Pointer to the LBitmapBase object 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.
bSelected | 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.

If you realize a redact object, moving the redact object will leave the original location of the redact object hidden. When you call LAnnContainer::Realize 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 LAnnContainer::Unrealize. LAnnContainer::Unrealize will restore the background from a redact object that contains a background bitmap. The background of a locked object cannot be restored until the object is unlocked. If hObject is a container, then bSelected indicates whether all the Redact objects included in the container should be restored, or if only selected objects should be restored. If hObject is a Redact object, bSelected is ignored. 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.

See Also

Functions: | Class Members
Topics | Annotation Functions (Document/Medical only)Realizing to a Bitmap
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnContainer::Unrealize(pBitmap, prcBounds, bSelected) with pBitmap of type pBITMAPHANDLE:

L_VOID TestUnRealize(pBITMAPHANDLE pLeadBitmap,LAnnContainer& LeadAContainer)
{
// unrealize all of the redact objects
if(LeadAContainer.Unrealize(pLeadBitmap, NULL) == ERROR_ANN_LOCKED)
MessageBox(NULL, TEXT("Some redact objects are locked and cannot be restored"), TEXT("Warning"), MB_OK);
}

This is an example for LAnnContainer::Unrealize(pBitmap, prcBounds, bSelected) with pBitmap of type LBitmapBase L_FAR:

L_VOID TestUnRealize(LBitmapBase L_FAR *pLeadBitmap,LAnnContainer& LeadAContainer)
{
// unrealize all of the redact objects
if(LeadAContainer.Unrealize(pLeadBitmap, NULL) == ERROR_ANN_LOCKED)
MessageBox(NULL, TEXT("Some redact objects are locked and cannot be restored."), TEXT("Warning"), MB_OK);
}


LAnnCrossProduct::LAnnCrossProduct

#include "ltwrappr.h"

L_VOID LAnnCrossProduct::LAnnCrossProduct(bCreate=TRUE)

L_VOID LAnnCrossProduct::LAnnCrossProduct(hCrossProduct)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hCrossProduct; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnCrossProduct object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hRuler | Handle of the associated annotation object.

Returns

None

Comments

LAnnCrossProduct::LAnnCrossProduct(bCreate) is a constructor for the LAnnCrossProduct class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnCrossProduct::LAnnCrossProduct(hRuler) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_CROSSPRODUCT. The passed annotation object is invalidated.

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:

LAnnCrossProduct::~LAnnCrossProduct, Class Members

Example

This is an example for LAnnCrossProduct::LAnnCrossProduct(bCreate):

L_VOID TestFunction39( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make
 sure all libraries are loaded

LAnnCrossProduct MyAnnotation; //construct an
 annotation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for LAnnCrossProduct::LAnnCrossProduct(hCrossProduct):

L_VOID TestFunction40(HANNOBJECT& hAnnotationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure
 all libraries are loaded

LAnnCrossProduct MyAnnotation(hAnnotationObject);
 //construct an annotation object

//.... do something here ....
}


LAnnCrossProduct::~LAnnCrossProduct

#include "ltwrappr.h"

virtual L_VOID LAnnCrossProduct::~LAnnCrossProduct(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnCrossProduct class.

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:

Class Members

Example

For an example, refer to LAnnCrossProduct::LAnnCrossProduct(bCreate).


LAnnCrossProduct::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::AddUserHandle(pAnnHandle)

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
pAnnHandle | Pointer to an ANNHANDLE 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 LAnnCrossProduct 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a CrossProduct object
L_VOID ExampleAnnAddUserHandle(LAnnCrossProduct *pLCrossProduct)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLCrossProduct->GetType();
if (uType == ANNOBJECT_CROSSPRODUCT)
{
pLCrossProduct->GetRect(&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;
pLCrossProduct->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLCrossProduct->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation Object Must be a CrossProduct object"), TEXT("Error"), MB_OK);
}


LAnnCrossProduct::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::ChangeUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of the user handle to change. This index is zero-based.
pAnnHandle | Pointer to an ANNHANDLE 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 LAnnCrossProduct::AddUserHandle and LAnnCrossProduct::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnCrossProduct *LCrossProduct)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LCrossProduct->GetUserHandles(NULL,
 &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LCrossProduct->GetUserHandle(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;
LCrossProduct->ChangeUserHandle(0,
 &AnnHandle);
}
else
MessageBox(NULL, TEXT("No
 User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCrossProduct::Create

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::Create(L_VOID)

Creates a Cross-product annotation object. 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 use the LAnnCrossProduct::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction41( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnCrossProduct MyAnnotation(FALSE); //construct an annotation object

if (MyAnnotation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnCrossProduct::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnCrossProduct *LCrossProduct)
{
L_UINT uCount;

// Get the total
 count of user handles
LCrossProduct->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
LCrossProduct->DeleteUserHandle(0);
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCrossProduct::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::EnumerateHandles()

Calls the LAnnCrossProduct::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnCrossProduct::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnCrossProduct: public LAnnCrossProduct
{
public:
virtual
 L_INT EnumHandleCallBack(HANNOBJECT
 hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnCrossProduct::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO
 pHandleInfo)
{
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(MyAnnCrossProduct *LCrossProduct)
{
LCrossProduct->EnableCallBack(TRUE);
LCrossProduct->EnumerateHandles();
}


LAnnCrossProduct::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnCrossProduct::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnCrossProduct::EnumerateHandles 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 LAnnCrossProduct::ChangeUserHandle.

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.

To enable the LAnnCrossProduct::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnCrossProduct::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnCrossProduct::EnumerateHandles.


LAnnCrossProduct::GetDistance

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetDistance(pdDistance, pdDistance2)

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 annotation object in the object's unit of measurement, set by LAnnRuler::SetUnit. This function is available in the Document/Medical Toolkits.

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

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects

Example

void CVCAnnotation11Dlg::OnButtonCrossproduct()
{
LBitmap MyBitmap;
RECT rect;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnCrossProduct MyAnnCrossProduct;

ANNPOINT MyPts[5] = { 50,50,
150,150,
100,100,
150,50,
50,150
};

pANNPOINT pMyPts = MyPts;

MyAnnCrossProduct.SetPoints(pMyPts, 5);

//Verify points of crossproduct
L_UINT uPointCount = MyAnnCrossProduct.GetPointCount();
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, sizeof(ANNPOINT) * uPointCount);
pANNPOINT pAnnPoint = (pANNPOINT)GlobalLock(hGlobal);

MyAnnCrossProduct.GetPoints(pAnnPoint);

for (unsigned int i=0; i<uPointCount; i++)
{
L_TCHAR szTemp[100];

wsprintf(szTemp, TEXT("[%d]Point(%d, %d)"), i, (int)pAnnPoint[i].x, (int)pAnnPoint[i].y);
AfxMessageBox(szTemp);
}
GlobalFree(hGlobal);

L_UINT uShowFlags;
MyAnnCrossProduct.GetShowFlags(&uShowFlags);
MyAnnCrossProduct.SetShowFlags(ANNSHOW_GAUGE,0);

L_UINT uLineStyle = MyAnnCrossProduct.GetLineStyle();
L_DOUBLE dLineWidth = MyAnnCrossProduct.GetLineWidth();

L_TCHAR szTemp[100];
wsprintf(szTemp, TEXT("Old Line Style[%d]\nOld Line Width[%d]"), uLineStyle, (int)dLineWidth);
AfxMessageBox(szTemp);

MyAnnCrossProduct.SetLineStyle(ANNLINE_SOLID);
MyAnnCrossProduct.SetLineWidth(5.0);

//Get Distances
L_DOUBLE dDist1=0, dDist2=0;
dDist1 = 0; dDist2=0; MyAnnCrossProduct.GetDistance(&dDist1, &dDist2);

//Set CrossProduct properties
MyAnnCrossProduct.SetVisible(TRUE);
MyAnnCrossProduct.GetBoundingRect(&rect) ;

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnCrossProduct.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnCrossProduct::GetDistance2

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetDistance2(puCount, pDistance, pTotalDistance, uStructSize)

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

Returns

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

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;

pCrossProduct->GetDistance2(&uCount,
 NULL, NULL, sizeof(ANNSMARTDISTANCE));
pDistance = (pANNSMARTDISTANCE)malloc(uCount
 * sizeof(ANNSMARTDISTANCE));
pCrossProduct->GetDistance2(&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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This sample calls GetDistance2 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_MILIMETERS");
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);

if (pszSmartDistance)
{
lstrcpy(pszSmartDistance, szMsg);
}

if (puLength)
{
*puLength = uLength;
}
}

L_VOID SampleAnnGetDistance(LAnnCrossProduct * pObject)
{
L_UINT uCount;
L_TCHAR *pszObject;
L_UINT uType;
L_INT nRet;
L_TCHAR szMsg[500];
ANNSMARTDISTANCE sdTotalDistance;
pANNSMARTDISTANCE pDistance = NULL;

uType = pObject->GetType();
pszObject = annGetObjectString(uType);
nRet= pObject->GetDistance2(&uCount,
 NULL, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}
// We know the number of rulers
pDistance = (ANNSMARTDISTANCE * )malloc(uCount * sizeof(ANNSMARTDISTANCE));
if (!pDistance)
MessageBox(NULL, TEXT("Not enough memory"), TEXT("Error"),
 MB_OK);

nRet = pObject->GetDistance2(&uCount,
 pDistance, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}

free(pDistance);
}


LAnnCrossProduct::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnCrossProduct::SetFixed.


LAnnCrossProduct::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnCrossProduct::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style property. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnCrossProduct::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnCrossProduct::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in an object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

for an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array to be filled with the endpoints of the ruler object.

Returns

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

Comments

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.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to an ANNHANDLE 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 CrossProduct 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnCrossProduct *LCrossProduct)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total
 count of user handles
LCrossProduct->GetUserHandles(NULL, &uCount);
if (uCount >
 0)
{
memset(&AnnHandle,
 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize
 = sizeof(&AnnHandle);
LCrossProduct->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0,
 &AnnHandle);
}
else
MessageBox(NULL,
 TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCrossProduct::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of ANNHANDLEstructures 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnCrossProduct * LCrossProduct)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total
 count of user handles, and allocate memory
LCrossProduct->GetUserHandles(NULL, &uCount);
pAnnHandle =
 (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LCrossProduct->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount;
 i++)
DumpAnnHandle(i,
 pAnnHandle + i);

free(pAnnHandle);
}


LAnnCrossProduct::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnCrossProduct::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLCrossProduct -- Pointer to LAnnCrossProduct annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnCrossProduct *pLCrossProduct)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLCrossProduct->IsFixedInRect(&rcClient,
 ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed
 annotations visible") : TEXT("There are NO fixed annotations
 visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnCrossProduct::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnCrossProduct::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCrossProduct::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCrossProduct::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCrossProduct::PushFixedState / LAnnCrossProduct::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCrossProduct::PushFixedState and LAnnCrossProduct::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCrossProduct::PushFixedState (); | Fixed state is temporarily disabled
LAnnCrossProduct::PushFixedState (); | Fixed state is temporarily disabled
LAnnCrossProduct::PopFixedState (); | Fixed state is still disabled
LAnnCrossProduct::PopFixedState (); | Fixed state is enabled

Note that LAnnCrossProduct::PushFixedState and LAnnCrossProduct::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of
 all objects in the container that
// have been temporarily disabled with a call to LAnnCrossProduct::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnCrossProduct *pLCrossProduct)
{
pLCrossProduct->PopFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnCrossProduct::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCrossProduct::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCrossProduct::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCrossProduct::PushFixedState / LAnnCrossProduct::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCrossProduct::PushFixedState and LAnnCrossProduct::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCrossProduct::PushFixedState (); | Fixed state is temporarily disabled
LAnnCrossProduct::PushFixedState (); | Fixed state is temporarily disabled
LAnnCrossProduct::PopFixedState (); | Fixed state is still disabled
LAnnCrossProduct::PopFixedState (); | Fixed state is enabled

Note that LAnnCrossProduct::PushFixedState and LAnnCrossProduct::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed"
 property of all objects in the container
// This is useful when fixed objects need to be temporarily painted larger
 or smaller than
// the fixed size. For an example using the magnifying glass, see the source
 code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnCrossProduct *pLCrossProduct)
{
pLCrossProduct->PushFixedState(ANNFLAG_RECURSE
 | ANNFLAG_NOINVALIDATE);
}


LAnnCrossProduct::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnCrossProduct *pLCrossProduct)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLCrossProduct->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLCrossProduct->SetFixed(bFixed,
 TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed")
 : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""),
 MB_OK);
}
else
{
wsprintf(szMsg, TEXT("
 GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"),
 MB_OK);
}
}


LAnnCrossProduct::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCrossProduct::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCrossProduct::SetPoints(pPoints, uCount=5)

pANNPOINT pPoints; | /* pointer to an array */
L_UINT uCount; | /* number of points in the array */

Defines the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the endpoints 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.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnCrossProduct::GetDistance.


LAnnCurve::LAnnCurve

#include "ltwrappr.h"

L_VOID LAnnCurve::LAnnCurve(bCreate=TRUE)

L_VOID LAnnCurve::LAnnCurve(hCurve)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hCurve; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnCurve object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hCurve | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnCurve::LAnnCurve(bCreate) is a constructor for the LAnnCurve class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnCurve::LAnnCurve(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnCurve. The passed annotation object is invalidated.

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:

LAnnCurve::~LAnnCurve, Class Members

Example

// This is an example for LAnnCurve::LAnnCurve(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnCurve LeadACurve(TRUE) ;

//...
}

// This is an example for LAnnCurve::LAnnCurve(hCurve):

L_VOID TestConstructor (HANNOBJECT& hCurve)
{
// this will call the constructor and destructor when it is out of scope
LAnnCurve LeadACurve(hCurve) ;

//...
}


LAnnCurve::~LAnnCurve

#include "ltwrappr.h"

virtual L_VOID LAnnCurve::~LAnnCurve(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnCurve class.

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:

Class Members

Example

For an example, refer to LAnnCurve::LAnnCurve.


LAnnCurve::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurve::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

// This example adds user handles to the center of the top and bottom of a Curve object.
L_VOID ExampleAnnAddUserHandle(LAnnCurve *pLCurve)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLCurve->GetType();
if (uType == ANNOBJECT_CURVE)
{
pLCurve->GetRect(&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;
pLCurve->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLCurve->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Curve object."), TEXT("Error"), MB_OK);
}


LAnnCurve::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurve::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnCurve::AddUserHandle and LAnnCurve::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnCurve *LCurve)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LCurve->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LCurve->GetUserHandle(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;
LCurve->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurve::Create

#include "ltwrappr.h"

virtual L_INT LAnnCurve::Create(L_VOID)

Creates a Curve annotation object. 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 use the LAnnCurve::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnCurve LeadCurve(FALSE); //construct an annotation note object

if (LeadCurve.Create()==SUCCESS)
{
//... do something here
}
}


LAnnCurve::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurve::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnCurve *LCurve)
{
L_UINT uCount;

// Get the total count of user handles
LCurve->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LCurve->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurve::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnCurve::EnumerateHandles()

Calls the LAnnCurve::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnCurve::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

class MyAnnCurve: public LAnnCurve
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnCurve::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnCurve *LCurve)
{
LCurve->EnableCallBack(TRUE);
LCurve->EnumerateHandles();
}


LAnnCurve::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnCurve::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object*/
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnCurve::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnCurve::EnumerateHandles 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 LAnnCurve::ChangeUserHandle.

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.

To enable the LAnnCurve::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnCurve::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnCurve::EnumerateHandles.


LAnnCurve::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCurve::GetFixed(pbFixed)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnCurve::SetFixed.


LAnnCurve::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnCurve::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnCurve::GetPoints.


LAnnCurve::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCurve::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to the array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array that this function will fill with the vertices of the object.

Returns

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

Comments

You can use the LAnnCurve::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer,
L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnCurve LeadCurve(hObject) ;

// first, get the # of points in the object
uCount = LeadCurve.GetPointCount();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadCurve.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadCurve.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadCurve.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnCurve::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurve::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnCurve *LCurve)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LCurve->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LCurve->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurve::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnCurve::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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\nuStructSize: %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(LAnnCurve * LCurve)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LCurve->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LCurve->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnCurve::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnCurve::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnCurve::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLCurve -- Pointer to LAnnCurve annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnCurve *pLCurve)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLCurve->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnCurve::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCurve::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected
 | 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 LAnnCurve::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCurve::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCurve::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCurve::PushFixedState / LAnnCurve::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCurve::PushFixedState and LAnnCurve::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCurve::PushFixedState (); | Fixed state is temporarily disabled
LAnnCurve::PushFixedState (); | Fixed state is temporarily disabled
LAnnCurve::PopFixedState (); | Fixed state is still disabled
LAnnCurve::PopFixedState (); | Fixed state is enabled

Note that LAnnCurve::PushFixedState and LAnnCurve::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the "fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnCurve::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnCurve *pLCurve)
{
pLCurve->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnCurve::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCurve::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCurve::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCurve::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCurve::PushFixedState / LAnnCurve::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCurve::PushFixedState and LAnnCurve::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCurve::PushFixedState (); | Fixed state is temporarily disabled
LAnnCurve::PushFixedState (); | Fixed state is temporarily disabled
LAnnCurve::PopFixedState (); | Fixed state is still disabled.
LAnnCurve::PopFixedState (); | Fixed state is enabled.

Note that LAnnCurve::PushFixedState and LAnnCurve::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnCurve *pLCurve)
{
pLCurve->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnCurve::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCurve::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnCurve *pLCurve)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLCurve->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLCurve->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnCurve::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCurve::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /* pointer to the array of LEADTOOLS ANNPOINT structures*/
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnCurve::GetPoints.


LAnnCurveClosed::LAnnCurveClosed

#include "ltwrappr.h"

L_VOID LAnnCurveClosed::LAnnCurveClosed(bCreate=TRUE)

L_VOID LAnnCurveClosed::LAnnCurveClosed(hCurveClosed)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hCurveClosed; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnCurveClosed object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hCurveClosed | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnCurveClosed::LAnnCurveClosed(bCreate) is a constructor for the LAnnCurveClosed class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnCurveClosed::LAnnCurveClosed(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnCurveClosed. The passed annotation object is invalidated.

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:

LAnnCurveClosed::~LAnnCurveClosed, Class Members

Example

This is an example for LAnnCurveClosed::LAnnCurveClosed(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnCurveClosed LeadACurveClosed(TRUE) ;

//...
}

This is an example for LAnnCurveClosed::LAnnCurveClosed(hCurveClosed):

L_VOID TestConstructor (HANNOBJECT& hCurveClosed)
{
// this will call the constructor and destructor when it is out of scope
LAnnCurveClosed LeadAFTR(hCurveClosed) ;

//...
}


LAnnCurveClosed::~LAnnCurveClosed

#include "ltwrappr.h"

virtual L_VOID LAnnCurveClosed::~LAnnCurveClosed(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnCurveClosed class.

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:

Class Members

Example

For an example, refer to LAnnCurveClosed::LAnnCurveClosed.


LAnnCurveClosed::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

// This example adds user handles to the center of the top and bottom of a CurveClosed object

L_VOID ExampleAnnAddUserHandle(LAnnCurveClosed *pLCurveClosed)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLCurveClosed->GetType();
if (uType == ANNOBJECT_CURVECLOSED)
{
pLCurveClosed->GetRect(&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;
pLCurveClosed->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLCurveClosed->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a CurveClosed object."), TEXT("Error"), MB_OK);
}


LAnnCurveClosed::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnCurveClosed::AddUserHandle and LAnnCurveClosed::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnCurveClosed *LCurveClosed)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LCurveClosed->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LCurveClosed->GetUserHandle(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;
LCurveClosed->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurveClosed::Create

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::Create(L_VOID)

Creates a CurveClosed annotation object. 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 use the LAnnCurveClosed::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnCurveClosed LeadCurveClosed(FALSE); //construct an annotation note object

if (LeadCurveClosed.Create()==SUCCESS)
{
//... do something here
}
}


LAnnCurveClosed::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This examples deletes the first user handle of an object

L_VOID ExampleAnnDeleteUserHandle(LAnnCurveClosed *LCurveClosed)
{
L_UINT uCount;

// Get the total count of user handles
LCurveClosed->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LCurveClosed->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurveClosed::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::EnumerateHandles()

Calls the LAnnCurveClosed::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnCurveClosed::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnCurveClosed: public LAnnCurveClosed
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnCurveClosed::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnCurveClosed *LCurveClosed)
{
LCurveClosed->EnableCallBack(TRUE);
LCurveClosed->EnumerateHandles();
}


LAnnCurveClosed::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnCurveClosed::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnCurveClosed::EnumerateHandles 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 LAnnCurveClosed::ChangeUserHandle.

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.

To enable the LAnnCurveClosed::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnCurveClosed::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnCurveClosed::EnumerateHandles.


LAnnCurveClosed::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnCurveClosed::SetFixed.


LAnnCurveClosed::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnCurveClosed::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnCurveClosed::GetPoints.


LAnnCurveClosed::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to the array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array that this function will fill with the vertices of the object.

Returns

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

Comments

You can use the LAnnCurveClosed::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer, L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnCurveClosed LeadCurveClosed(hObject) ;

// first, get the # of points in the object
uCount = LeadCurveClosed.GetPointCount();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadCurveClosed.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadCurveClosed.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadCurveClosed.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnCurveClosed::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnCurveClosed *LCurveClosed)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LCurveClosed->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LCurveClosed->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnCurveClosed::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnCurveClosed * LCurveClosed)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LCurveClosed->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LCurveClosed->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnCurveClosed::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnCurveClosed::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLCurveClosed -- Pointer to LAnnCurveClosed annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnCurveClosed *pLCurveClosed)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLCurveClosed->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnCurveClosed::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnCurveClosed::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCurveClosed::PushFixedState.on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCurveClosed::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCurveClosed::PushFixedState./ LAnnCurveClosed::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCurveClosed::PushFixedState.and LAnnCurveClosed::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCurveClosed::PushFixedState.(); | Fixed state is temporarily disabled
LAnnCurveClosed::PushFixedState.(); | Fixed state is temporarily disabled
LAnnCurveClosed::PopFixedState(); | Fixed state is still disabled
LAnnCurveClosed::PopFixedState(); | Fixed state is enabled

Note that LAnnCurveClosed::PushFixedState.and LAnnCurveClosed::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnCurveClosed::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnCurveClosed *pLCurveClosed)
{
pLCurveClosed->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnCurveClosed::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnCurveClosed::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnCurveClosed::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnCurveClosed::PushFixedState/ LAnnCurveClosed::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnCurveClosed::PushFixedState and LAnnCurveClosed::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnCurveClosed::PushFixedState(); | Fixed state is temporarily disabled
LAnnCurveClosed::PushFixedState(); | Fixed state is temporarily disabled
LAnnCurveClosed::PopFixedState(); | Fixed state is still disabled
LAnnCurveClosed::PopFixedState(); | Fixed state is enabled

Note that LAnnCurveClosed::PushFixedState and LAnnCurveClosed::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnCurveClosed *pLCurveClosed)
{
pLCurveClosed->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnCurveClosed::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /*pointer to the array of LEADTOOLS ANNPOINT structures*/
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnCurveClosed::GetPoints.


LAnnCurveClosed::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnCurveClosed::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnCurveClosed *pLCurveClosed)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLCurveClosed->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLCurveClosed->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnEllipse::LAnnEllipse

#include "ltwrappr.h"

L_VOID LAnnEllipse:: LAnnEllipse(bCreate=TRUE)

L_VOID LAnnEllipse::LAnnEllipse(hEllipse)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hEllipse; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnEllipse object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
Value | Meaning
TRUE | Create the associated Annotation object, as well as the class object.
FALSE | Create only the class object. Do not create the associated annotation object.
hEllipse | Handle of the associated annotation object.

Returns

None

Comments

LAnnEllipse::LAnnEllipse(bCreate) is a constructor for the LAnnEllipse class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnEllipse::LAnnEllipse(hEllipse) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_ELLIPSE. The passed annotation object is invalidated.

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:

LAnnEllipse::~LAnnEllipse, Class Members

Example

This is an example for LAnnEllipse::LAnnEllipse(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnEllipse LeadAEllipse(TRUE) ;

//...
}

This is an example for LAnnEllipse::LAnnEllipse(hEllipse):

L_VOID TestConstructor (HANNOBJECT& hEllipse)
{
// this will call the constructor and destructor when it is out of scope
LAnnEllipse LeadAEllipse(hEllipse) ;

//...
}


LAnnEllipse::~LAnnEllipse

#include "ltwrappr.h"

virtual L_VOID LAnnEllipse::~LAnnEllipse(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnEllipse class.

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:

LAnnEllipse::LAnnEllipse, Class Members

Example

For an example, refer to LAnnEllipse::LAnnEllipse.


LAnnEllipse::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom lines of a Ellipse
L_VOID ExampleAnnAddUserHandle(LAnnEllipse *pLEllipse)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLEllipse->GetType();
if (uType == ANNOBJECT_ELLIPSE)
{
pLEllipse->GetRect(&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;
pLEllipse->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLEllipse->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be an Ellipse"), TEXT("Error"), MB_OK);
}


LAnnEllipse::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnEllipse::AddUserHandle and LAnnEllipse::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when the mouse is over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnEllipse *LEllipse)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LEllipse->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LEllipse->GetUserHandle(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;
LEllipse->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEllipse::Create

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::Create(L_VOID)

Creates an Ellipse annotation object. 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 use the LAnnEllipse::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnEllipse LeadEllipse(FALSE); //construct an ellipse object

if (LeadEllipse.Create()==SUCCESS)
{
//... do something here
}
}


LAnnEllipse::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnEllipse *LEllipse)
{
L_UINT uCount;

// Get the total count of user handles
LEllipse->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LEllipse->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEllipse::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::EnumerateHandles()

Calls the LAnnEllipse::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnEllipse::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnEllipse: public LAnnEllipse
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnEllipse::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnEllipse *LEllipse)
{
LEllipse->EnableCallBack(TRUE);
LEllipse->EnumerateHandles();
}


LAnnEllipse::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object*/
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnEllipse::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnEllipse::EnumerateHandles 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 LAnnEllipse::ChangeUserHandle.

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.

To enable the LAnnEllipse::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnEllipse::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnEllipse::EnumerateHandles.


LAnnEllipse::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnEllipse::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnEllipse L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnEllipse::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnEllipse::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the fill mode of the annotation object.

This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

Value | Meaning
ANNMODE_TRANSPARENT | [0] Transparent
ANNMODE_TRANSLUCENT | [1] Translucent
ANNMODE_OPAQUE | [2] Opaque

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnEllipse L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */

/* Set the fill mode to transparent, unless it already is */
FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT, 0);
}


LAnnEllipse::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnEllipse::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible 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

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnEllipse L_FAR * pAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */

/* Set the fill pattern to solid, unless it already is */
FillPattern = pAnnObject->GetFillPattern();
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID, 0);
}


LAnnEllipse::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::GetFixed(pbFixed)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnEllipse::SetFixed.


LAnnEllipse::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnEllipse::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnEllipse L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnEllipse::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnEllipse::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style property. Possible 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

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnEllipse L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnEllipse::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnEllipse::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnEllipse L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnEllipse::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the annotation Ellipse in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnEllipse * pLEllipse)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLEllipse->GetRotateAngle(&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);
}
}


LAnnEllipse::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnEllipse *LEllipse)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LEllipse->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LEllipse->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEllipse::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnEllipse * LEllipse)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LEllipse->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LEllipse->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnEllipse::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnEllipse::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example displays a message box that indicates 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
// pLEllipse -- Pointer to LAnnEllipse annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnEllipse *pLEllipse)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLEllipse->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnEllipse::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnEllipse::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnEllipse::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnEllipse::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnEllipse::PushFixedState / LAnnEllipse::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPoint::PushFixedState and LAnnPoint::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PopFixedState (); | Fixed state is still disabled
LAnnPoint::PopFixedState (); | Fixed state is enabled

Note that LAnnPoint::PushFixedState and LAnnEllipse::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnEllipse::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnEllipse *pLEllipse)
{
pLEllipse->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnEllipse::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnEllipse::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnEllipse::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnEllipse::PushFixedState / LAnnEllipse::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnEllipse::PushFixedState and LAnnEllipse::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnEllipse::PushFixedState (); | Fixed state is temporarily disabled
LAnnEllipse::PushFixedState (); | Fixed state is temporarily disabled
LAnnEllipse::PopFixedState (); | Fixed state is still disabled
LAnnEllipse::PopFixedState (); | Fixed state is enabled

Note that LAnnEllipse::PushFixedState and LAnnEllipse::PopFixedState should always be called in pairs.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnEllipse *pLEllipse)
{
pLEllipse->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnEllipse::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnEllipse::GetBackColor.


LAnnEllipse::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnEllipse::GetFillMode .


LAnnEllipse::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetFillPattern(uFillPattern=ANNPATTERN_SOLID, uFlags=0)

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnEllipse::GetFillPattern.


LAnnEllipse::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnEllipse *pLEllipse)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLEllipse->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLEllipse->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnEllipse::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnEllipse::GetForeColor.


LAnnEllipse::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnEllipse::GetLineStyle .


LAnnEllipse::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnEllipse::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* unscaled line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnEllipse::GetLineWidth.


LAnnEncrypt::LAnnEncrypt

#include "ltwrappr.h"

L_VOID LAnnEncrypt::LAnnEncrypt(bCreate=TRUE)

L_VOID LAnnEncrypt::LAnnEncrypt(hEncrypt)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hEncrypt; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnEncrypt object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hEncrypt | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnEncrypt::LAnnEncrypt(bCreate) is a constructor for the LAnnEncrypt class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnEncrypt::LAnnEncrypt(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnEncrypt. The passed annotation object is invalidated.

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: | LAnnEncrypt::~LAnnEncrypt, Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

// This is an example for LAnnEncrypt::LAnnEncrypt(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnEncrypt LeadAEncrypt(TRUE) ;

//...
}

// This is an example for LAnnEncrypt::LAnnEncrypt(hEncrypt):

L_VOID TestConstructor (HANNOBJECT& hEncrypt)
{
// this will call the constructor and destructor when it is out of scope
LAnnEncrypt LeadAFTR(hEncrypt) ;

//...
}


LAnnEncrypt::~LAnnEncrypt

#include "ltwrappr.h"

virtual L_VOID LAnnEncrypt::~LAnnEncrypt(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnEncrypt class.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnEncrypt::LAnnEncrypt.


LAnnEncrypt::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example adds user handles to the center of the top and bottom of an Encrypt object
L_VOID ExampleAnnAddUserHandle(LAnnEncrypt *pLEncrypt)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLEncrypt->GetType();
if (uType == ANNOBJECT_ENCRYPT)
{
pLEncrypt->GetRect(&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;
pLEncrypt->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLEncrypt->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be an Encrypt object"), TEXT("Error"), MB_OK);
}


LAnnEncrypt::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnEncrypt::AddUserHandle and LAnnEncrypt::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnEncrypt *LEncrypt)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LEncrypt->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LEncrypt->GetUserHandle(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;
LEncrypt->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEncrypt::Create

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::Create(L_VOID)

Creates an Encrypt annotation object. 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 use the LAnnEncrypt::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Functions: Object Properties

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnEncrypt LeadEncrypt(FALSE); //construct an annotation note object

if (LeadEncrypt.Create()==SUCCESS)
{
//... do something here
}
}


LAnnEncrypt::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnEncrypt *LEncrypt)
{
L_UINT uCount;

// Get the total count of user handles
LEncrypt->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LEncrypt->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEncrypt::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::EnumerateHandles()

Calls the LAnnEncrypt::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnEncrypt::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnEncrypt: public LAnnEncrypt
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnEncrypt::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnEncrypt *LEncrypt)
{
LEncrypt->EnableCallBack(TRUE);
LEncrypt->EnumerateHandles();
}


LAnnEncrypt::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object*/
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnEncrypt::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnEncrypt::EnumerateHandles 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 LAnnEncrypt::ChangeUserHandle.

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.

To enable the LAnnEncrypt::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnEncrypt::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnEncrypt::EnumerateHandles.


LAnnEncrypt::GetEncryptOptions

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetEncryptOptions(pEncryptOptions)

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
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 its address when you call the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnEncrypt::GetSecondaryMetafile.


LAnnEncrypt::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnEncrypt::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID TestModifyAnn(LAnnEncrypt L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnEncrypt::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnEncrypt::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID TestModifyAnn(LAnnEncrypt L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnEncrypt::GetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetMetafile(phMetafile)

HMETAFILE L_FAR * phMetafile;

/* pointer to a variable to be updated with the handle to a metafile */

Retrieves the metafile handle associated with an Encrypt object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 by phMetafile will be updated with the metafile handle.

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: | LAnnEncrypt::SetMetafile, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

void Example2()
{
LAnnEncrypt MyAnnEncrypt;
HMETAFILE hMetafile;

//...metafile is associated with Encrypt annotation
MyAnnEncrypt.GetMetafile(&hMetafile);
//... do something with hMetafile
}


LAnnEncrypt::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations

Example

// This examples displays the rotation angle of the Encrypt annotation object in radians and degrees.
L_VOID ExampleAnnGetRotateAngle(LAnnEncrypt * pLEncrypt)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLEncrypt->GetRotateAngle(&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);
}
}


LAnnEncrypt::GetSecondaryMetafile

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetSecondaryMetafile(phMetafile)

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
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 LAnnEncrypt::GetMetafile 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.

See Also

Functions: | Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Using Annotation Bitmap Objects

Example

// This example swaps the metafiles for the 'encrypt' and 'decrypt' state of an encryptor
L_VOID SampleAnnGetSecondaryMetafile(LAnnEncrypt *pLEncrypt)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;
L_BOOL bEncryptorOriginal;
ANNENCRYPTOPTIONS EncryptOptions;

L_UINT uObjectType;

uObjectType = pLEncrypt->GetType();
if (uObjectType != ANNOBJECT_ENCRYPT)
{
MessageBox(NULL, TEXT("This object is not an encryptor."), TEXT("Error"), MB_OK);
return;
}

pLEncrypt->GetMetafile(&hMetafile1);
pLEncrypt->GetSecondaryMetafile(&hMetafile2);

memset(&EncryptOptions, 0, sizeof(ANNENCRYPTOPTIONS));
EncryptOptions.uStructSize = sizeof(ANNENCRYPTOPTIONS);
EncryptOptions.uFlags = ANNENCRYPT_ALL;
pLEncrypt->GetEncryptOptions(&EncryptOptions);

bEncryptorOriginal = EncryptOptions.bEncryptor;

// Set state to encryptor, and set encryptor metafile
EncryptOptions.uFlags = ANNENCRYPT_TYPE;
EncryptOptions.bEncryptor = TRUE;
pLEncrypt->SetEncryptOptions(&EncryptOptions, 0);
pLEncrypt->SetMetafile(hMetafile2, ANNMETAFILE_USER, 0);

// Set state to decryptor, and set decryptor metafile
EncryptOptions.bEncryptor = FALSE;
pLEncrypt->SetEncryptOptions(&EncryptOptions, 0);
pLEncrypt->SetMetafile(hMetafile1, ANNMETAFILE_USER, 0);

// Set encryptor to original state
EncryptOptions.bEncryptor = bEncryptorOriginal;
pLEncrypt->SetEncryptOptions(&EncryptOptions, 0);
}


LAnnEncrypt::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnEncrypt *LEncrypt)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LEncrypt->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LEncrypt->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnEncrypt::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnEncrypt * LEncrypt)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LEncrypt->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LEncrypt->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnEncrypt::SetEncryptOptions

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::SetEncryptOptions(pEncryptOptions, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnEncrypt::GetEncryptOptions 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations

Example

For an example, refer to LAnnEncrypt::GetSecondaryMetafile .


LAnnEncrypt::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnEncrypt::GetLineStyle.


LAnnEncrypt::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnEncrypt::GetLineWidth.


LAnnEncrypt::SetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnEncrypt::SetMetafile(hMetafile, uType, uFlags=0)

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

This function is available in the Document/Medical Toolkits.

Parameter | Description
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_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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only Encrypt objects, hotspot objects, stamp objects, and freehand hotspot objects can have metafiles. Note that for Encrypt objects, setting the metafile destroys the Encrypt object’s bitmap and text. Also, setting a bitmap or text destroys the metafile associated with the Encrypt object.

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, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 25 predefined metafiles. You can change the predefined metafiles by using LAnnotation::SetPredefinedMetafile.

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: | Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

//This example sets the metafile in the Encrypt annotation to the predfined
//metafile ANNMETAFILE_IMPORTANT
void CVCAnnotation11Dlg::OnButtonEncrypt()
{
RECT rect;
ANNRECT annRect;
HMETAFILE hNotUsed;

LAnnEncrypt MyAnnEncrypt;

annRect.left = 50;
annRect.top = 50;
annRect.right = 150;
annRect.bottom = 150;

hNotUsed = 0;
MyAnnEncrypt.SetMetafile(hNotUsed, ANNMETAFILE_IMPORTANT, 0);

MyAnnEncrypt.SetRect(&annRect);
MyAnnEncrypt.SetVisible(TRUE);
MyAnnEncrypt.GetBoundingRect(&rect) ;

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnEncrypt.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnFreehand::LAnnFreehand

#include "ltwrappr.h"

L_VOID LAnnFreehand::LAnnFreehand(bCreate=TRUE)

L_VOID LAnnFreehand::LAnnFreehand(hFreehand)

HANNOBJECT& hFreehand; | /* handle of the associated annotation object */
L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */

Constructs and initializes the member variables of the LAnnFreehand object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hFreehand | Handle of the associated annotation object.

Returns

None

Comments

LAnnFreehand::LAnnFreehand(bCreate) is a constructor for the LAnnFreehand class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnFreehand::LAnnFreehand(hFreehand) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_FREEHAND. The passed annotation object is invalidated.

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:

LAnnFreehand::~LAnnFreehand, Class Members

Example

This is an example for LAnnFreehand::LAnnFreehand(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnFreehand LeadAFreehand(TRUE) ;

//...
}

This is an example for LAnnFreehand::LAnnFreehand(hFreehand):

L_VOID TestConstructor (HANNOBJECT& hFreehand)
{
// this will call the constructor and destructor when it is out of scope
LAnnFreehand LeadAFreehand(hFreehand) ;

//...
}


LAnnFreehand::~LAnnFreehand

#include "ltwrappr.h"

virtual L_VOID LAnnFreehand::~LAnnFreehand(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnFreehand class.

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:

Class Members

Example

For an example, refer to LAnnFreehand::LAnnFreehand.


LAnnFreehand::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a Freehand object
L_VOID ExampleAnnAddUserHandle(LAnnFreehand *pLFreehand)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLFreehand->GetType();
if (uType == ANNOBJECT_FREEHAND)
{
pLFreehand->GetRect(&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;
pLFreehand->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLFreehand->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Freehand"), TEXT("Error"), MB_OK);
}


LAnnFreehand::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::ChangeUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of the user handle to change. This index is zero-based.
pAnnHandle | Pointer to an ANNHANDLE 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 LAnnFreehand::AddUserHandle and LAnnFreehand::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnFreehand *LFreehand)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LFreehand->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LFreehand->GetUserHandle(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;
LFreehand->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehand::Create

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::Create(L_VOID)

Creates a Freehand annotation object. 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 use the LAnnFreehand::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnFreehand LeadFreehand(FALSE); //construct an free hand object

if (LeadFreehand.Create()==SUCCESS)
{
//... do something here
}
}


LAnnFreehand::Define

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::Define(pPoint, uState)

LPPOINT pPoint; | /* pointer to a POINT structure */
L_UINT uState; | /* state of processing */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

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

Returns

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

Comments

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.

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.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID MyDefine(LAnnFreehand L_FAR * pAnnObject,HWND hWnd)
{
RECT rClientRect;
POINT MyPoint;

GetClientRect(hWnd,&rClientRect) ;

// Set the point for the opposite corner of the rectangle
MyPoint.x = rClientRect.right / 2;
MyPoint.y = rClientRect.bottom / 2;

// Finish defining the rectangular annotation object
pAnnObject->Define( &MyPoint, ANNDEFINE_END);
}


LAnnFreehand::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnFreehand *LFreehand)
{
L_UINT uCount;

// Get the total count of user handles
LFreehand->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LFreehand->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehand::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::EnumerateHandles()

Calls the LAnnFreehand::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnFreehand::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnFreehand: public LAnnFreehand
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnFreehand::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnFreehand *LFreehand)
{
LFreehand->EnableCallBack(TRUE);
LFreehand->EnumerateHandles();
}


LAnnFreehand::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnFreehand::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnFreehand::EnumerateHandles 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 LAnnFreehand::ChangeUserHandle.

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.

To enable the LAnnFreehand::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnFreehand::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnFreehand::EnumerateHandles.


LAnnFreehand::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnFreehand::SetFixed.


LAnnFreehand::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnFreehand::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current foreground color.

Comments

To see how the foreground color relates to the fill modes, 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnFreehand L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnFreehand::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnFreehand::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible line style values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnFreehand L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnFreehand::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnFreehand::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnFreehand L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnFreehand::GetNodes

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::GetNodes(pbShowNodes, puGapNodes)

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

Comments

Note:

The last node is always shown. Therefore, using a large value for puGapNodes will probably result in only the first and last nodes being shown.

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.

See Also

Functions: | LAnnFreehand::SetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnFreehand::SetNodes.


LAnnFreehand::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnFreehand::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnFreehand::GetPoints.


LAnnFreehand::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array that this function will fill with the vertices of the object.

Returns

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

Comments

You can use the LAnnFreehand::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer,
L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest ( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnFreehand LeadFreehand(hObject) ;

// first, get the # of points in the object
uCount = LeadFreehand.GetPointCount ();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadFreehand.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadFreehand.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadFreehand.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnFreehand::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::GetUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to an ANNHANDLE 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 Freehand 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnFreehand *LFreehand)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LFreehand->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LFreehand->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehand::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnFreehand * LFreehand)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LFreehand->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LFreehand->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnFreehand::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnFreehand::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLFreehand -- Pointer to LAnnFreehand annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnFreehand *pLFreehand)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLFreehand->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnFreehand::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnFreehand::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 to LAnnFreehand::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnFreehand::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call to LAnnFreehand::PushFixedState / LAnnFreehand::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to to LAnnFreehand::PushFixedState LAnnFreehand::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

to LAnnFreehand::PushFixedState (); | Fixed state is temporarily disabled
to LAnnFreehand::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehand::PopFixedState (); | Fixed state is still disabled
LAnnFreehand::PopFixedState (); | Fixed state is enabled

Note that LAnnFreehand::PushFixedState and LAnnFreehand::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnFreehand::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnFreehand *pLFreehand)
{
pLFreehand->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnFreehand::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnFreehand::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnFreehand::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnFreehand::PushFixedState / LAnnFreehand::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnFreehand::PushFixedState and LAnnFreehand::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnFreehand::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehand::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehand::PopFixedState (); | Fixed state is still disabled
LAnnFreehand::PopFixedState (); | Fixed state is enabled

Note that LAnnFreehand::PushFixedState and LAnnFreehand::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnFreehand *pLFreehand)
{
pLFreehand->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnFreehand::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnFreehand *pLFreehand)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLFreehand->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLFreehand->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT(" GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnFreehand::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnFreehand::GetForeColor.


LAnnFreehand::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* the line style */
L_UINT uFlags; | /* flag that indicates the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. Possible values are:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnFreehand::GetLineStyle.


LAnnFreehand::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width to set */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnFreehand::GetLineWidth.


LAnnFreehand::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a Freehand object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the object will be displayed in design mode.

If bShowNodes is 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.

See Also

Functions: | LAnnFreehand::GetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void CVCAnnotation11Dlg::OnButtonFreehandGetnodes()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnFreehand MyAnnFreehand;

ANNPOINT MyPts[4] = { 40,40,
140,40,
140,140,
100,180
};

pANNPOINT pMyPts = MyPts;
MyAnnFreehand.SetPoints(pMyPts, 4);

L_BOOL bShowNodes;
L_UINT uGapNodes;
MyAnnFreehand.GetNodes(&bShowNodes, &uGapNodes);

//skip more nodes than currently skipping
MyAnnFreehand.SetNodes(bShowNodes, uGapNodes + 1);
}


LAnnFreehand::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnFreehand::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /* pointer to an array */
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnFreehand::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnFreehand::GetPoints.


LAnnFreehandHotSpot::LAnnFreehandHotSpot

#include "ltwrappr.h"

L_VOID LAnnFreehandHotSpot::LAnnFreehandHotSpot(hFreehand)

L_VOID LAnnFreehandHotSpot::LAnnFreehandHotSpot(bCreate=TRUE)

HANNOBJECT& hFreehandHotSpot; | /* handle of the associated annotation object */
L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */

Constructs and initializes the member variables of the LAnnFreehandHotSpot object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hFreehandHotSpot | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnFreehandHotSpot::LAnnFreehandHotSpot(bCreate) is a constructor for the LAnnFreehandHotSpot class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnFreehandHotSpot::LAnnFreehandHotSpot(hFreehandHotSpot) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_FREEHANDHOTSPOT. The passed annotation object is invalidated.

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:

LAnnFreehandHotSpot::~LAnnFreehandHotSpot, Class Members

Example

This is an example for LAnnFreehandHotSpot::LAnnFreehandHotSpot(bCreate):

L_VOID TestFunction33( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnFreehandHotSpot MyAnnotation; //construct an annotation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for LAnnFreehandHotSpot::LAnnFreehandHotSpot(hFreehandHotSpot):

L_VOID TestFunction34(HANNOBJECT& hAnnotationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnFreehandHotSpot MyAnnotation(hAnnotationObject); //construct an annotation object

//.... do something here ....

}


LAnnFreehandHotSpot::~LAnnFreehandHotSpot

#include "ltwrappr.h"

virtual L_VOID LAnnFreehandHotSpot::~LAnnFreehandHotSpot(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnFreehandHotSpot class.

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:

Class Members

Example

For an example, refer to LAnnFreehandHotSpot::LAnnFreehandHotSpot(bCreate).


LAnnFreehandHotSpot::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a FreehandHotSpot object
L_VOID ExampleAnnAddUserHandle(LAnnFreehandHotSpot *pLFreehandHotSpot)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLFreehandHotSpot->GetType();
if (uType == ANNOBJECT_FREEHANDHOTSPOT)
{
pLFreehandHotSpot->GetRect(&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;
pLFreehandHotSpot->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLFreehandHotSpot->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a FreehandHotSpot object"), TEXT("Error"), MB_OK);
}


LAnnFreehandHotSpot::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnFreehandHotSpot::AddUserHandle and LAnnFreehandHotSpot::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnFreehandHotSpot *LFreehandHotSpot)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LFreehandHotSpot->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LFreehandHotSpot->GetUserHandle(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;
LFreehandHotSpot->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehandHotSpot::Create

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::Create(L_VOID)

Creates a FreehandHotSpot annotation object. 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 use the LAnnFreehand::SetXXX() and LAnnFreehandHotSpot::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction35( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnFreehandHotSpot MyAnnotation(FALSE); //construct an annotation object

if (MyAnnotation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnFreehandHotSpot::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnFreehandHotSpot *LFreehandHotSpot)
{
L_UINT uCount;

// Get the total count of user handles
LFreehandHotSpot->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LFreehandHotSpot->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehandHotSpot::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::EnumerateHandles()

Calls the LAnnFreehandHotSpot::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnFreehandHotSpot::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnFreehandHotSpot: public LAnnFreehandHotSpot
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnFreehandHotSpot::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnFreehandHotSpot *LFreehandHotSpot)
{
LFreehandHotSpot->EnableCallBack(TRUE);
LFreehandHotSpot->EnumerateHandles();
}


LAnnFreehandHotSpot::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnFreehandHotSpot::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnFreehandHotSpot::EnumerateHandles 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 LAnnFreehandHotSpot::ChangeUserHandle.

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.

To enable the LAnnFreehandHotSpot::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnFreehandHotSpot::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnFreehandHotSpot::EnumerateHandles.


LAnnFreehandHotSpot::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnFreehandHotSpot::SetFixed.


LAnnFreehandHotSpot::GetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::GetMetafile(phMetafile)

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 by phMetafile will be updated with the metafile handle.

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: | LAnnFreehandHotSpot::SetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

L_VOID TestFunction(LAnnFreehandHotSpot & AnnFreehandHotSpot)
{
HMETAFILE hMetafile;

if (AnnFreehandHotSpot.GetMetafile(&hMetafile) == SUCCESS)
if (hMetafile != NULL)
MessageBox(NULL, TEXT("Metafile was retrieved successfully!"),
TEXT("Testing"), MB_OK);
else
MessageBox(NULL, TEXT("Metafile is NULL!"), TEXT("Testing"), MB_OK);
else
MessageBox(NULL, TEXT("Error getting Metafile!"), TEXT("Testing"), MB_OK);
}


LAnnFreehandHotSpot::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnFreehandHotSpot *LFreehandHotSpot)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LFreehandHotSpot->GetUserHandles (NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LFreehandHotSpot->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnFreehandHotSpot::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnFreehandHotSpot * LFreehandHotSpot)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LFreehandHotSpot->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LFreehandHotSpot->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnFreehandHotSpot::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnFreehandHotSpot::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLFreehandHotSpot -- Pointer to an LAnnFreehandHotSpot annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnFreehandHotSpot *pLFreehandHotSpot)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLFreehandHotSpot->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnFreehandHotSpot::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnFreehandHotSpot::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnFreehandHotSpot::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnFreehandHotSpot::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnFreehandHotSpot::PushFixedState / LAnnFreehandHotSpot::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnFreehandHotSpot::PushFixedState and LAnnFreehandHotSpot::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnFreehandHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehandHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehandHotSpot::PopFixedState (); | Fixed state is still disabled
LAnnFreehandHotSpot::PopFixedState (); | Fixed state is enabled

Note that LAnnFreehandHotSpot::PushFixedState and LAnnFreehandHotSpot::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnFreehandHotSpot::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnFreehandHotSpot *pLFreehandHotSpot)
{
pLFreehandHotSpot->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnFreehandHotSpot::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnFreehandHotSpot::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnFreehandHotSpot::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnFreehandHotSpot::PushFixedState / LAnnFreehandHotSpot::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnFreehandHotSpot::PushFixedState and LAnnFreehandHotSpot::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnFreehandHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehandHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnFreehandHotSpot::PopFixedState (); | Fixed state is still disabled
LAnnFreehandHotSpot::PopFixedState (); | Fixed state is enabled

Note that LAnnFreehandHotSpot::PushFixedState and LAnnFreehandHotSpot::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnFreehandHotSpot *pLFreehandHotSpot)
{
pLFreehandHotSpot->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnFreehandHotSpot::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnFreehandHotSpot *pLFreehandHotSpot)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLFreehandHotSpot->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLFreehandHotSpot->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT(" GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnFreehandHotSpot::SetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnFreehandHotSpot::SetMetafile(hMetafile, uType, uFlags=0)

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 a stamp object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only stamp objects can have metafiles. Note that setting the metafile destroys the stamp object’s bitmap and text. Also, setting a bitmap or text destroys the metafile associated with the stamp object. (The stamp object can have Text, Bitmap or Metafile and each of these cancels the other two).

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, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 25 predefined metafiles. You can change the predefined metafiles by using LAnnotation::SetPredefinedMetafile.

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: | LAnnFreehandHotSpot::GetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

L_INT TestFunction(LAnnFreehandHotSpot & AnnFreehandHotSpot)
{
HMETAFILE hMetafile;

if (AnnFreehandHotSpot.GetMetafile(&hMetafile) == SUCCESS)
if (hMetafile != NULL)
return SUCCESS;
else if (AnnFreehandHotSpot.SetMetafile(NULL, ANNMETAFILE_VOID,
0) == SUCCESS)
return SUCCESS;

return FAILURE;
}


LAnnHilite::LAnnHilite

#include "ltwrappr.h"

L_VOID LAnnHilite::LAnnHilite(bCreate=TRUE)

L_VOID LAnnHilite::LAnnHilite(hHilite)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hHilite; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnHilite object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hHilite | Handle of the associated annotation object.

Returns

None

Comments

LAnnHilite::LAnnHilite(bCreate) is a constructor for the LAnnHilite class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnHilite::LAnnHilite(hHilite) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_HILITE. The passed annotation object is invalidated.

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:

LAnnHilite::LAnnHilite, Class Members

Example

This is an example for LAnnHilite::LAnnHilite(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnHilite LeadAHilite(TRUE) ;

//...
}

This is an example for LAnnHilite::LAnnHilite(hHilite):

L_VOID TestConstructor(HANNOBJECT& hHilite)
{
// this will call the constructor and destructor when it is out of scope
LAnnHilite LeadAHilite(hHilite) ;

//...
}


LAnnHilite::~LAnnHilite

#include "ltwrappr.h"

virtual L_VOID LAnnHilite::~LAnnHilite(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnHilite class.

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:

Class Members

Example

For an example, refer to LAnnHilite::LAnnHilite.


LAnnHilite::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHilite::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a Hilite object
L_VOID ExampleAnnAddUserHandle(LAnnHilite *pLHilite)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLHilite->GetType();
if (uType == ANNOBJECT_HILITE)
{
pLHilite->GetRect(&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;
pLHilite->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLHilite->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Hilite"), TEXT("Error"), MB_OK);
}


LAnnHilite::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHilite::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnHilite::AddUserHandle and LAnnHilite::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnHilite *LHilite)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LHilite->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LHilite->GetUserHandle(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;
LHilite->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHilite::Create

#include "ltwrappr.h"

virtual L_INT LAnnHilite::Create(L_VOID)

Creates a Hilite annotation object. 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 use the LAnnHilite::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnHilite LeadHilite(FALSE); //construct an annotation button object

if (LeadHilite.Create()==SUCCESS)
{
//... do something here
}
}


LAnnHilite::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHilite::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnHilite *LHilite)
{
L_UINT uCount;

// Get the total count of user handles
LHilite->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LHilite->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHilite::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnHilite::EnumerateHandles()

Calls the LAnnHilite::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnHilite::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnHilite: public LAnnHilite
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnHilite::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnHilite *LHilite)
{
LHilite->EnableCallBack(TRUE);
LHilite->EnumerateHandles();
}


LAnnHilite::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnHilite::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnHilite::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object.
SUCCESS_NOCHANGE | [2] Do not change the object.

Comments

The LAnnHilite::EnumerateHandles 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 LAnnHilite::ChangeUserHandle.

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.

To enable the LAnnHilite::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnHilite::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnHilite::EnumerateHandles.


LAnnHilite::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnHilite::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn(LAnnHilite L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnHilite::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnHilite::GetFixed(pbFixed)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnHilite::SetFixed.


LAnnHilite::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnHilite::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the Hilite annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnHilite * pLHilite)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLHilite->GetRotateAngle(&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);
}
}


LAnnHilite::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHilite::GetUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to a ANNHANDLE 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 Hilite 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnHilite *LHilite)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LHilite->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LHilite->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHilite::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnHilite::GetUserHandles(pAnnHandle, puCount)

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
pAnnHandle | Array of ANNHANDLE structures to be updated with the user-defined handles.
puCount | Pointer to an unsigned integer to be updated with 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnHilite * LHilite)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LHilite->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LHilite->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnHilite::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnHilite::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnHilite::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLHilite -- Pointer to LAnnHilite annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnHilite *pLHilite)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLHilite->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnHilite::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnHilite::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnHilite::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnHilite::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnHilite::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnHilite::PushFixedState / LAnnHilite::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnHilite::PushFixedState and LAnnHilite::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnHilite::PushFixedState (); | Fixed state is temporarily disabled
LAnnHilite::PushFixedState (); | Fixed state is temporarily disabled
LAnnHilite::PopFixedState (); | Fixed state is still disabled
LAnnHilite::PopFixedState (); | Fixed state is enabled

Note that LAnnHilite::PushFixedState and LAnnHilite::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the "fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnHilite::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnHilite *pLHilite)
{
pLHilite->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnHilite::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnHilite::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnHilite::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnHilite::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnHilite::PushFixedState / LAnnHilite::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnHilite::PushFixedState and LAnnHilite::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnHilite::PushFixedState (); | Fixed state is temporarily disabled
LAnnHilite::PushFixedState (); | Fixed state is temporarily disabled
LAnnHilite::PopFixedState (); | Fixed state is still disabled
LAnnHilite::PopFixedState (); | Fixed state is enabled

Note that LAnnHilite::PushFixedState and LAnnHilite::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnHilite *pLHilite)
{
pLHilite->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnHilite::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnHilite::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnHilite::GetBackColor.


LAnnHilite::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnHilite::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnHilite *pLHilite)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLHilite->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLHilite->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnHotSpot::LAnnHotSpot

#include "ltwrappr.h"

L_VOID LAnnHotSpot::LAnnHotSpot(bCreate=TRUE)

L_VOID LAnnHotSpot::LAnnHotSpot(hHotSpot)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hHotSpot; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnHotSpot object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hHotSpot | Handle of the associated annotation object.

Returns

None

Comments

LAnnHotSpot::LAnnHotSpot(bCreate) is a constructor for the LAnnHotSpot class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnHotSpot::LAnnHotSpot(hHotSpot) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_HOTSPOT. The passed annotation object is invalidated.

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:

LAnnHotSpot::~LAnnHotSpot, Class Members

Example

This is an example for LAnnHotSpot::LAnnHotSpot(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnHotSpot LeadAHotSpot(TRUE) ;

//...
}

This is an example for LAnnHotSpot::LAnnHotSpot(hHotSpot):

L_VOID TestConstructor (HANNOBJECT& hHotSpot)
{
// this will call the constructor and destructor when it is out of scope
LAnnHotSpot LeadAHotSpot(hHotSpot) ;

//...
}


LAnnHotSpot::~LAnnHotSpot

#include "ltwrappr.h"

virtual L_VOID LAnnHotSpot::~LAnnHotSpot(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnHotSpot class.

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:

Class Members

Example

For an example, refer to LAnnHotSpot::LAnnHotSpot.


LAnnHotSpot::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a HotSpot object
L_VOID ExampleAnnAddUserHandle(LAnnHotSpot *pLHotSpot)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLHotSpot->GetType();
if (uType == ANNOBJECT_HOTSPOT)
{
pLHotSpot->GetRect(&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;
pLHotSpot->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLHotSpot->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a HotSpot object."), TEXT("Error"), MB_OK);
}


LAnnHotSpot::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnHotSpot::AddUserHandle and LAnnHotSpot::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnHotSpot::AddUserHandle, LAnnHotSpot::EnumerateHandles
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnHotSpot *LHotSpot)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LHotSpot->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LHotSpot->GetUserHandle(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;
LHotSpot->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHotSpot::Create

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::Create(L_VOID)

Creates a HotSpot annotation object. 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 should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT or during the LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnHotSpot LeadAHotSpot(FALSE); //construct a hot spot object

if (LeadAHotSpot.Create()==SUCCESS)
{
//... do something here
}
}


LAnnHotSpot::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::DeleteUserHandle(nIndex)

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

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: | Class Members, LAnnHotSpot::AddUserHandle, LAnnHotSpot::EnumerateHandles, LAnnHotSpot::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnHotSpot *LHotSpot)
{
L_UINT uCount;

// Get the total count of user handles
LHotSpot->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LHotSpot->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHotSpot::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::EnumerateHandles()

Calls the LAnnHotSpot::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnHotSpot::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnHotSpot: public LAnnHotSpot
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnHotSpot::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnHotSpot *LHotSpot)
{
LHotSpot->EnableCallBack(TRUE);
LHotSpot->EnumerateHandles();
}


LAnnHotSpot::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnHotSpot::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnHotSpot::EnumerateHandles 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 LAnnHotSpot::ChangeUserHandle.

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.

To enable the LAnnHotSpot::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnHotSpot::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnHotSpot::EnumerateHandles.


LAnnHotSpot::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::GetFixed(pbFixed)

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

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: | Class Members, LAnnHotSpot::PopFixedState,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnHotSpot::SetFixed.


LAnnHotSpot::GetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::GetMetafile(phMetafile)

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 by phMetafile will be updated with the metafile handle.

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: | LAnnHotSpot::SetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

L_VOID TestFunction(LAnnHotSpot & AnnHotSpot)
{
HMETAFILE hMetafile;

if (AnnHotSpot.GetMetafile(&hMetafile) == SUCCESS)
if (hMetafile != NULL)
MessageBox(NULL, TEXT("Metafile was retrieved successfully!"), TEXT("Testing"), MB_OK);
else
MessageBox(NULL, TEXT("Metafile is NULL!"), TEXT("Testing"), MB_OK);
else
MessageBox(NULL, TEXT("Error getting Metafile!"), TEXT("Testing"), MB_OK);
}


LAnnHotSpot::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the HotSpot annotation object in radians and degrees.
L_VOID ExampleAnnGetRotateAngle(LAnnHotSpot * pLHotSpot)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLHotSpot->GetRotateAngle(&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);
}
}


LAnnHotSpot::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnHotSpot *LHotSpot)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LHotSpot->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LHotSpot->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnHotSpot::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::GetUserHandles(pAnnHandle, puCount)

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

See Also

Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnHotSpot * LHotSpot)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LHotSpot->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LHotSpot->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnHotSpot::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* pointer to a structure */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnHotSpot::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLHotSpot -- Pointer to LAnnHotSpot annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnHotSpot *pLHotSpot)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLHotSpot->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnHotSpot::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnHotSpot::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnHotSpot::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnHotSpot::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnHotSpot::PushFixedState / LAnnHotSpot::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnHotSpot::PushFixedState and LAnnHotSpot::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnHotSpot::PopFixedState(); | Fixed state is still disabled
LAnnHotSpot::PopFixedState (); | Fixed state is enabled

Note that LAnnHotSpot::PushFixedState and LAnnHotSpot::PopFixedState should always be called in pairs.

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: | Class Members, LAnnHotSpot::PushFixedState
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnHotSpot::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnHotSpot *pLHotSpot)
{
pLHotSpot->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnHotSpot::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnHotSpot::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnHotSpot::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnHotSpot::PushFixedState / LAnnHotSpot::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnHotSpot::PushFixedState and LAnnHotSpot::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnHotSpot::PushFixedState (); | Fixed state is temporarily disabled
LAnnHotSpot::PopFixedState (); | Fixed state is still disabled
LAnnHotSpot::PopFixedState (); | Fixed state is enabled

Note that LAnnHotSpot::PushFixedState and LAnnHotSpot::PopFixedState should always be called in pairs.

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: | Class Members, LAnnHotSpot::PopFixedState
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | nnotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnHotSpot *pLHotSpot)
{
pLHotSpot->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnHotSpot::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnHotSpot *pLHotSpot)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLHotSpot->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLHotSpot->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnHotSpot::SetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnHotSpot::SetMetafile(hMetafile, uType, uFlags=0)

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 a stamp object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only stamp objects can have metafiles. Note that setting the metafile destroys the stamp object’s bitmap and text. Also, setting a bitmap or text destroys the metafile associated with the stamp object. (The stamp object can have Text, Bitmap or Metafile and each of these cancels the other two).

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, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 25 predefined metafiles. You can change the predefined metafiles by using LAnnotation::SetPredefinedMetafile.

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: | LAnnHotSpot::GetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

L_INT TestFunction(LAnnHotSpot & AnnHotSpot)
{
HMETAFILE hMetafile;

if (AnnHotSpot.GetMetafile(&hMetafile)
 == SUCCESS)
if (hMetafile != NULL)
return SUCCESS;
else if (AnnHotSpot.SetMetafile(NULL,
 ANNMETAFILE_VOID, 0) == SUCCESS)
return SUCCESS;

return FAILURE;
}


LAnnLine::LAnnLine

#include "ltwrappr.h"

L_VOID LAnnLine::LAnnLine(bCreate=TRUE)

L_VOID LAnnLine::LAnnLine(hLine)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hLine; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnLine object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hLine | Handle of the associated annotation object.

Returns

None

Comments

LAnnLine::LAnnLine(bCreate) is a constructor for the LAnnLine class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnLine::LAnnLine(hLine) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_LINE. The passed annotation object is invalidated.

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:

LAnnLine::~LAnnLine, Class Members

Example

This is an example for LAnnLine::LAnnLine(bCreate):

L_VOID TestConstructor()
{
// this will call the default constructor and destructor when it is out of scope
LAnnLine LeadALine(TRUE) ;

//...
}

This is an example for LAnnLine::LAnnLine(hLine):

L_VOID TestConstructor (HANNOBJECT& hLine)
{
// this will call the default constructor and destructor when it is out of scope
LAnnLine LeadALine(hLine) ;

//...
}


LAnnLine::~LAnnLine

#include "ltwrappr.h"

virtual L_VOID LAnnLine::~LAnnLine(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnLine class.

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:

Class Members

Example

For an example, refer to LAnnLine::LAnnLine.


LAnnLine::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnLine::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnLine::EnumerateHandles, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandle, LAnnLine::GetUserHandles, LAnnLine::ChangeUserHandle, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Line.
L_VOID ExampleAnnAddUserHandle(LAnnLine *pLLine)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLLine->GetType();
if (uType == ANNOBJECT_LINE)
{
pLLine->GetRect(&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;
pLLine->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLLine->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Line."), TEXT("Error"), MB_OK);
}


LAnnLine::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnLine::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnLine::AddUserHandle and LAnnLine::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumerateHandles, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandle, LAnnLine::GetUserHandles, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnLine *LLine)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LLine->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LLine->GetUserHandle(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;
LLine->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnLine::Create

#include "ltwrappr.h"

virtual L_INT LAnnLine::Create(L_VOID)

Creates a Line annotation object. 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 use the LAnnLine::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnLine LeadLine(FALSE); //construct an line object

if (LeadLine.Create()==SUCCESS)
{
//... do something here
}
}


LAnnLine::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnLine::DeleteUserHandle(nIndex)

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

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: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumerateHandles, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandle, LAnnLine::GetUserHandles, LAnnLine::ChangeUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This examples deletes the first user handle of an object.
L_VOID ExampleAnnDeleteUserHandle(LAnnLine *LLine)
{
L_UINT uCount;

// Get the total count of user handles
LLine->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LLine->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnLine::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnLine::EnumerateHandles()

Calls the LAnnLine::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnLine::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandle, LAnnLine::GetUserHandles, LAnnLine::ChangeUserHandle, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnLine: public LAnnLine
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnLine::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnLine *LLine)
{
LLine->EnableCallBack(TRUE);
LLine->EnumerateHandles();
}


LAnnLine::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnLine::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnLine::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnLine::EnumerateHandles 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 LAnnLine::ChangeUserHandle.

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.

To enable the LAnnLine::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnLine::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumerateHandles, LAnnLine::GetUserHandle, LAnnLine::GetUserHandles, LAnnLine::ChangeUserHandle, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

For an example, refer to LAnnLine::EnumerateHandles.


LAnnLine::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnLine::GetFixed(pbFixed)

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

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: | Class Members, LAnnLine::SetFixed, LAnnLine::PushFixedState, LAnnLine::PopFixedState, LAnnLine::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnLine::SetFixed.


LAnnLine::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnLine::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnLine L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnLine::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnLine::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible 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

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn(LAnnLine L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnLine::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnLine::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnLine L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnLine::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnLine::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations

Example

// This examples displays the rotation angle of the Line annotation object in radians and degrees.
L_VOID ExampleAnnGetRotateAngle(LAnnLine * pLLine)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLLine->GetRotateAngle(&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);
}
}


LAnnLine::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnLine::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumerateHandles, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandles, LAnnLine::ChangeUserHandle, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnLine *LLine)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LLine->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LLine->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnLine::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnLine::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members, LAnnLine::AddUserHandle, LAnnLine::EnumerateHandles, LAnnLine::EnumHandleCallBack, LAnnLine::GetUserHandle, LAnnLine::ChangeUserHandle, LAnnLine::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnLine * LLine)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LLine->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LLine->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnLine::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnLine::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnLine::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members, LAnnLine::SetFixed, LAnnLine::PushFixedState, LAnnLine::PopFixedState, LAnnLine::GetFixed
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLLine -- Pointer to LAnnLine annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnLine *pLLine)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLLine->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnLine::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnLine::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnLine::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnLine::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnLine::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnLine::PushFixedState / LAnnLine::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnLine::PushFixedState and LAnnLine::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnLine::PushFixedState (); | Fixed state is temporarily disabled
LAnnLine::PushFixedState (); | Fixed state is temporarily disabled
LAnnLine::PopFixedState (); | Fixed state is still disabled
LAnnLine::PopFixedState (); | Fixed state is enabled

Note that LAnnLine::PushFixedState and LAnnLine::PopFixedState should always be called in pairs.

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: | Class Members, LAnnLine::SetFixed, LAnnLine::PushFixedState, LAnnLine::GetFixed, LAnnLine::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnLine::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnLine *pLLine)
{
pLLine->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnLine::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnLine::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnLine::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnLine::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnLine::PushFixedState / LAnnLine::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnLine::PushFixedState and LAnnLine::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnLine::PushFixedState (); | Fixed state is temporarily disabled
LAnnLine::PushFixedState (); | Fixed state is temporarily disabled
LAnnLine::PopFixedState (); | Fixed state is still disabled
LAnnLine::PopFixedState (); | Fixed state is enabled

Note that LAnnLine::PushFixedState and LAnnLine::PopFixedState should always be called in pairs.

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: | Class Members, LAnnLine::SetFixed, LAnnLine::PopFixedState, LAnnLine::GetFixed, LAnnLine::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnLine *pLLine)
{
pLLine->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnLine::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnLine::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members, LAnnLine::PushFixedState, LAnnLine::PopFixedState, LAnnLine::GetFixed, LAnnLine::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnLine *pLLine)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLLine->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLLine->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnLine::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnLine::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnLine::GetForeColor.


LAnnLine::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnLine::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnLine::GetLineStyle.


LAnnLine::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnLine::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* unscaled line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnLine::GetLineWidth.


LAnnNote::LAnnNote

#include "ltwrappr.h"

L_VOID LAnnNote::LAnnNote(bCreate=TRUE)

L_VOID LAnnNote::LAnnNote(hNote)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hNote; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnNote object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hNote | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnNote::LAnnNote(bCreate) is a constructor for the LAnnNote class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnNote::LAnnNote(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_NOTE. The passed annotation object is invalidated.

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:

LAnnNote::~LAnnNote, Class Members

Example

This is an example for LAnnNote::LAnnNote(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnNote LeadANote(TRUE) ;

//...
}

This is an example for LAnnNote::LAnnNote(hNote):

L_VOID TestConstructor (HANNOBJECT& hNote)
{
// this will call the constructor and destructor when it is out of scope
LAnnNote LeadANote(hNote) ;

//...
}


LAnnNote::~LAnnNote

#include "ltwrappr.h"

virtual L_VOID LAnnNote::~LAnnNote(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnNote class.

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:

Class Members

Example

For an example, refer to LAnnNote::LAnnNote.


LAnnNote::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnNote::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnNote::EnumerateHandles, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandle, LAnnNote::GetUserHandles, LAnnNote::ChangeUserHandle, LAnnNote::DeleteUserHandle,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom of a Note object.
L_VOID ExampleAnnAddUserHandle(LAnnNote *pLNote)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLNote->GetType();
if (uType == ANNOBJECT_NOTE)
{
pLNote->GetRect(&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;
pLNote->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLNote->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Note object "), TEXT("Error"), MB_OK);
}


LAnnNote::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnNote::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnNote::AddUserHandle and LAnnNote::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumerateHandles, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandle, LAnnNote::GetUserHandles, LAnnNote::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnNote *LNote)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LNote->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LNote->GetUserHandle(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;
LNote->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnNote::Create

#include "ltwrappr.h"

virtual L_INT LAnnNote::Create(L_VOID)

Creates a Note annotation object. 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 use the LAnnNote::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnNote LeadNote(FALSE); //construct an annotation note object

if (LeadNote.Create()==SUCCESS)
{
//... do something here
}
}


LAnnNote::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnNote::DeleteUserHandle(nIndex)

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

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: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumerateHandles, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandle, LAnnNote::GetUserHandles, LAnnNote::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnNote *LNote)
{
L_UINT uCount;

// Get the total count of user handles
LNote->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LNote->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnNote::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnNote::EnumerateHandles()

Calls the LAnnNote::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnNote::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandle, LAnnNote::GetUserHandles, LAnnNote::ChangeUserHandle, LAnnNote::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnNote: public LAnnNote
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnNote::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnNote *LNote)
{
LNote->EnableCallBack(TRUE);
LNote->EnumerateHandles();
}


LAnnNote::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnNote::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnNote::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnNote::EnumerateHandles 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 LAnnNote::ChangeUserHandle.

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.

To enable the LAnnNote::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnNote::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumerateHandles, LAnnNote::GetUserHandle, LAnnNote::GetUserHandles, LAnnNote::ChangeUserHandle, LAnnNote::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnNote::EnumerateHandles.


LAnnNote::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnNote::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF);
}


LAnnNote::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetFixed(pbFixed)

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

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: | Class Members, LAnnNote::SetFixed, LAnnNote::PushFixedState, LAnnNote::PopFixedState, LAnnNote::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnNote::SetFixed.


LAnnNote::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* character string to be updated */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | Character string to be updated with the name of the font used by the Note object.

Returns

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

Comments

pFontName must be large enough to hold the returned 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
L_TCHAR L_FAR * pFontName; /* The object's font name. */
L_UINT uNameLength;/* Length of the object's font name */
LBuffer LeadBuffer ;

/* Get the length of the current font name */
 uNameLength = pAnnObject->GetFontNameLen();

LeadBuffer.Reallocate((DWORD)uNameLength * sizeof(L_TCHAR)) ;

pFontName = (L_TCHAR L_FAR *)LeadBuffer.Lock() ;

/* Get the current font name */
pAnnObject->GetFontName(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
pAnnObject->SetFontName( TEXT("Times New Roman"), 0);

LeadBuffer.Unlock() ;
}


LAnnNote::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnNote::GetFontNameLen(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the length of the character string that holds the font name of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The string length of the note object's font name.

Comments

Use this value to allocate a buffer when reading the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::GetFontName.


LAnnNote::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnNote::GetFontSize(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current unscaled value of the font size of the annotation object.

This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the Note object.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
L_DOUBLE FontSize; /* Object font size */

/* Double the font size */
FontSize = pAnnObject->GetFontSize();
pAnnObject->SetFontSize(FontSize * 2, 0);
}


LAnnNote::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnNote::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn(LAnnNote L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnNote::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples displays the rotation angle of the Note annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnNote * pLNote)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLNote->GetRotateAngle(&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);
}
}


LAnnNote::GetText

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated with the annotation object's character string */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

The LAnnNote class gets and sets text without formatting. Use the LAnnRTF class to use formatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
L_TCHAR L_FAR *pText; /* The object's text */
L_UINT TextLength; /* Length of the object's text */
LBuffer LeadBuffer ;

/* Get the length of the current text */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new text */
TextLength += 6;

LeadBuffer.Reallocate((DWORD)TextLength*sizeof(L_TCHAR));

pText = (L_TCHAR L_FAR *)LeadBuffer.Lock() ;

/* Get the current text */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current text */
lstrcat(pText,TEXT(" - New"));

pAnnObject->SetText(pText, 0);

LeadBuffer.Unlock() ;
}


LAnnNote::GetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetTextAlign(puTextAlign)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// Sample for LAnnNote::SetTextAlign, LAnnNote::GetTextAlign
// This example changes the text alignment of a note annotation object.
L_VOID SampleAnnSetTextAlign(LAnnNote *pLNote)
{
L_INT nRet;
L_UINT uTextAlign;
L_TCHAR szMsg[100];
L_UINT uType;

pLNote->GetTextAlign(&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= pLNote->SetTextAlign(uTextAlign, 0);
if (nRet != SUCCESS)
{
uType = pLNote->GetType();
wsprintf(szMsg, TEXT("SetTextAlign Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnNote::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnNote::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object's character string.

Comments

Use this value to allocate a buffer to read the text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::GetText.


LAnnNote::GetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetTextRotate(puTextRotate)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// Sample for LAnnNote::SetTextRotate, LAnnNote::GetTextRotate
// This example changes the text rotation of a note annotation.
L_VOID SampleAnnSetTextRotate(LAnnNote *pLNote)
{
L_INT nRet;
L_UINT uTextRotate;
L_TCHAR szMsg[100];
L_UINT uType;

pLNote->GetTextRotate(&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= pLNote->SetTextRotate(uTextRotate, 0);
if (nRet != SUCCESS)
{
uType = pLNote->GetType();
wsprintf(szMsg, TEXT("SetTextRotate Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnNote::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumerateHandles, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandles, LAnnNote::ChangeUserHandle, LAnnNote::DeleteUserHandle,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnNote *LNote)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LNote->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LNote->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnNote::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnNote::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members, LAnnNote::AddUserHandle, LAnnNote::EnumerateHandles, LAnnNote::EnumHandleCallBack, LAnnNote::GetUserHandle, LAnnNote::ChangeUserHandle, LAnnNote::DeleteUserHandle,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnNote * LNote)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LNote->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LNote->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnNote::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnNote::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnNote::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members, LAnnNote::SetFixed, LAnnNote::PushFixedState, LAnnNote::PopFixedState, LAnnNote::GetFixed
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLNote -- Pointer to LAnnNote annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnNote *pLNote)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLNote->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnNote::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnNote::IsFontBold(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnNote L_FAR * pAnnObject)
{
/* Set the font to bold, unless it already is */
if (pAnnObject->IsFontBold())
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontBold(TRUE, 0);

/* Set the font to italic, unless it already is */
if (pAnnObject->IsFontItalic()== TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontItalic(TRUE, 0);
}


LAnnNote::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnNote::IsFontItalic(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::IsFontBold.


LAnnNote::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnNote::IsFontStrikeThrough(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
/* Set the font to have a strike-through, unless it already has one */
if (pAnnObject->IsFontStrikeThrough())
MessageBox (NULL, TEXT("Already has strike-through"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontStrikeThrough(TRUE, 0);
}


LAnnNote::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnNote::IsFontUnderline(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnNote L_FAR * pAnnObject)
{
/* Set the font to have an underline, unless it already has one */
if (pAnnObject->IsFontUnderline())
MessageBox (NULL, TEXT("Already has an underline"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontUnderline(TRUE, 0);
}


LAnnNote::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnNote::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnNote::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnNote::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnNote::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnNote::PushFixedState / LAnnNote::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnNote::PushFixedState and LAnnNote::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnNote::PushFixedState (); | Fixed state is temporarily disabled
LAnnNote::PushFixedState (); | Fixed state is temporarily disabled
LAnnNote::PopFixedState (); | Fixed state is still disabled
LAnnNote::PopFixedState (); | Fixed state is enabled

Note that LAnnNote::PushFixedState and LAnnNote::PopFixedState should always be called in pairs.

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: | Class Members, LAnnNote::SetFixed, LAnnNote::PushFixedState, LAnnNote::GetFixed, LAnnNote::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnNote::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnNote *pLNote)
{
pLNote->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnNote::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnNote::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnNote::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnNote::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnNote::PushFixedState / LAnnNote::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnNote::PushFixedState and LAnnNote::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnNote::PushFixedState (); | Fixed state is temporarily disabled
LAnnNote::PushFixedState (); | Fixed state is temporarily disabled
LAnnNote::PopFixedState (); | Fixed state is still disabled
LAnnNote::PopFixedState (); | Fixed state is enabled

Note that LAnnNote::PushFixedState and LAnnNote::PopFixedState should always be called in pairs.

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: | Class Members, LAnnNote::SetFixed, LAnnNote::PopFixedState, LAnnNote::GetFixed, LAnnNote::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnNote *pLNote)
{
pLNote->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnNote::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that indicates the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that indicates the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnNote::GetBackColor.


LAnnNote::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members, LAnnNote::PushFixedState, LAnnNote::PopFixedState, LAnnNote::GetFixed, LAnnNote::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnNote *pLNote)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLNote->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLNote->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnNote::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that indicate which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | Make the font not bold.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::IsFontBold.


LAnnNote::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic. Possible values are:
 | Value | Meaning
 | TRUE | Make the font italic
 | FALSE | Make the font not italic.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::IsFontBold.


LAnnNote::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* the name of the font to assign */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font of the annotation object. You specify the name of the font in a character string. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | The character string containing the name of the font to assign.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::GetFontName.


LAnnNote::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* font size to set */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
dFontSize | The font size to set, expressed as an unscaled value relative to the container.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::GetFontSize.


LAnnNote::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply or remove the strike-through */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the strike-through (a line through the middle of the text) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply or remove the strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through
 | FALSE | Remove the strike-through.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::IsFontStrikeThrough.


LAnnNote::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply or remove an underline */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font-underline property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply or remove an underline. Possible values are:
 | Value | Meaning
 | TRUE | Underline the text.
 | FALSE | Remove the underline from the text.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::IsFontUnderline.


LAnnNote::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that indicate the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnNote::GetForeColor.


LAnnNote::SetText

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* character string to assign */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | The character string to assign to the annotation object.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 LAnnNote class gets and sets text without formatting. Use the LAnnRTF class to use formatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnNote::GetText.


LAnnNote::SetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetTextAlign(uTextAlign, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 a note 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.

See Also

Functions: | Class Members, LAnnNote::GetTextAlign
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnNote::GetTextAlign.


LAnnNote::SetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnNote::SetTextRotate(uTextRotate, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 will be rotated.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example refer to LAnnNote::GetTextRotate.


LAnnotation::LAnnotation

#include "ltwrappr.h"

L_VOID LAnnotation::LAnnotation(L_VOID)

Constructs and initializes the member variables of the LAnnotation object. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the constructor for the LAnnotation class.

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:

LAnnotation::~LAnnotation, Class Members

Example

L_VOID TestConstructor()
{
// this will call the default constructor and destructor when it is out of scope
LAnnotation LeadAnnotation ;

//...
}


LAnnotation::~LAnnotation

#include "ltwrappr.h"

virtual L_VOID LAnnotation::~LAnnotation(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnotation class.

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:

LAnnotation::LAnnotation, Class Members

Example

For an example, refer to LAnnotation::LAnnotation.


LAnnotation::AdjustPoint

#include "ltwrappr.h"

static L_INT LAnnotation::AdjustPoint (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:
 | Value | Meaning
 | ANNADJUST_HORIZONTAL | [1]
 | ANNADJUST_VERTICAL | [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.

LAnnotation::AdjustPoint(&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.

See Also

Functions: | Class Members, LAnnotation::Define, , LAnnotation::Define2, LAnnContainer::Convert, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Annotation Functions: Object Properties

Example

void TestAdjustPoint(
LAnnotation *pObjectChange,
LAnnotation *pObjectNeighbor,
pANNPOINT ptAnchor,
pANNPOINT ptMove,
L_INT dAngle,
POINT MousePos)
{
L_DOUBLE dx, dy;
POINT pt;

LAnnotation::AdjustPoint(ptAnchor, ptMove, dAngle, ANNADJUST_HORIZONTAL);
dx = (ptMove->x - ptAnchor->x)/2;
dy = (ptMove->y - ptAnchor->y)/2;
pt = MousePos;
pt.x = (LONG)(ptAnchor->x + dx);
pt.y = (LONG)(ptAnchor->y + dy);

pObjectChange->Define(&MousePos, ANNDEFINE_APPEND);
pObjectNeighbor->Define(&pt, ANNDEFINE_APPEND);
}


LAnnotation::BringToFront

#include "ltwrappr.h"

virtual L_INT LAnnotation::BringToFront(L_VOID)

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.

Returns

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

Comments

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 LAnnotation::Draw 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::SetRect.


LAnnotation::CalibrateRuler

#include "ltwrappr.h"

L_INT LAnnotation::CalibrateRuler(dCalibrateLength, uCalibrateUnit, dDpiRatioXtoY)

L_DOUBLE dCalibrateLength; | /* calibrated ruler length */
L_UINT uCalibrateUnit; | /* unit of measurement */
L_DOUBLE dDpiRatioXtoY; | /* ratio of dpiX to dpiY */

Calibrates an LAnnRuler annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
dCalibrateLength | Length to be assigned to the ruler.
uCalibrateUnit | Unit of measurement. 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 LAnnRuler object. This function is used to assign any existing LAnnRuler object to a specific length.

Note that this function only works on LAnnRuler objects, but can be used to indirectly calibrate other objects.

Note to the documentation team: the LAnnotation::SetOptions function is another new 14.5 function and the New Annotations Features of Version 14.5 is a new topic.

Note that with Version 14.5, this function must be enabled by passing OPTIONS_NEW_ CALIBRATE_RULER to the LAnnotation::SetOptions function before calling LAnnotation::CalibrateRuler. For more information, refer to New Annotation Features of Version 14.5.

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 LAnnRuler objects, it can be used indirectly to calibrate any or all ruler objects, including LAnnPolyRuler, LAnnProtractor, and LAnnCrossProduct. To do this, calibrate an LAnnRuler object, get the resulting resolutions, and assign this resolution to all objects in the container. The example illustrates how to do this.

If you pass a negative value to the dDpiRatioXtoY parameter, the ERROR_INV_PARAMETER error will be returned.

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.

Note to the documentation team: Using Rulers in Annotation Objects is a fairly new programming topic (the edits adding this topic were completed in May of this year.)

See Also

Functions: | LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnRuler::SetUnit, LAnnRuler::GetUnit, LAnnRuler::GetDistance, LAnnRuler::GetDistance2, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Calibrating Annotation Ruler Objects
 | Annotation Functions (Document/Medical only): Getting and Setting the Ruler Properties
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5

Example

void CalibraterulerExample(LAnnContainer anncont, LAnnAutomation
 annauto, LAnnRuler annruler)
{
// This example calibrates a ruler object
// so that it measures 10 inches with a DPI ratio of
 1:1
// Note that ruler object must be of type LAnnRuler
L_INT nRet = SUCCESS;
L_UINT uObjectType = 0;
L_DOUBLE dDpiX = 0;
L_DOUBLE dDpiY = 0;
uObjectType = annruler.GetType();
if (uObjectType < ANNOBJECT_CONTAINER)
return;

if (uObjectType!= ANNOBJECT_RULER)
{
MessageBox(NULL, "Error: CalibrateRuler
 only works on ANNOBJECT_RULER objects", "Error", MB_OK);
return;
}
nRet = annruler.CalibrateRuler(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);
}


LAnnotation::Copy

#include "ltwrappr.h"

virtual L_INT LAnnotation::Copy(hAnnSource)

virtual L_INT LAnnotation::Copy(LAnnSource)

HANNOBJECT hAnnSource; | /* handle to the associated annotation object */
LAnnotation& LAnnSource; | /* the annotation object to be copied */

Makes a copy of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAnnSource | Handle to the associated annotation object to be copied.
LAnnSource | The annotation object to be copied.

Returns

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

Comments

LAnnotation::Copy(hAnnSource) will update the class object with the handle of the annotation object created by the copy.

LAnnotation::Copy(LAnnSource) will update the class object with the passed 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnotation::Copy(hAnnSource):

L_VOID TestCopyAnnObj(LAnnotation& LeadAnnotation)
{
HANNOBJECT hAnnObj ;
LAnnotation MyAnn ;

hAnnObj = LeadAnnotation.GetHandle() ;
MyAnn.Copy(hAnnObj) ;

//...
}
This is an example for LAnnotation::Copy(LAnnSource):

L_VOID TestCopyAnn(LAnnotation& LeadAnnotation)
{
LAnnotation MyAnn ;

MyAnn.Copy(LeadAnnotation) ;

//...
}


LAnnotation::CopyToClipboard

#include "ltwrappr.h"

virtual L_INT LAnnotation::CopyToClipboard(uFormat=ANNFMT_NATIVE, bSelected=FALSE, bEmpty=FALSE, fCheckMenu=FALSE)

L_UINT uFormat; | /* format for the annotation data */
L_BOOL bSelected; | /* flag that indicates whether to copy all selected objects, or just the specified object */
L_BOOL bEmpty; | /* flag that indicates whether to empty the clipboard prior to copying the annotation data to it.*/
L_BOOL fCheckmenu; | /* flag that indicates whether to check the automation menu */

Copies the annotation object to the Windows clipboard in either the native format or WMF format. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Use the LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | Use the XML format.
bSelected | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions.
 | FALSE | Copy only the specified object.
bEmpty | 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

Use the WMF format only for copying for use in another application.

If the annotation object is a container, then to retain scaling and positioning information, this function will always copy the root container, along with the specified object or selected objects. Use the bSelected parameter as follows:

To copy only selected objects in a container, set bSelected to TRUE.

To copy all objects in a container, set bSelected 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations

Example

L_VOID TestClipboard(LAnnotation& LeadAnn,HWND hWnd)
{
if (LeadAnn.IsClipboardReady() == TRUE)
{
LAnnContainer LeadAContainer ;
ANNPOINT AnnPoint ;

LeadAnn.GetTopContainer(&LeadAContainer) ;
LeadAnn.CopyToClipboard() ;

LeadAnn.Destroy() ;

//...

AnnPoint.x = 30 ;
AnnPoint.y = 30 ;

LeadAContainer.CopyFromClipboard(hWnd) ;
LeadAContainer.Flip(&AnnPoint) ;
}
}


LAnnotation::CreateAnnObject

#include "ltwrappr.h"

static LAnnotation L_FAR * LAnnotation::CreateAnnObject(hAnnObject)

HANNOBJECT hAnnObject;

/* handle of the annotation object */

Creates an annotation class object of the specified type. You can use this static function to get a proper annotation class object that is compatible and of the same type as the passed annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAnnObject | Handle of the annotation object.

Returns

A pointer to the created annotation class object.

Comments

The passed annotation handle will be associated with the created annotation class object. You can get the type of the returned object by calling LAnnotation::GetType. Then you can cast the returned pointer to the correct type.

You are responsible for deleting the created 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::CutToClipboard

#include "ltwrappr.h"

virtual L_INT LAnnotation::CutToClipboard(uFormat=ANNFMT_NATIVE, bSelected=FALSE, bEmpty=FALSE, fCheckMenu=FALSE)

L_UINT uFormat; | /* format for the annotation data */
L_BOOL bSelected; | /* flag that indicates whether to copy all selected objects, or just the specified object */
L_BOOL bEmpty; | /* flag that indicates whether to empty the clipboard prior to copying the annotation data to it */
L_BOOL fCheckmenu; | /* flag that indicates whether to check the automation menu */

Cuts the annotation object to the Windows clipboard in either the native format or WMF format. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Use the LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | Use the XML format.
bSelected | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions.
 | FALSE | Copy only the specified object.
bEmpty | 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

Use the WMF format only for copying for use in another application.

If the annotation object is a container, then to retain scaling and positioning information, this function will always copy the root container, along with the specified object or selected objects. Use the bSelected parameter as follows:

To copy only selected objects in a container, set bSelected to TRUE.

To copy all objects in a container, set bSelected to FALSE.

You can copy data from the clipboard to a container using LAnnContainer::CopyFromClipboard.

The object is invalidated after the functions returns.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestClipboard(LAnnotation& LeadAnn,HWND hWnd,HDC hdcPrinter)
{
if (LeadAnn.IsClipboardReady() == TRUE)
{
ANNPOINT AnnPt ;
HANNOBJECT hAnnObject ;
LAnnotation L_FAR *pMyAnn ;
HDC hDC ;
RECT Rect ;

LeadAnn.CutToClipboard() ;

LeadAnn.GetTopContainer(&hAnnObject) ;
//...
//...

pMyAnn = LeadAnn.CreateAnnObject(hAnnObject) ;

hDC = GetDC(hWnd) ;

pMyAnn->GetBoundingRect(&Rect) ;
pMyAnn->Draw(hDC,&Rect);

ReleaseDC(hWnd,hDC) ;

if (pMyAnn->IsVisible() == FALSE)
pMyAnn->SetVisible(TRUE) ;

AnnPt.x = 30 ;
AnnPt.y = 30 ;

pMyAnn->Flip(&AnnPt) ;

//...
//...

AnnPt.x -= 10 ;
pMyAnn->Reverse(&AnnPt) ;
pMyAnn->Resize((L_DOUBLE) 0.5,(L_DOUBLE) 0.5, &AnnPt, ANNFLAG_RECURSE);
pMyAnn->Rotate(90,&AnnPt) ;

// print MyAnn to printer
pMyAnn->Print(hdcPrinter,&Rect) ;

pMyAnn->Remove() ;
}
}


LAnnotation::Define

#include "ltwrappr.h"

virtual L_INT LAnnotation::Define(pPoint, uState)

LPPOINT pPoint; | /* pointer to a POINT structure */
L_UINT uState; | /* state of the process */

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
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. Possible values are:
 | 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 the 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_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 LAnnotation::Define with this flag prior to calling LAnnotation::Define with the ANNDEFINE_BEGINROTATE flag.
 | 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 LAnnotation::Define with the ANNDEFINE_SETANCHORPOINT flag prior to calling LAnnotation::Define 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

Returns

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

Comments

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.

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 LAnnotation::Define with the ANNDEFINE_SETANCHORPOINT flag set, prior to calling LAnnotation::Define 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;
pLAnnotationObject->Define( &ptLocation, ANNDEFINE_SETANCHORPOINT);
pLAnnotationObject->Define(&pMousePos->pt, ANNDEFINE_BEGINROTATE);

// One or more ANNDEFINE_APPEND
pLAnnotationObject->Define(&pMousePos->pt, ANNDEFINE_APPEND);

pLAnnotationObject->Define(&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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID MyDefine(LAnnPolygon L_FAR * pAnnObject,HWND hWnd)
{
RECT rClientRect;
POINT MyPoint;

GetClientRect(hWnd,&rClientRect) ;

// Set the point for the opposite corner of the rectangle
MyPoint.x = rClientRect.right / 2;
MyPoint.y = rClientRect.bottom / 2;

// Finish defining the rectangular annotation object
pAnnObject->Define( &MyPoint, ANNDEFINE_END);
}


LAnnotation::Define2

#include "ltwrappr.h"

virtual L_INT LAnnotation::Define2(apt, uState)

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
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 LAnnotation::Define2 with this flag set prior to calling LAnnotation::Define2 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:
 |  | LAnnLine
 |  | LAnnPolyline
 |  | LAnnPolygon
 |  | LAnnPointer
 |  | LAnnFreeHand
 |  | LAnnFreeHandHotSpot
 |  | LAnnRuler
 |  | LAnnCrossProduct
 |  | LAnnProtractor
 |  | LAnnCurve
 |  | LAnnCurveClosed
 | 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)
 |  | LAnnRectangle
 |  | LAnnEllipse
 |  | LAnnHilite
 |  | LAnnRedact
 |  | LAnnText
 |  | LAnnNote
 |  | LAnnStamp
 |  | LAnnHotSpot
 | When doing this, call LAnnotation::Define2 with the ANNDEFINE_SETANCHORPOINT flag set prior to calling LAnnotation::Define2 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 LAnnotation::Define, except that LAnnotaion::Define2 takes a point in container coordinates, whereas LAnnotation::Define 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 LAnnotation::Define.

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 LAnnotation::Define, but because LAnnotation::Define 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 LAnnotation::Define2 and LAnnotation::Define as follows:

L_VOID ExampleDefine2(LAnnotation *LAnnObject)
{
ANNPOINT aptAnchor;
ANNPOINT aptMove;
ANNPOINT ptLocation;
aptMove.x = 10.2;
aptMove.y = 10.5;
aptAnchor.x = 10.2;
aptAnchor.y = 50.5;
ptLocation.x = 10;
ptLocation.y = 20;

LAnnObject->Define2(&aptAnchor, ANNDEFINE_SETANCHORPOINT);
LAnnObject->Define2(&aptMove, ANNDEFINE_BEGINROTATE);
// One or more ANNDEFINE_APPEND
LAnnObject->Define(&ptLocation, ANNDEFINE_APPEND);
LAnnObject->Define(&ptLocation, 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects

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(LAnnRectangle *pLRect)
{
// 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;
LAnnContainer LTmpContainer;

uType = pLRect->GetType();
if (uType != ANNOBJECT_RECT)
{
MessageBox(NULL, TEXT("Object must be a rectangle"), TEXT("Error"), MB_OK);
return;
}

pLRect->GetRotateAngle (&dAngle);
if (dAngle != 0)
{
MessageBox(NULL, TEXT("Object must not be rotated"), TEXT("Error"), MB_OK);
return;
}
++nCallCount;
switch (nCallCount)
{
case 1:
pLRect->GetRect(&arcRect, NULL);
aptAnchor.x = (arcRect.left + arcRect.right) / 2;
aptAnchor.y = arcRect.bottom;

aptMove.x = (arcRect.left + arcRect.right) / 2;
aptMove.y = arcRect.top;

pLRect->Define2(&aptAnchor, ANNDEFINE_SETANCHORPOINT);
pLRect->Define2(&aptMove, ANNDEFINE_BEGINMOVEPOINT);
MessageBox(NULL, TEXT("Call ExampleAnnDefine2 to complete the rotate/resize"), TEXT(""), MB_OK);
break;

case 2:
pLRect->GetRect(&arcRect, NULL);
aptMove.x = arcRect.right;
aptMove.y = arcRect.top;

pLRect->GetTopContainer(&LTmpContainer);
LTmpContainer.Convert(&ptMove, &aptMove, 1, ANNCONVERT_TO_CLIENT);

pLRect->Define(&ptMove, ANNDEFINE_END);
nCallCount = 0;
MessageBox(NULL, TEXT("Rotate/resize finished!"), TEXT(""), MB_OK);
break;
}
return;
}


LAnnotation::Destroy

#include "ltwrappr.h"

virtual L_INT LAnnotation::Destroy(uFlags=0)

L_UINT uFlags;

/* flags that determine which objects to process */

Deletes the annotation object and frees the memory used to store it. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 does not destroy the class object.

This function applies to multiple and selected objects based on values of the uFlags parameter.

You should not call this function during processing of WM_LTANNEVENT if wParam equals LTANNEVENT_REMOVE or LTANNEVENT_INSERT or during the LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CopyToClipboard.


LAnnotation::Draw

#include "ltwrappr.h"

virtual L_INT LAnnotation::Draw(hDC, prcInvalid)

HDC hDC; | /* handle to the device context */
LPRECT prcInvalid; | /* pointer to a Windows RECT structure */

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.

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 LAnnotation::BringToFront and LAnnotation::SendToBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Flip

#include "ltwrappr.h"

virtual L_INT LAnnotation::Flip(pCenter, uFlags=0)

pANNPOINT pCenter; | /* pointer to a LEADTOOLS ANNPOINT structure */
L_UINT uFlags; | /* flags that determine which objects to process */

Flips the annotation object, top to bottom. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 an object that includes text, the text will move to the new position, but will retain its orientation.

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: | Class Members
Topics: | Annotation Functions: Doing Geometric Transformations
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::GetActiveState

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetActiveState(L_VOID)

Gets the Activation State of the specified object. This function is available in the Document/Medical Toolkits.

Returns

The object's activation state constant. 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.

Comments

The following types of objects respond to activation events:

Automation object

AudioClip

Button

HotSpot

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations

Example

L_VOID TestFunction(LAnnotation& LeadAnn)
{
L_UINT uActiveState ;
ANNRECT AnnRect ;

uActiveState = LeadAnn.GetActiveState() ;
if (uActiveState != ANNACTIVE_ENABLED)
LeadAnn.SetActiveState(ANNACTIVE_ENABLED) ;

LeadAnn.GetRect(&AnnRect);

}


LAnnotation::GetArea

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetArea(puCount)

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
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 LAnnotation::GetRgnHandle 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.

See Also

Functions: | LAnnotation::GetRgnHandle
Topics: | Annotation Functions: Object Information
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

void CVCAnnotation11Dlg::OnButtonGetRgnHandle()
{
LBitmap MyBitmap;
ANNRECT annRect;
L_UINT32 uCount;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnRectangle MyAnnRectangle;
annRect.left = 50;
annRect.top = 50;
annRect.right = 150;
annRect.bottom = 150;
MyAnnRectangle.SetRect(&annRect);

//Area = 101 x 101
MyAnnRectangle.GetArea(&uCount);

HRGN hRgn;
RECT rect;

//Bounding rectangle is (50,50,151,151)
MyAnnRectangle.GetRgnHandle(&hRgn);
GetRgnBox(hRgn, &rect);
}


LAnnotation::GetAutoBackColor

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetAutoBackColor(uObjectType, pcrBack)

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

See Also

Functions: | LAnnotation::SetAutoBackColor, LAnnotation::GetBackColor, LAnnotation::SetBackColor, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Color Values in LEADTOOLS

Example

void TestFunction()
{
// This example will rotate the colors through all the
 object types.
COLORREF crColor1, crColor2;
LAnnotation lAutomation;

lAutomation.GetAutoBackColor(ANNOBJECT_NOTE,
 &crColor2);

lAutomation.GetAutoBackColor(ANNOBJECT_HILITE,
 &crColor1);
lAutomation.SetAutoBackColor(ANNOBJECT_NOTE,
 crColor1);

lAutomation.GetAutoBackColor(ANNOBJECT_REDACT,
 &crColor1);
lAutomation.SetAutoBackColor(ANNOBJECT_HILITE,
 crColor1);

lAutomation.GetAutoBackColor(ANNOBJECT_TEXT,
 &crColor1);
lAutomation.SetAutoBackColor(ANNOBJECT_REDACT,
 crColor1);

lAutomation.SetAutoBackColor(ANNOBJECT_TEXT,
 crColor2);
}


LAnnotation::GetAutoMenuItemEnable

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetAutoMenuItemEnable(nObjectType, uItem, puEnable)

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
nObjectType | Constant that specifies an object's type. 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
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.

See Also

Functions: | LAnnotation::SetAutoMenuItemEnable, LAnnAutomation::SetAutoText, LAnnAutomation::GetAutoText, LAnnotation::GetAutoMenuState, LAnnotation::SetAutoMenuState, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnotation::SetAutoMenuItemEnable.


LAnnotation::GetAutoMenuState

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetAutoMenuState(nObjectType, pEnable, pEnableFlags, uBits)

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
nObjectType | Constant that specifies an object's type. For descriptions of possible object types, refer to Types of Annotations.
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 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.

See Also

Functions: | LAnnotation::SetAutoMenuState, LAnnotation::GetAutoMenuItemEnable, LAnnotation::SetAutoMenuItemEnable, LAnnAutomation::SetAutoText, LAnnAutomation::GetAutoText, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnotation::SetAutoMenuState.


LAnnotation::GetAutoSnapCursor

#include "ltwrappr.h"

L_INT LAnnotation::GetAutoSnapCursor(pbSnap)

L_BOOL *pbSnap;

/* pointer to a variable */

Gets the behavior of the cursor location when creating annotations using automation in design mode. This function is available in the Document/Medical Toolkits.

Parameter | Description
pbSnap | Pointer to a variable to be updated with a value that indicates whether or not 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.

See Also

Functions:

LAnnotation::SetAutoSnapCursor, LAnnAutomation::GetAutoCursor, LAnnotation::SetUserData, LAnnotation::GetUserData, LAnnAutomation::SetAutoCursor, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::GetAutoBackColor, LAnnAutomation::GetAutoContainer, LAnnAutomation::GetAutoDialogFontSize, LAnnAutomation::IsAutoDrawEnabled, LAnnAutomation::IsAutoMenuEnabled, LAnnotation::GetAutoMenuItemEnable, LAnnotation::GetAutoMenuState, LAnnAutomation::GetAutoOptions, LAnnAutomation::GetAutoText, LAnnAutomation::GetAutoTextLen, LAnnAutomation::GetAutoUndoEnable, LAnnotation::SetAutoBackColor, LAnnAutomation::SetAutoContainer, LAnnotation::SetAutoDefaults, LAnnAutomation::SetAutoDialogFontSize, LAnnAutomation::SetAutoDrawEnabled, LAnnAutomation::SetAutoMenuEnabled, LAnnotation::SetAutoMenuItemEnable, LAnnotation::SetAutoMenuState, LAnnAutomation::SetAutoOptions, LAnnAutomation::SetAutoText, LAnnAutomation::SetAutoUndoEnable, LAnnotation::GetOptions, LAnnotation::SetOptions

Topics:

Displaying and Manipulating Annotation Objects

Obtaining Annotation Object Information

Annotation Functions: (Document/Medical only) Getting and Setting Cursor Properties

New Annotation Features of Version 14.5

Example

For an example, refer to LAnnotation::SetAutoSnapCursor.


LAnnotation::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnotation::GetBackColor(L_VOID)

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | LAnnotation::SetForeColor, LAnnotation::SetBackColor, LAnnotation::GetForeColor, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetBoundingRect

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetBoundingRect(pRect, pRectName=NULL)

LPRECT pRect; | /* pointer to a RECT structure */
LPRECT pRectName; | /* address of a variable to be updated */

Gets the bounding rectangle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pRect | Pointer to the RECT structure to be updated with the annotation object’s bounding rectangle. Pass NULL if you do not wish to retrieve this information.
pRectName | Address of a 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

This is the rectangle in which the object is displayed.

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 LAnnotation::GetRect 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.

If the annotation object name is being displayed (see LAnnotation::SetNameOptions and LAnnotation::GetNameOptions for more information on annotation objects 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 the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnotation & Annotation)
{
RECT rcAnnObjectBounds;
RECT rcAnnNameBounds;
L_TCHAR szMessage[256];

Annotation.GetBoundingRect(&rcAnnObjectBounds, &rcAnnNameBounds);

wsprintf(szMessage, TEXT("Object Bounds: %d, %d, %d, %d\n"
"Name Bounds: %d, %d, %d, %d"),
rcAnnObjectBounds.left,
rcAnnObjectBounds.top,
rcAnnObjectBounds.right,
rcAnnObjectBounds.bottom,
rcAnnNameBounds.left,
rcAnnNameBounds.top,
rcAnnNameBounds.right,
rcAnnNameBounds.bottom);

MessageBox(NULL, szMessage, TEXT("Testing"), MB_OK);
}


LAnnotation::GetContainer

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetContainer(phContainer)

virtual L_INT LAnnotation::GetContainer(pLContainer)

pHANNOBJECT phContainer; | /* address of the HANNOBJECT variable to be updated with the handle of the container */
LAnnContainer L_FAR * pLContainer; | /* pointer to an LAnnContainer object */

Gets the handle of the Container of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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.
pLContainer | Pointer to an the LAnnContainer object 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 LAnnotation::GetContainer(phContainer), 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.

Before calling LAnnotation::GetContainer(pLContainer), you must declare a class object of type LAnnContainer. Then, pass the address of the variable in the pLContainer parameter. This function will update the object 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnotation::GetContainer(phContainer):

L_VOID TestGetContainer(LAnnotation& LeadAnn)
{
HANNOBJECT hAnnObject ;
LeadAnn.GetContainer(&hAnnObject) ;

//...
}

This is an example for LAnnotation::GetContainer(pLContainer):

L_VOID TestGetContainer(LAnnotation& LeadAnn)
{
LAnnContainer LeadAContainer ;
L_UINT uUserMode ;

LeadAnn.GetContainer(&LeadAContainer) ;

uUserMode = LeadAContainer.GetUserMode();
if (uUserMode != ANNUSER_RUN)
LeadAContainer.SetUserMode(ANNUSER_RUN);
}


LAnnotation::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetFillMode(L_VOID)

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

Value | Meaning
ANNMODE_TRANSPARENT | [0] Transparent
ANNMODE_TRANSLUCENT | [1] Translucent
ANNMODE_OPAQUE | [2] Opaque

Comments

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.

See Also

Functions: | LAnnotation::SetFillMode, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetFillModeExt

#include "ltwrappr.h"

L_INT LAnnotation::GetFillModeExt(puFillMode, pnAlpha)

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
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 LAnnotation::GetFillMode, you can use this function to get the fill mode settings for annotation objects. This function extends the LAnnotation::GetFillMode function to support the new fill mode ANNMODE_ALPHA.

Before calling LAnnotation::GetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation& annAutomation)
{
L_UINT nRet, uOptions = 0;
nRet = annAutomation.GetOptions( &uOptions);
nRet = annAutomation.SetOptions( 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 pnAlpha value. If you do not want the alpha value, pass NULL for the pnAlpha 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 LAnnotation::SetROP2 function and the LAnnotation::SetFillModeExt 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.

See Also

Functions: | LAnnotation::GetFillMode, LAnnotation::SetFillMode, LAnnotation::SetFillModeExt, LAnnAutomation::SetFillPattern, LAnnAutomation::GetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, LAnnotation::SetBackColor, LAnnotation::SetForeColor, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only) Displaying Annotations
 | Implementing Annotations
 | Annotation Functions: Object Information
 | Annotation Functions: Object Properties
 | 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

Example

For an example, refer to LAnnotation::SetFillModeExt.


LAnnotation::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* character string to be updated */

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | 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

pFontName must be large enough to hold the returned 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.

See Also

Functions: | LAnnotation::SetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetFontNameLen(L_VOID)

Gets the length of the character string that holds the name of the font used by the annotation object. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetFontSize(L_VOID)

Gets the current unscaled value of the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the annotation object.

Comments

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.

See Also

Functions: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnotation::GetForeColor(L_VOID)

Gets the current value of the annotation object's foreground color.

Returns

The annotation object's current foreground color.

This function is available in the Document/Medical Toolkits.

Comments

To see how the foreground color relates to the fill modes, 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.

See Also

Functions: | LAnnotation::SetForeColor, LAnnotation::SetBackColor, LAnnotation::GetBackColor, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetHandle

#include "ltwrappr.h"

HANNOBJECT LAnnotation::GetHandle(L_VOID)

Gets the handle of the class object's associated annotation object. This function is available in the Document/Medical Toolkits.

Returns

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

See Also

Functions:

Class Members

Example

For an example, refer to LAnnotation::Copy(AnnSource).


LAnnotation::GetHyperlink

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetHyperlink(puType, puMsg, pwParam, pLink)

L_UINT L_FAR * puType; | /* address of the variable to be updated with the value indicating the hyperlink type */
L_UINT L_FAR * puMsg; | /* address of the variable to be updated with the value of 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 annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::GetHyperlinkLen and get the string length, allocate a buffer large enough to store the string and the NULL at the end, and then call LAnnotation::GetHyperlink. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions (Document/Medical only): Hyperlinks

Example

L_VOID TestHyperLink(LAnnotation& LeadAnn)
{
L_UINT uType; // variable to hold hyperlink type
L_UINT uMsg; // variable to hold hyperlink msg
WPARAM wParam; // variable to hold hyperlink msg param
L_TCHAR Buffer[2048]; // buffer to hold hyperlink string
L_UINT uLen ; // length of hyperlink
L_TCHAR szMessage[80];

LeadAnn.GetHyperlink( &uType, &uMsg, &wParam, Buffer);

if (uType != ANNLINK_WEBPAGE)
LeadAnn.SetHyperlink(ANNLINK_WEBPAGE, 0, 0, TEXT("http://www.leadtools.com "),
ANNFLAG_RECURSE|ANNFLAG_SELECTED);

// get the length of the hyperlink property
uLen = LeadAnn.GetHyperlinkLen();
wsprintf(szMessage, TEXT("Length of hyperlink = %u\n"),uLen);
MessageBox(NULL,szMessage, TEXT("Hyperlink"),MB_OK) ;
}


LAnnotation::GetHyperlinkLen

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetHyperlinkLen(L_VOID)

Gets the length of the annotation object's hyperlink string. This function is available in the Document/Medical Toolkits.

Returns

The length of the hyperlink string.

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 LAnnotation::GetHyperlink. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions (Document/Medical only): Hyperlinks

Example

For an example, refer to LAnnotation::GetHyperlink.


LAnnotation::GetNameOptions

#include "l_bitmap.h"

virtual L_INT LAnnotation::GetNameOptions(pNameOptions, uStructSize)

pANNNAMEOPTIONS pNameOptions; | /* pointer to a structure that specifies the name options */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pNameOptions, for versioning. Use sizeof(ANNNAMEOPTIONS). */

Gets the name options for the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pNameOptions | Pointer to an ANNNAMEOPTIONS structure to be updated with the name options.
uStructSize | Size in bytes, of the structure pointed to by pNameOptions. 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.

See Also

Functions: | LAnnotation::SetNameOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::GetOffsetX

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetOffsetX(L_VOID)

Gets the X offset of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The specified object's X offset.

Comments

Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the LAnnotation::SetScalarX and LAnnotation::SetScalarY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

L_VOID TestOffset(LAnnotation& LeadAnn)
{
L_DOUBLE dOffsetX, dOffsetY; // Variables for updating offsets
ANNRECT AnnRect;

dOffsetX = LeadAnn.GetOffsetX();
dOffsetY = LeadAnn.GetOffsetY();

// Get the container rectangle to use for positioning the line
LeadAnn.GetRect( &AnnRect);

LeadAnn.SetOffsetX( dOffsetX + ((AnnRect.right - AnnRect.left) / 20));
LeadAnn.SetOffsetY( dOffsetY + ((AnnRect.bottom - AnnRect.top) / 20));
}


LAnnotation::GetOffsetY

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetOffsetY(L_VOID)

Gets the Y offset of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The specified object's Y offset.

Comments

Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the LAnnotation::SetScalarX and LAnnotation::SetScalarY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnotation::GetOffsetX.


LAnnotation::GetOptions

#include "ltwrappr.h"

L_INT LAnnotation::GetOptions(puOptions)

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
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 multi-select 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 LAnnotation::SetOptions with the desired flags. To get the current v14.5 options, call LAnnotation::GetOptions. 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.

See Also

Functions: | LAnnotation::SetOptions, ANNBUTTON, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnAutomation::SetAutoCursor, LAnnAutomation::GetAutoCursor, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnotation::SetTextOptions, LAnnotation::GetTextOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows, LAnnotation::CalibrateRuler
Topics: | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects
 | Annotation Functions (Document/Medical only) Displaying Annotations

Example

For an example, refer to LAnnotation::SetOptions.


LAnnotation::GetPredefinedMetafile

#include "ltwrappr.h"

static L_INT LAnnotation::GetPredefinedMetafile(uType, phMetafile, pbEnhanced)

L_UINT uType; | /* constant that indicates the metafile to retrieve */
HMETAFILE * phMetafile; | /* pointer to a variable to be updated with the handle to the metafile */
L_BOOL * 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

You must free the metafile handle when you are finished, using either 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.

See Also

Functions: | LAnnotation::SetPredefinedMetafile, LAnnFreehandHotSpot::GetMetafile, LAnnFreehandHotSpot::SetMetafile, LAnnHotSpot::GetMetafile, LAnnHotSpot::SetMetafile, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnAutomation::GetPointOptions, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Annotation Bitmap Objects

Example

L_VOID TestFunction()
{
HMETAFILE hMetafile;
L_BOOL bEnhanced;

LAnnotation::GetPredefinedMetafile(ANNMETAFILE_IMPORTANT,
&hMetafile, &bEnhanced);

//... Do something with hMetafile
}


LAnnotation::GetRect

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetRect(pRect, pRectName=NULL)

pANNRECT pRect; | /* pointer to an ANNRECT structure */
pANNRECT pRectName; | /* address of a variable to be updated */

Gets the current defining rectangle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pRect | Pointer to an ANNRECT structure to be updated with the annotation object's current rectangle. Pass NULL if you do not wish to retrieve this information.
pRectName | Address of a 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

Every object has a defining rectangle, which intersects the object's outermost points.

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 LAnnotation::GetBoundingRect function.

Half the width of an object's outer line is outside its defining rectangle.

If the annotation object name is being displayed (see LAnnotation::SetNameOptions and LAnnotation::GetNameOptions for more information on annotation objects 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 the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnotation & Annotation)
{
ANNRECT rcAnnObjectBounds;
ANNRECT rcAnnNameBounds;
L_TCHAR szMessage[256];

Annotation.GetRect(&rcAnnObjectBounds, &rcAnnNameBounds);

wsprintf(szMessage, TEXT("Object Bounds: %lf, %lf, %lf, %lf\n")
TEXT("Name Bounds: %lf, %lf, %lf, %lf"),
rcAnnObjectBounds.left,
rcAnnObjectBounds.top,
rcAnnObjectBounds.right,
rcAnnObjectBounds.bottom,
rcAnnNameBounds.left,
rcAnnNameBounds.top,
rcAnnNameBounds.right,
rcAnnNameBounds.bottom);

MessageBox(NULL, szMessage, TEXT("Testing"), MB_OK);
}


LAnnotation::GetRestrictToContainer

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetRestrictToContainer(pbRestrict)

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

See Also

Functions: | Class Members, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::SetRestrictToContainer.


LAnnotation::GetRgnHandle

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetRgnHandle(phRgn, pXForm=NULL)

HRGN L_FAR * phRgn; | /* address of the variable to be updated */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */

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
phRgn | Address of the variable to be updated with the handle to the region, if the function is successful.
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.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LAnnotation::GetArea.


LAnnotation::GetROP2

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetROP2(L_VOID)

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.

Returns

The ROP2 code. Possible 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.

Default is ANNROP2_COPY.

Comments

The ROP2 codes specify how pen or brush colors are to be combined with the colors in the image.

The LAnnotation::GetROP2 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 LAnnotation::GetROP2 function with an object that does not support it, the method returns Error (-16), which is "Feature not supported".

Call the LAnnotation::SetROP2 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.

See Also

Functions: | Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions (Document/Medical only) Displaying Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestROP(LAnnotation& LeadAnn)
{
L_UINT uRop2; // ROP2 code

// Get the current ROP2 code
uRop2 = LeadAnn.GetROP2();

// if the code is not ANNROP2_AND, make it so
if(uRop2 != ANNROP2_AND)
LeadAnn.SetROP2(
 ANNROP2_AND, ANNFLAG_RECURSE); // set ROP2 code
}


LAnnotation::GetRotateOptions

#include "ltwrappr.h"

L_INT LAnnotation::GetRotateOptions(pRotateOptions, uStructSize)

pANNROTATEOPTIONS pRotateOptions; | /* pointer to a 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
pRotateOptions | Pointer to an ANNROTATEOPTIONS structure that specifies the rotate options to be 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

This function is one of the new functions being introduced as part of Version 14.5. 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.

For Version 14.5, this functionality can be enabled using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation&
 annAutomation)
{
L_UINT nRet, uOptions = 0;
nRet = annAutomation.GetOptions( &uOptions);
nRet = annAutomation.SetOptions( uOptions
 | OPTIONS_NEW_ROTATE);
}

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: | LAnnotation::SetRotateOptions, LAnnContainer::HitTestExt, LAnnotation::SetOptions, LAnnotation::IsSelected, LAnnotation::SetSelected, LAnnAutomation::SetAutoCursor
Topics: | Annotation Functions: (Document/Medical only) Getting and Setting the Rotation Properties
 | Altering Annotation Object Settings
 | New Annotation Features of Version 14.5
 | Flipping, Reversing and Rotating Annotation Objects

Example

void GetrotateoptionsExample(LAnnRectangle annrect)
{
// This example toggles whether 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 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 = annrect.GetRotateOptions(&RotateOptions,
 sizeof(ANNROTATEOPTIONS));
if (nRet != SUCCESS)
return ;

wsprintf(szMsg, TEXT("Old State: bShowRotateHandles:
 %s"), RotateOptions.bShowRotateHandles ? TEXT("TRUE") :
 TEXT("FALSE"));
MessageBox(NULL, szMsg, "", MB_OK);

// Change the state
RotateOptions.bShowRotateHandles = !RotateOptions.bShowRotateHandles;
nRet = annrect.SetRotateOptions(&RotateOptions,
 0);
if (nRet != SUCCESS)
return ;

nRet = annrect.GetRotateOptions(&RotateOptions,
 sizeof(ANNROTATEOPTIONS));
if (nRet != SUCCESS)
return ;

wsprintf(szMsg, TEXT("New State: bShowRotateHandles:
 %s"), RotateOptions.bShowRotateHandles ? TEXT("TRUE") :
 TEXT("FALSE"));
MessageBox(NULL, szMsg, "", MB_OK);
}


LAnnotation::GetScalarX

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetScalarX(L_VOID)

Gets the horizontal scaling factor that is applied to the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The horizontal scaling factor.

Comments

Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the LAnnotation::SetOffsetX and LAnnotation::SetOffsetY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestScalar(LAnnotation& LeadAnn,LBitmapBase& LeadBitmap)
{
L_INT nXPercent, nYPercent; // X and Y scale percentage
L_DOUBLE dXScalar, dYScalar; // X and Y floating point scalars
L_TCHAR szMessage[80]; // Message buffer
RECT rClientArea ;

// Get the floating point scalars
dXScalar = LeadAnn.GetScalarX();
dYScalar = LeadAnn.GetScalarY();

// Convert the scalars to percentages
nXPercent = (L_INT)(dXScalar * 100);
nYPercent = (L_INT)(dYScalar * 100);

// Display the percentages in a message
wsprintf (szMessage, TEXT("%d percent X and %d percent Y"), nXPercent, nYPercent);
MessageBox (NULL, szMessage, TEXT("Notice"), MB_OK);
//...
//...
GetClientRect(LeadAnn.GetWnd(),&rClientArea);

LeadAnn.SetScalarX((L_DOUBLE) rClientArea.right / LeadBitmap.GetWidth());
LeadAnn.SetScalarY((L_DOUBLE) rClientArea.bottom / LeadBitmap.GetHeight());
//...
}


LAnnotation::GetScalarY

#include "ltwrappr.h"

virtual L_DOUBLE LAnnotation::GetScalarY(L_VOID)

Gets the vertical scaling factor that is applied to the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The vertical scaling factor.

Comments

Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the LAnnotation::SetOffsetX and LAnnotation::SetOffsetY 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::GetScalarX.


LAnnotation::GetTag

#include "ltwrappr.h"

virtual L_UINT32 LAnnotation::GetTag(L_VOID)

Gets the tag of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's tag.

Comments

You can use this tag to uniquely identify objects when they are saved in a file.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestTag(LAnnotation& LeadAnn)
{
L_UINT32 ulTag ;
L_UINT uAnnType ;

ulTag = LeadAnn.GetTag() ;

if (ulTag == 3)
MessageBox (NULL, TEXT("This is what we do for No. 3"), TEXT("Notice"), MB_OK);
else
{
if (LeadAnn.IsSelected() == FALSE)
{
LeadAnn.SetSelected(TRUE,ANNFLAG_RECURSE) ;
LeadAnn.SetTag( 3, ANNFLAG_SELECTED);
}
}

uAnnType = LeadAnn.GetType() ;
if (uAnnType == ANNOBJECT_ELLIPSE)
MessageBox(NULL, TEXT("Annotation has an ellipse object ..."), TEXT("Notice"),MB_OK) ;
}


LAnnotation::GetTextOptions

#include "ltwrappr.h"

L_INT LAnnotation::GetTextOptions(pTextOptions, uStructSize)

pANNTEXTOPTIONS pTextOptions; | /*pointer to a structure that specifies text options */
L_UINT uStructSize; | /* size of the ANNTEXTOPTIONS structure */

Sets the text options for the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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. If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function. 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 class object parameter can represent any annotation object type, but the return information is only useful for text annotations.

Note:

In Version 14.5, you need to first enable this function by calling LAnnotation::SetOptions 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.

See Also

Functions: | LAnnotation::SetTextOptions, LAnnAutomation::SetText, LAnnAutomation::GetText, LAnnAutomation::GetTextLen, LAnnAutomation::SetTextAlign, LAnnAutomation::GetTextAlign, LAnnAutomation::SetTextRotate, LAnnAutomation::GetTextRotate, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions: Object Properties
 | Annotation Functions (Document/Medical only): Getting and Setting Text Properties
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Annotation Functions: 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 LAnnotation::SetTextOptions.


LAnnotation::GetTopContainer

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetTopContainer(phContainer)

virtual L_INT LAnnotation::GetTopContainer(pLContainer)

pHANNOBJECT phContainer; | /* address of the HANNOBJECT variable to be updated*/
LAnnContainer L_FAR * pLContainer; | /* pointer to an LAnnContainer object */

Gets the handle of the Root Container of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
phContainer | Address of the HANNOBJECT variable to be updated with the handle of the root container
pLContainer | Pointer to the LAnnContainer object 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 LAnnotation::GetTopContainer(phContainer), 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.

Before calling LAnnotation::GetTopContainer(pLContainer), you must declare a class object of type LAnnContainer. Then, pass the address of the object in the pLContainer parameter. This function will update the object 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example of LAnnotation::GetTopContainer(phContainer), refer to LAnnotation::CutToClipboard.

For an example of LAnnotation::GetTopContainer(pLContainer), refer to LAnnotation::CopyToClipboard.


LAnnotation::GetType

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetType(L_VOID)

Gets the type of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's type. For descriptions of possible object types, 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: | Class Members
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information

Example

For an example, refer to LAnnotation::GetTag.


LAnnotation::GetUserData

#include "ltwrappr.h"

virtual L_INT LAnnotation::GetUserData(pUserData, puUserDataSize)

L_UCHAR pUserData; | /* address of binary data to write */
L_UINT *puUserDataSize; | /* address of variable to updated with length of user data*/

Gets the user-defined data of one or more annotation objects. This function is available in the Document/Medical Toolkits.

Parameter | Description
pUserData | Address into which the binary data is read. 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.

LAnnotation lObject;

L_UCHAR *pUserData;

L_UINT uUserDataSize;

// Assume lObject is a valid annotation object

lObject.GetUserData(NULL, &uUserDataSize);

pUserData = (L_UCHAR *)malloc(uUserDataSize);

lObject.GetUserData(pUserData, &uUserDataSize);

User data can be binary or text data, and can be any length. When the annotion object is copied, and user data is also copied. When saving the annotation (LAnnContainer::Save, LAnnContainer::SaveMemory, LAnnContainer::SaveOffset), 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.

See Also

Functions: | LAnnAutomation::SetAutoCursor, LAnnAutomation::GetAutoCursor, Class Members, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Automated User Interface for Annotations
 | Implementing Annotations

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 LMemoryFile

// plObject -- the annotation object

// plBitmap -- the bitmap object is loaded/saved

// bLoad -- TRUE means load from the annotation object, FALSE means save to the annotation object

L_VOID SampleAnnUserData(LAnnotation *plObject, LMemoryFile
 *plBitmap, L_BOOL bSave)
{
HGLOBAL hGlobal = NULL;
L_UINT uUserDataSize;
L_UCHAR *pUserData;

if (!plBitmap->IsValid()
 || !plObject->IsValid())
return;

if (bSave) // saving
{
LBuffer LMemoryBuffer;
plBitmap->SaveBitmap(&LMemoryBuffer,
 FILE_BMP, 24, 0, NULL);
pUserData = (L_UCHAR *)GlobalLock(LMemoryBuffer.GetHandle());
uUserDataSize = LMemoryBuffer.GetSize();
plObject->SetUserData( pUserData
 , uUserDataSize, ANNFLAG_NOINVALIDATE );

GlobalUnlock(hGlobal);
GlobalFree(hGlobal);
}
else // loading
{
// Load
LBuffer LMemoryBuffer;
plObject->GetUserData(NULL,
 &uUserDataSize);
pUserData = (L_UCHAR *)malloc(uUserDataSize);
plObject->GetUserData(pUserData,
 &uUserDataSize);
LMemoryBuffer= (L_TCHAR L_FAR*)pUserData;
LMemoryBuffer.Reallocate(uUserDataSize);

plBitmap->LoadBitmap(LMemoryBuffer,
 0, ORDER_BGRORGRAY, NULL, NULL);
}
}


LAnnotation::GetUserMode

#include "ltwrappr.h"

virtual L_UINT LAnnotation::GetUserMode(L_VOID)

Gets the user mode of the 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.

Returns

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.

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: | Class Members
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations

Example

For an example, refer to LAnnotation::GetContainer.


LAnnotation::GetWnd

#include "ltwrappr.h"

virtual HWND LAnnotation::GetWnd(L_VOID)

Gets the window handle of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's window handle.

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: | Class Members
Topics: | Annotation Functions: Global Properties
 | Implementing Annotations

Example

L_VOID TestAnnWnd(LAnnotation& LeadAnn,HWND hWnd)
{
HWND hObjWnd ;

hObjWnd = LeadAnn.GetWnd() ;
if (hObjWnd == hWnd)
MessageBox(hWnd, TEXT("Already using the current window"), TEXT("Notice"),MB_OK) ;
}


LAnnotation::Group

#include "ltwrappr.h"

virtual L_INT LAnnotation::Group(uFlags, pUserList=NULL)

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
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 LAnnotation::Group(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.

See Also

Functions: | LAnnotation::Ungroup
Topics: | Displaying and Manipulating Annotation Objects

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd) prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonAnnGroup()
{
LAnnContainer *pAnnContainer;

LAnnotationWindow m_AnnotationWindow;

pAnnContainer = &(m_AnnotationWindow.GetContainerObject());
pAnnContainer->SetUser(NULL, TEXT("Terry"), ANNFLAG_RECURSE | ANNFLAG_SELECTED);
pAnnContainer->Group(ANNFLAG_SELECTED | ANNFLAG_USER, TEXT("Terry"));
}


LAnnotation::IsClipboardReady

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsClipboardReady(L_VOID)

Determines whether the Windows clipboard contains an annotation object that can be pasted using the LAnnContainer::CopyFromClipboard function. This function is available in the Document/Medical Toolkits.

Returns

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.

Comments

You can use LAnnotation::CopyToClipboard or LAnnotation::CutToClipboard to put valid annotation data on the clipboard. LAnnContainer::CopyFromClipboard can be used to copy valid annotation data from the clipboard to a 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CopyToClipboard.


LAnnotation::IsCreated

#include "ltwrappr.h"

L_BOOL LAnnotation::IsCreated(L_VOID)

Determines whether the class object has a created annotation object associated with it or not. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The annotation object is created.
FALSE | The annotation object is not created.

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:

Class Members

Example

L_VOID TestFunction (LAnnotation LeadAnnotation)
{
if (LeadAnnotation.IsCreated() == FALSE)
{
MessageBox(NULL, TEXT("Annotation was not created ..."), TEXT("Creating"),MB_OK);
return ;
}

if (LeadAnnotation.IsValid() == TRUE)
MessageBox(NULL, TEXT("Annotation has valid data ..."), TEXT("Validation"),MB_OK);
}


LAnnotation::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsFontBold(L_VOID)

Determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsFontItalic(L_VOID)

Determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontBold, LAnnotation::SetFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsFontStrikeThrough(L_VOID)

Determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsFontUnderline(L_VOID)

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::IsLocked

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsLocked(L_VOID)

Gets a value that indicates whether the annotation object is locked. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The object is locked.
FALSE | The object is not locked.

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 LAnnotation::Unlock 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 LAnnContainer::Unrealize.

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: | Class Members
Topics: | Annotation Functions (Document/Medical ): Security

Example

For an example, refer to LAnnotation::Unlock.


LAnnotation::IsSelected

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsSelected(L_VOID)

Indicates whether the annotation object is selected. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The object is selected.
FALSE | The object is not 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.

See Also

Functions: | Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnotation::GetRotateOptions, LAnnotation::SetRotateOptions
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information

Example

For an example, refer to LAnnotation::GetTag.


LAnnotation::IsValid

#include "ltwrappr.h"

L_BOOL LAnnotation::IsValid(L_VOID)

Determines whether an annotation object is valid. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The object is valid.
FALSE | The object is not valid.

Comments

The annotation object is considered valid only if the class object’s associated annotation object has been created and is of the same type as the class object. For example, a valid LAnnLine class object has a created Line 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.

See Also

Functions:

Class Members

Example

For an example, refer to LAnnotation::IsCreated.


LAnnotation::IsVisible

#include "ltwrappr.h"

virtual L_BOOL LAnnotation::IsVisible(L_VOID)

Gets a value that indicates whether the annotation object is visible. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The object is visible.
FALSE | The object is not visible.

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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Lock

#include "ltwrappr.h"

virtual L_INT LAnnotation::Lock(pLockKey, uFlags=0)

L_TCHAR L_FAR * pLockKey; | /* character string containing the key */
L_UINT uFlags; | /* flags that determine which objects to process */

Locks the annotation object with the specified key. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() 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

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 LAnnotation::Unlock 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 LAnnContainer::Unrealize.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions (Document/Medical ): Security
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction (LAnnotation& LeadAnn)
{
L_INT nRet = 0 ;
// lock all selected items in the container
nRet = LeadAnn.Lock(TEXT("MyKey"), ANNFLAG_RECURSE | ANNFLAG_SELECTED);

if (nRet == SUCCESS)
{
LeadAnn.ShowLockedIcon( TRUE, ANNFLAG_RECURSE);
MessageBox(NULL, TEXT("All objects will be locked ..."), TEXT("Notice"),MB_OK);
}
}


LAnnotation::Move

#include "ltwrappr.h"

virtual L_INT LAnnotation::Move(dDx, dDy, uFlags=0)

L_DOUBLE dDx; | /* the distance to move the objects horizontally */
L_DOUBLE dDy; | /* the distance to move the objects vertically */
L_UINT uFlags; | /* flags that determine which objects to process */

Moves the annotation object, using unscaled delta values. This function is available in the Document/Medical Toolkits.

Parameter | Description
dDx | The distance to move the objects horizontally.
dDy | The distance 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 ( | ). 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 LAnnotation::SetScalarX and LAnnotation::SetScalarY functions. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Doing Geometric Transformations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::SetRect.


LAnnotation::Print

#include "ltwrappr.h"

virtual L_INT LAnnotation::Print(hDC, prcBounds)

HDC hDC; | /* handle to the device context */
LPRECT prcBounds; | /* pointer to a Windows RECT structure */

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

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Input and Output

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Realize

#include "ltwrappr.h"

virtual L_INT LAnnotation::Realize(pBitmap, prcBounds)

virtual L_INT LAnnotation::Realize(pLBitmap, prcBounds)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
LPRECT prcBounds; | /* pointer to the Windows RECT structure */

Applies the annotation object 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.
pLBitmap | Pointer to the LBitmapBase object 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.

Returns

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

Comments

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 LBitmapBase::ColorRes to change the image to a supported bits per pixel before calling LAnnotation::Realize.

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: | Class Members
Topics: | Annotation Functions: Input and Output
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnotation::Realize(pBitmap, prcBounds):

L_VOID TestRealize(LAnnotation& LeadAnn,pBITMAPHANDLE pBitmap)
{
LeadAnn.Realize(pBitmap,NULL);
//…
}

This is an example for LAnnotation::Realize(pLBitmap, prcBounds):

L_VOID TestRealize(LAnnotation& LeadAnn,LBitmapBase L_FAR *pLBitmap)
{
LeadAnn.Realize(pLBitmap,NULL);
//…
}


LAnnotation::Remove

#include "ltwrappr.h"

virtual L_INT LAnnotation::Remove(L_VOID)

Removes the annotation object from its current Container, leaving the object with no Container. This function is available in the Document/Medical Toolkits.

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 LAnnContainer::Insert 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.

See Also

Functions: | Class Members, LAnnotation::AdjustPoint, LAnnContainer::Convert, LAnnotation::Define2, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Object Information
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Resize

#include "ltwrappr.h"

virtual L_INT LAnnotation::Resize(dFactorX, dFactorY, pCenter, uFlags=0)

L_DOUBLE dFactorX; | /* amount to change the width*/
L_DOUBLE dFactorY; | /* amount to change the height */
pANNPOINT pCenter; | /* pointer to an ANNPOINT structure */
L_UINT uFlags; | /* flags that determine which objects to process */

Changes the size of the annotation object, letting you specify the point that is to remain stationary. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Doing Geometric Transformations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Reverse

#include "ltwrappr.h"

virtual L_INT LAnnotation::Reverse(pCenter, uFlags=0)

pANNPOINT pCenter; | /* pointer to the LEADTOOLS ANNPOINT structure */
L_UINT uFlags; | /* flags that determine which objects to process */

Reverses the annotation object, left to right. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

You cannot flip or reverse an object that contains text. If you flip or reverse an object that includes text, the text will move to the new position, but will retain its orientation.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Doing Geometric Transformations
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::Rotate

#include "ltwrappr.h"

virtual L_INT LAnnotation::Rotate(dAngle, pCenter, uFlags=0)

L_DOUBLE dAngle; | /* angle of rotation */
pANNPOINT pCenter; | /* pointer to the LEADTOOLS ANNPOINT structure */
L_UINT uFlags; | /* Flags that determine which objects to process */

Rotates the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

You cannot rotate a Note, HotSpot, Button, or AudioClip. If you rotate a Container that includes these objects, they will move to new positions, but will retain their orientation.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Doing Geometric Transformations
 | Flipping, Reversing and Rotating Annotation Objects
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::SendToBack

#include "ltwrappr.h"

virtual L_INT LAnnotation::SendToBack (L_VOID)

Reorders the annotation object so that it is displayed behind other objects in the same Container. This function is available in the Document/Medical Toolkits.

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 LAnnotation::Draw 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Size, Position, and Shape
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::SetRect.


LAnnotation::SetActiveState

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetActiveState(uState=ANNACTIVE_ENABLED)

L_UINT uState;

/* flag that indicates whether to enable the object */

Sets the Activation State of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uState | Flag that indicates whether to enable or disable the object. 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

AudioClip

Button

HotSpot

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations

Example

For an example, refer to LAnnotation::GetActiveState.


LAnnotation::SetAutoBackColor

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetAutoBackColor(uObjectType, crBack)

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
uObjectType | Type of object for which to change the background color. 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. 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.

See Also

Functions: | LAnnotation::GetAutoBackColor, LAnnotation::GetBackColor, LAnnotation::SetBackColor, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnotation::GetAutoBackColor.


LAnnotation::SetAutoDefaults

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetAutoDefaults(hAutoObject, uFlags=0)

virtual L_INT LAnnotation::SetAutoDefaults(AnnAuto, uFlags=0)

HANNOBJECT hAutoObject; | /* handle to the automation object.*/
LAnnAutomation &AnnAuto; | /* the automation object.*/
L_UINT uFlags; | /* flags that determine which objects to process*/

Assigns the default properties of the specified automation object to an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAutoObject | Handle to an automation object.
AnnAuto | The automation 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

See Also

Functions: | LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Working with the Toolbar

Example

This is an example, for both LAnnotation::SetAutoDefaults(hAutoObject, uFlags) and LAnnotation::SetAutoDefaults(AnnAuto, uFlags).

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd)
 prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonAnnSetAutodefaults()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

L_TCHAR szFontName[100];

LAnnAutomation AnnAutomation;
AnnAutomation.AddUndoNode();
AnnAutomation.SetFontName(TEXT("Courier"));
LAnnNote MyNote;

//Automation default font is set to Courier
//MyNote.SetAutoDefaults(AnnAutomation.GetHandle());

//Another way
MyNote.SetAutoDefaults(AnnAutomation);

MyNote.GetFontName(szFontName);

//Note font name is same as Automation (Courier)
AfxMessageBox(szFontName);
}


LAnnotation::SetAutoMenuItemEnable

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetAutoMenuItemEnable(nObjectType, uItem, uEnable, uFlags, pUserList)

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
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 Line 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 Stamp Metafile 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnAutomation::SetAutoText function.

Menu items can be enabled or disabled for one or more than one object, depending on the object. The following table indicates the possible options:

Menu Item String | Status | Object | 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.

See Also

Functions: | LAnnotation::GetAutoMenuItemEnable, LAnnAutomation::SetAutoText, LAnnAutomation::GetAutoText, LAnnotation::GetAutoMenuState, LAnnotation::SetAutoMenuState, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd)
 prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonAnnAutoMenu()
{
L_UINT Enable;
LAnnAutomation AnnAutomation;

   LAnnotationWindow m_AnnotationWindow;

AnnAutomation = m_AnnotationWindow.GetAutomationObject();

AnnAutomation.GetAutoMenuItemEnable
 ( ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, &Enable);
if (Enable == ANNMENU_ENABLED)
{
AfxMessageBox(TEXT("Menu item is enabled.
 It will now be disabled."));
AnnAutomation.SetAutoMenuItemEnable(
 ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
}
else if (Enable == ANNMENU_DISABLED)
{
AfxMessageBox(TEXT("Menu item is disabled.
 It will be enabled."));
AnnAutomation.SetAutoMenuItemEnable(
 ANNOBJECT_ALL, ANNAUTOTEXT_MENU_CUT, ANNMENU_ENABLED, 0, NULL);
}
else
{
AfxMessageBox(TEXT("Menu item is using its
 default behavior. It will be disabled."));
AnnAutomation.SetAutoMenuItemEnable(ANNOBJECT_ALL,
 ANNAUTOTEXT_MENU_CUT, ANNMENU_DISABLED, 0, NULL);
}
}


LAnnotation::SetAutoMenuState

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetAutoMenuState(nObjectType, pEnable, pEnableFlags, uBits, uFlags)

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
nObjectType | Constant that specifies an object's type. If the object calling this function 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

See Also

Functions: | LAnnotation::GetAutoMenuState, LAnnotation::GetAutoMenuItemEnable, LAnnotation::SetAutoMenuItemEnable, LAnnAutomation::SetAutoText, LAnnAutomation::GetAutoText, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd)
 prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonSetAutoMenuState()
{
L_UCHAR pEnableFlags[2];
L_UCHAR pEnable[2];
L_UCHAR resultFlag;
L_UINT uBits = 16;
L_UCHAR result;
L_TCHAR cs[256];
LAnnAutomation *phAutoObject;

   LAnnotationWindow m_AnnotationWindow;

phAutoObject = &m_AnnotationWindow.GetAutomationObject();

//Get the menu state for Note objects
phAutoObject->GetAutoMenuState(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
{
AfxMessageBox(TEXT("pEnableFlags
 is set"));
// 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.
{
AfxMessageBox(TEXT("The
 menu item was enabled. It will be disabled."));
pEnable[0] = 0x00;
phAutoObject->SetAutoMenuState(ANNOBJECT_NOTE, pEnable,
 pEnableFlags, uBits, 0);
}
else // The enable flag was not set,
 the menu item is disabled.
{
AfxMessageBox(TEXT("The
 menu item was disabled. It will be enabled."));
pEnable[0] = 0x40;
phAutoObject->SetAutoMenuState(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]);
AfxMessageBox(cs);
phAutoObject->SetAutoMenuState(ANNOBJECT_NOTE,
 pEnable, pEnableFlags, uBits, 0);
}
}


LAnnotation::SetAutoSnapCursor

#include "ltwrappr.h"

L_INT LAnnotation::SetAutoSnapCursor(bSnap)

L_BOOL bSnap;

/* value that indicates whether to restrict cursor location */

Sets the behavior of the cursor location when creating annotations using automation in design mode. This function is available in the Document/Medical Toolkits.

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

See Also

Functions:

LAnnotation::GetAutoSnapCursor, LAnnAutomation::GetAutoCursor, LAnnotation::SetUserData, LAnnotation::GetUserData, LAnnAutomation::SetAutoCursor, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::GetAutoBackColor, LAnnAutomation::GetAutoContainer, LAnnAutomation::GetAutoDialogFontSize, LAnnAutomation::IsAutoDrawEnabled, LAnnAutomation::IsAutoMenuEnabled, LAnnotation::GetAutoMenuItemEnable, LAnnotation::GetAutoMenuState, LAnnAutomation::GetAutoOptions, LAnnAutomation::GetAutoText, LAnnAutomation::GetAutoTextLen, LAnnAutomation::GetAutoUndoEnable, LAnnotation::SetAutoBackColor, LAnnAutomation::SetAutoContainer, LAnnotation::SetAutoDefaults, LAnnAutomation::SetAutoDialogFontSize, LAnnAutomation::SetAutoDrawEnabled, LAnnAutomation::SetAutoMenuEnabled, LAnnotation::SetAutoMenuItemEnable, LAnnotation::SetAutoMenuState, LAnnAutomation::SetAutoOptions, LAnnAutomation::SetAutoText, LAnnAutomation::SetAutoUndoEnable, LAnnotation::GetOptions, LAnnotation::SetOptions

Topics:

Displaying and Manipulating Annotation Objects

Annotation Functions: (Document/Medical only) Getting and Setting Cursor Properties

Altering Annotation Object Settings

New Annotation Features of Version 14.5

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 SetAutoSnapCursorExample(LAnnAutomation& automate)
{
L_INT nRet = FAILURE;
L_BOOL bSnap = FALSE;
L_CHAR szMsg[200];

nRet = automate.GetAutoSnapCursor(&bSnap);
if (nRet != SUCCESS)
return;

bSnap = !bSnap;
nRet = automate.SetAutoSnapCursor(bSnap);
if (nRet != SUCCESS)
return;

wsprintf(szMsg, TEXT("Automation Snap Cursor State
 changed from %s to %s"),
!bSnap ? TEXT("TRUE") : TEXT("FALSE"),
bSnap ? TEXT("TRUE") : TEXT("FALSE"));

MessageBox(NULL, szMsg, TEXT("Notice"), MB_OK);
}


LAnnotation::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color to set */
L_UINT uFlags; | /* reserved for future versions */

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

Use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color value.

To see how the background color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

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: | LAnnotation::SetForeColor, LAnnotation::GetBackColor, LAnnotation::GetForeColor, Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* reserved for future versions */

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 | Reserved for future versions, use 0.

Returns

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

Comments

Note that the LAnnotation::SetROP2 function and the LAnnotation::SetFillMode 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.

See Also

Functions: | LAnnotation::GetFillMode, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFillModeExt

#include "ltwrappr.h"

L_INT LAnnotation::SetFillModeExt(uFillMode, nAlpha, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetFillMode, you can use this function to set the fill mode for annotation objects. With this function, the LAnnotation::SetFillMode function has been extended to support the new fill mode ANNMODE_ALPHA.

Before calling LAnnotation::SetFillModeExt enable alpha background filling. You can enable alpha background filling by using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation& annAutomation)
{
L_UINT nRet, uOptions = 0;
nRet = annAutomation.GetOptions(
 &uOptions);
nRet = annAutomation.SetOptions(
 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:

bmc sqrblit.bmp}a value of -1 means to leave the existing nAlpha value unchanged

bmc sqrblit.bmp}a value of 0 means the annotation object background is completely transparent

bmc sqrblit.bmp}a value of 255 means the annotation background is completely opaque.

bmc sqrblit.bmp}any value between 0 and 255 can be used to specify a varying degree of transparency.

Note that the LAnnotation::SetROP2 function and the LAnnotation::SetFillModeExt 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.

See Also

Functions: | LAnnotation::GetFillMode, LAnnotation::SetFillMode, LAnnotation::GetFillModeExt, LAnnAutomation::SetFillPattern, LAnnAutomation::GetFillPattern, LAnnAutomation::GetPolyFillMode, LAnnAutomation::SetPolyFillMode, LAnnotation::GetROP2, LAnnotation::SetROP2, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions (Document/Medical only) Displaying Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Implementing Annotations
 | Annotation Functions: Object Information
 | Annotation Functions: Object Properties
 | Displaying and Manipulating Annotation Objects
 | Illustration of Fill Options for Annotations.
 | User Interface for Container and Automation Objects
 | Container Annotation Object
 | Annotation Automation Object
 | Annotation Functions: (Document/Medical only) Getting and Setting Color Properties

Example

// This example toggles through all supported fill modes
 for an annotation object
// The background color is set to blue in each case
L_INT SetFillModeExtExample(LAnnRectangle& annrect)
{
int nRet;
L_UINT uFillMode;

nRet = annrect.GetFillModeExt(&uFillMode,
 NULL);
if (nRet != SUCCESS)
return FAILURE;

nRet = annrect.SetBackColor(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 = annrect.SetFillModeExt(uFillMode,
 128, 0);
return nRet;
}


LAnnotation::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | Make the font not bold.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic. Possible values are:
 | Value | Meaning
 | TRUE | Make the font italic.
 | FALSE | Make the font not italic.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

Libraries

win32

ltkrn14n.dll (ltkrn_n.lib import library)
ltann14n.dll (ltann_n.lib import library)

See Also

Functions: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* name of the font */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Specify the name of the font in a 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.

See Also

Functions: | LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* font size to set */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply a strike-through */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the value of the strike-through property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply a 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 property determines whether the font has a line through the middle of the text.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::SetFontUnderline, LAnnotation::IsFontUnderline, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply an underline */
L_UINT uFlags; | /* flag that indicates which objects to process */

Sets the font-underline property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply an underline. Possible values are:
 | Value | Meaning
 | TRUE | Apply an underline.
 | FALSE | Remove the underline.
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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: | LAnnotation::SetFontName, LAnnotation::GetFontName, LAnnotation::GetFontNameLen, LAnnotation::SetFontSize, LAnnotation::GetFontSize, LAnnotation::IsFontUnderline, LAnnotation::SetFontStrikeThrough, LAnnotation::IsFontStrikeThrough, LAnnotation::SetFontItalic, LAnnotation::IsFontItalic, LAnnotation::SetFontBold, LAnnotation::IsFontBold, Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* reserved for future versions */

Sets the foreground color of the annotation object. The default foreground color is red. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Reserved for future versions, use 0.

Returns

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

Comments

Use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color value.

To see how the foreground color relates to the fill modes, refer to Illustration of Fill Options for Annotations.

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: | LAnnotation::GetForeColor, LAnnotation::SetBackColor, LAnnotation::GetBackColor, Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnotation::SetNameOptions.


LAnnotation::SetHandle

#include "ltwrappr.h"

L_INT LAnnotation::SetHandle(hAnnObject)

HANNOBJECT hAnnObject;

/* hndle to the container */

Sets the handle of the class object’s associated annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hAnnObject | Handle to the container.

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.

See Also

Functions:

Class Members

Example

L_VOID TestFunction (HANNOBJECT hAnnObject)
{
LAnnotation MyAnn ;
MyAnn.SetHandle(hAnnObject) ;

//...
}


LAnnotation::SetHyperlink

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetHyperlink(uType, uMsg, wParam, pLink, uFlags=0)

L_UINT uType; | /* the object's hyperlink type */
L_UINT uMsg; | /* a user defined message */
WPARAM wParam; | /* wParam value that is passed to the user defined message */
L_TCHAR L_FAR * pLink; | /* the name of the program to run or the web page to access */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the hyperlink type and parameters of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uType | Flag that indicates 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions (Document/Medical only): Hyperlinks

Example

For an example, refer to LAnnotation::GetHyperlink.


LAnnotation::SetNameOptions

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetNameOptions(pNameOptions, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

See Also

Functions: | LAnnotation::GetNameOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Color Values in LEADTOOLS

Example

//This example creates a sticky note annotation and sets properties
//using LAnnotation member functions.
void CVCAnnotation11Dlg::OnButtonStickyNote()
{
LBitmap MyBitmap;
RECT rect;
ANNRECT annRect;
ANNNAMEOPTIONS NameOptions;
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
memset(&NameOptions, 0, sizeof(ANNNAMEOPTIONS));
NameOptions.uStructSize = sizeof(ANNNAMEOPTIONS);
NameOptions.uFlags = ANNNAME_NAME_LENGTH;
LAnnNote MyAnnNote;
MyAnnNote.SetText( TEXT("Terry"));
annRect.left = 50;
annRect.top = 50;
annRect.right = 150;
annRect.bottom = 150;
MyAnnNote.SetRect(&annRect);
//Set properties
L_BOOL bRet;
L_TCHAR FontName[200];
COLORREF rgb;
double dRet;
bRet = MyAnnNote.SetBackColor(RGB(0,100,0));
bRet = MyAnnNote.SetForeColor (RGB(255,100,0));
bRet = MyAnnNote.SetFontBold ();
bRet = MyAnnNote. SetFontItalic ();
bRet = MyAnnNote.SetFontName (TEXT("Courier"));
bRet = MyAnnNote.SetFontSize (24);
bRet = MyAnnNote.SetFontStrikeThrough ();
bRet = MyAnnNote.SetFontUnderline ();
bRet = MyAnnNote.IsFontBold ();
bRet = MyAnnNote.IsFontItalic ();
bRet = MyAnnNote.GetFontName ((L_TCHAR*)&FontName);
bRet = MyAnnNote.GetFontNameLen ();
bRet = MyAnnNote.GetFontSize ();
bRet = MyAnnNote.IsFontStrikeThrough ();
bRet = MyAnnNote.IsFontUnderline ();
rgb = MyAnnNote.GetForeColor ();
rgb = MyAnnNote.GetBackColor ();
L_UINT uFillMode = MyAnnNote.GetFillMode ();
switch (uFillMode)
{
case ANNMODE_TRANSPARENT:
AfxMessageBox(TEXT("FillMode: ANNMODE_TRANSPARENT"));
break;
case ANNMODE_TRANSLUCENT:
AfxMessageBox(TEXT("FillMode: ANNMODE_TRANSLUCENT"));
break;
case ANNMODE_OPAQUE:
AfxMessageBox(TEXT("FillMode: ANNMODE_OPAQUE"));
break;
}
//Set Fill mode to opaque
MyAnnNote.SetFillMode (ANNMODE_OPAQUE);
MyAnnNote.SetVisible (TRUE);
MyAnnNote.GetNameOptions(&NameOptions, sizeof(NameOptions));
NameOptions.pszName = (L_TCHAR *)malloc(lstrlen(TEXT("My Note Annotation")));
lstrcpy(NameOptions.pszName, TEXT("My Note Annotation"));
NameOptions.uNameLen = lstrlen(TEXT("My Note Annotation"));
NameOptions.uFlags = ANNNAME_NAME;
MyAnnNote.SetNameOptions(&NameOptions, 0);
MyAnnNote.GetBoundingRect (&rect) ;
//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnNote.Draw (hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnotation::SetOffsetX

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetOffsetX(dOffsetX, uFlags=0)

L_DOUBLE dOffsetX; | /* the new X offset */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the X offset of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 ( | ). 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the LAnnotation::SetScalarX and LAnnotation::SetScalarY functions. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnotation::GetOffsetX.


LAnnotation::SetOffsetY

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetOffsetY(dOffsetY, uFlags=0)

L_DOUBLE dOffsetY; | /* the new Y offset */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the Y offset of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 ( | ). 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Typically, this value is used to match the root container's offset to the offset of the associated bitmap's display rectangle.

The offset values are applied after the scalar properties, which are set by the LAnnotation::SetScalarX and LAnnotation::SetScalarY functions. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnotation::GetOffsetX.


LAnnotation::SetOptions

#include "ltwrappr.h"

L_INT LAnnotation::SetOptions(uOptions)

L_UINT uOptions;

/* annotation options to be set */

Sets user interface and other annotation options introduced in version 14.5. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 multi-select 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 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 LAnnotation::SetOptions with the desired flags. To get the current Version 14.5 options, call the LAnnotation::GetOptions function. For more information, 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.

See Also

Functions: | LAnnotation::GetOptions, ANNBUTTON, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnAutomation::SetAutoCursor, LAnnAutomation::GetAutoCursor, LAnnContainer::Save, LAnnContainer::SaveOffset, LAnnContainer::SaveMemory, LAnnContainer::LoadOffset, LAnnContainer::LoadMemory, LAnnotation::SetTextOptions, LAnnotation::GetTextOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows, LAnnotation::GetRotateOptions, LAnnotation::SetRotateOptions, LAnnotation::CalibrateRuler
Topics: | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects
 | Annotation Functions (Document/Medical only) Displaying Annotations

Example

// The following example demonstrates how to enable and 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.
void SetOptionsExample(LAnnRectangle& annrect)
{
L_TCHAR *pszMsg = NULL;
L_INT nRet = SUCCESS;
L_UINT uOptions = 0;

nRet = annrect.GetOptions(&uOptions);
if (nRet != SUCCESS)
return ;

if (uOptions & OPTIONS_NEW_SIDE_HANDLES)
{
uOptions &= ~OPTIONS_NEW_SIDE_HANDLES;
pszMsg = TEXT("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 = TEXT("Draw a rectangular
 object and select it. Note the side handles. Run this example again to
 disable the side handles.");
}

nRet = annrect.SetOptions(uOptions);
if (nRet != SUCCESS)
return ;

MessageBox( NULL, pszMsg, TEXT("Notice"), MB_OK);
}


LAnnotation::SetPredefinedMetafile

#include "ltwrappr.h"

static L_INT LAnnotation::SetPredefinedMetafile(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 objects, the hotspot objects and the freehand hotspot objects created by the automation object. For example, if you replace the ANNMETAFILE_APPROVED default metafile with another metafile, then objects created by the automation mode when the ANNTOOL_STAMP_APPROVED tool is set will look like the new metafile.

A predefined metafile can be reset to its original metafile by passing NULL for hMetafile. For example, to reset the Hotspot and freehand hotspot predefined metafiles to the original value, do the following:

LAnnotation::SetPredefinedMetafile(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.

See Also

Functions: | LAnnotation::GetPredefinedMetafile, LAnnFreehandHotSpot::GetMetafile, LAnnFreehandHotSpot::SetMetafile, LAnnHotSpot::GetMetafile, LAnnHotSpot::SetMetafile, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Annotation Bitmap Objects

Example

L_VOID TestFunction(L_TCHAR * pszMetaFile)
{
HENHMETAFILE hClassified;

hClassified = GetEnhMetaFile(pszMetaFile);

if (hClassified != NULL)
// Set the ANNMETAFILE_OFFICIAL metafile
 to the new metafile
LAnnotation::SetPredefinedMetafile(ANNMETAFILE_OFFICIAL,
(HMETAFILE) hClassified);
else
{
MessageBox(NULL, TEXT("No metafile
 handle!"), TEXT("Testing"), MB_OK);
DeleteEnhMetaFile(hClassified);
}
}


LAnnotation::SetRect

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetRect(pRect)

pANNRECT pRect;

/* pointer to a LEADTOOLS ANNRECT structure */

Sets the defining rectangle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnPolygon::SetPoints or LAnnPolygon::Define 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestAnnRect(LAnnotation& LeadAnn)
{
ANNRECT AnnRect ;
LeadAnn.BringToFront();
LeadAnn.GetRect(&AnnRect) ;

LeadAnn.Move((AnnRect.right - AnnRect.left) / 20,
(AnnRect.bottom - AnnRect.top) / 20, 0);

//...
//...

AnnRect.left += 20 ;
AnnRect.top += 20 ;
AnnRect.right += 20 ;
AnnRect.bottom += 20 ;

LeadAnn.SetRect(&AnnRect) ;
LeadAnn.SendToBack() ;
}


LAnnotation::SetRestrictToContainer

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetRestrictToContainer(bRestrict, uFlags)

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
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. 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

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.

See Also

Functions: | Class Members, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Displaying and Manipulating Annotation Objects

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(LAnnotation * pLObject)
{
L_BOOL bRestrict;
L_INT nRet;
L_TCHAR *pszMsg;

nRet = pLObject->GetRestrictToContainer(&bRestrict);
if (nRet == SUCCESS)
{
bRestrict = !bRestrict;
pLObject->SetRestrictToContainer(bRestrict,
 0);
pszMsg = bRestrict ? TEXT("Restricted
 to container") : TEXT("Not restricted to container");
MessageBox(NULL, pszMsg, TEXT(""),
 MB_OK);
}
}


LAnnotation::SetROP2

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetROP2(uROP2=ANNROP2_COPY, uFlags=0)

L_UINT uROP2; | /* the ROP code for display */
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
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.
 | Default 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

LAnnotation::SetROP2 can 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 (LAnnRectangle::SetForeColor and LAnnRectangle::SetBackColor), and call this function with uROP2 set to ANNROP2_AND.

LAnnotation::SetROP2 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 (ANNOBJECT_AUTOMATION) stores default ROP2 settings along with the other object default settings.

Note that the LAnnotation::SetROP2 function and the following functions affect each other:

LAnnText::SetFillMode .
LAnnStamp::SetFillMode .
LAnnPolygon::SetFillMode .
LAnnRectangle::SetFillMode .
LAnnEllipse::SetFillMode
LAnnotation::SetFillModeExt

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.

This function applies to multiple and selected objects based on values of the uFlags parameter.

Use the LAnnotation::GetROP2 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 using the LAnnAutomation::SetAutoHilightPen 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.

See Also

Functions: | Class Members, LAnnAutomation::SetAutoHilightPen, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Annotation Functions (Document/Medical only) Displaying Annotations
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::GetROP2.


LAnnotation::SetRotateOptions

#include "ltwrappr.h"

L_INT LAnnotation::SetRotateOptions(pRotateOptions, uFlags)

pANNROTATEOPTIONS pRotateOptions; | /* pointer to a 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
pRotateOptions | Pointer to an ANNROTATEOPTIONS structure that specifies the rotate options to be 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

This function is one of the new functions being introduced as part of Version 14.5. 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.

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:

For Version 14.5, this functionality can be enabled using the following code snippet:

L_VOID ExampleEnableOption(LAnnAutomation& annAutomation)
{
L_UINT nRet, uOptions = 0;
nRet = annAutomation.GetOptions( &uOptions);
nRet = annAutomation.SetOptions( uOptions
 | OPTIONS_NEW_ROTATE);
}

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: | LAnnotation::GetRotateOptions, LAnnotation::SetOptions, LAnnContainer::HitTestExt, LAnnotation::IsSelected, LAnnotation::SetSelected, LAnnAutomation::SetAutoCursor
Topics: | Annotation Functions: (Document/Medical only) Getting and Setting the Rotation Properties
 | Altering Annotation Object Settings
 | New Annotation Features of Version 14.5
 | Flipping, Reversing and Rotating Annotation Objects

Example

For an example, refer to LAnnotation::GetRotateOptions.


LAnnotation::SetScalarX

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetScalarX(dScalarX, uFlags=0)

L_DOUBLE dScalarX; | /* horizontal scaling factor */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the horizontal scaling factor that is applied to the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 ( | ). 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the LAnnotation::SetOffsetX and LAnnotation::SetOffsetY functions, are applied after the scalar properties. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::GetScalarX.


LAnnotation::SetScalarY

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetScalarY(dScalarY, uFlags=0)

L_DOUBLE dScalarY; | /* vertical scaling factor */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the vertical scaling factor that is applied to the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 ( | ). 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Typically, the scaling factors are applied to a root container so that the annotations will match the displayed image.

Offset values, which are set by the LAnnotation::SetOffsetX and LAnnotation::SetOffsetY functions, are applied after the scalar properties. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Low-Level Coordinate System for Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Displaying and Manipulating Annotation Objects

Example

For an example,refer to LAnnotation::GetScalarX.


LAnnotation::SetSelected

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetSelected(bSelected=TRUE, uFlags=0)

L_BOOL bSelected; | /* flag that indicates whether to select or deselect an object */
L_UINT uFlags; | /* flags that determine which objects to process */

Selects or deselects the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bSelected | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

See Also

Functions: | Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnotation::GetRotateOptions, LAnnotation::SetRotateOptions
Topics: | Annotation Functions: Using Window Coordinates to Select Objects
 | Annotation Functions: Object Information
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::GetTag.


LAnnotation::SetTag

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetTag(uTag, uFlags=0)

L_UINT32 uTag; | /* the object's tag */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the tag of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

You can use this tag to identify objects when they are saved in a file.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnotation::GetTag.


LAnnotation::SetTextOptions

#include "ltwrappr.h"

L_INT LAnnotation::SetTextOptions(pTextOptions, uFlags)

pANNTEXTOPTIONS pTextOptions; | /*pointer to a structure that specifies 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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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. If the annotation objects are container, automation, text, text pointer, stamp, note, pushpin, or button objects it is possible to use the LAnnotation::GetTextOptions and the LAnnotation::SetTextOptions 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 LAnnotation::SetOptions function. 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 class object must be one of the following types:

LAnnContainer

LAnnAutomation

LAnnText

LAnnTextPointer

LAnnStamp

LAnnNote

LAnnPushPin

LAnnButton

Otherwise ERROR_FEATURE_NOT_SUPPORTED is returned.

Note:

In Version 14.5, you need to first enable this function by calling the LAnnotation::SetOptions function with the OPTIONS_NEW_TEXT_OPTIONS flag set.

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: | LAnnotation::GetTextOptions, LAnnAutomation::SetText, LAnnAutomation::GetText, LAnnAutomation::GetTextLen, LAnnAutomation::SetTextAlign, LAnnAutomation::GetTextAlign, LAnnAutomation::SetTextRotate, LAnnAutomation::GetTextRotate, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | New Annotation Features of Version 14.5
 | Annotation Functions: Object Properties
 | Annotation Functions (Document/Medical only): Getting and Setting Text Properties
 | User Interface for Container and Automation Objects
 | Displaying and Manipulating Annotation Objects
 | Annotation Functions: 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 SetTextOptionsExample(LAnnAutomation& automate)
{
L_INT nRet = FAILURE;
ANNTEXTOPTIONS TextOptions;
L_UINT uOptions = 0;
L_TCHAR szMsg[200];

nRet = automate.GetOptions(&uOptions);
uOptions |= OPTIONS_NEW_TEXT_OPTIONS;
nRet = automate.SetOptions(uOptions);
if (nRet != SUCCESS)
return;

memset(&TextOptions, 0, sizeof(TextOptions));
TextOptions.uStructSize = sizeof(TextOptions);
TextOptions.uFlags = ANNTEXT_SHOW_TEXT | ANNTEXT_SHOW_BORDER
 | ANNTEXT_TEXTCOLOR;
nRet = automate.GetTextOptions(&TextOptions,
 sizeof(TextOptions));
if (nRet != SUCCESS)
return;

wsprintf(szMsg, TEXT("Old Options: ShowText[%d],
 ShowBorder[%d], TextColor[0x%x]"),
TextOptions.bShowText,
TextOptions.bShowBorder,
TextOptions.crText);

MessageBox(NULL, szMsg, TEXT(""), MB_OK);

// Change some options
TextOptions.bShowBorder = !TextOptions.bShowBorder;
TextOptions.crText = RGB(0,0,255);
TextOptions.uFlags = ANNTEXT_SHOW_BORDER | ANNTEXT_TEXTCOLOR;
nRet = automate.SetTextOptions(&TextOptions,
 0);
if (nRet != SUCCESS)
return;

memset(&TextOptions, 0, sizeof(TextOptions));
TextOptions.uStructSize = sizeof(TextOptions);
TextOptions.uFlags = ANNTEXT_SHOW_TEXT | ANNTEXT_SHOW_BORDER
 | ANNTEXT_TEXTCOLOR;
nRet = automate.GetTextOptions(&TextOptions, sizeof(TextOptions));
if (nRet != SUCCESS)
return;

wsprintf(szMsg, TEXT("New Options: ShowText[%d],
 ShowBorder[%d], TextColor[0x%x]"),
TextOptions.bShowText,
TextOptions.bShowBorder,
TextOptions.crText);

MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


LAnnotation::SetUser

#include "ltwrappr.h"

L_INT EXT_FUNCTION LAnnotation::SetUser(pOldUser, pNewUser, uFlags)

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
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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.

See Also

Functions: | LAnnotation::Unlock, LAnnotation::ShowLockedIcon,
Topics: | Annotation Functions: Security
 | Annotation Objects - Automated Features

Example

//Beginning of CVAnnotationToolvar11dlg::OnButtonAnnSeruser()
//This examples shows how to enumerate annotations in an LAnnotationWindow object
//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd) prior to the example
class LUserAnnContainer : public LAnnContainer
{
public:
L_INT m_nObjectCount ;
public:
LUserAnnContainer(HANNOBJECT hAnnObject);
virtual ~LUserAnnContainer() ;
virtual L_INT EnumerateCallBack(HANNOBJECT hObject);
};

LUserAnnContainer::LUserAnnContainer(HANNOBJECT hAnnObject):LAnnContainer(hAnnObject)
{
m_nObjectCount = 0 ;
}

LUserAnnContainer::~LUserAnnContainer()
{
}

L_INT LUserAnnContainer::EnumerateCallBack(HANNOBJECT hObject)
{
m_nObjectCount++ ;
L_TCHAR szTemp[100];

wsprintf(szTemp, TEXT("[%d]Annotation object"), m_nObjectCount);
AfxMessageBox(szTemp);
return SUCCESS ;
}

void CVCAnnotationToolbar11Dlg::OnButtonAnnSetuser()
{
LAnnContainer AnnContainer;

LAnnotationWindow m_AnnotationWindow;
AnnContainer = m_AnnotationWindow.GetContainerObject();
AnnContainer.SetUser(NULL, TEXT("Terry"),ANNFLAG_RECURSE);

//Enumerating objects return nothing--did not pass a valid user
AfxMessageBox(TEXT("Passing Invalid User to Enumerate"));
LUserAnnContainer UserAnnContainer(AnnContainer.GetHandle());
UserAnnContainer.m_nObjectCount=0;
UserAnnContainer.Enumerate(ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER|ANNFLAG_USER);

//Enumerating objects this time returns all the objects--valid user
AfxMessageBox(TEXT("Passing Valid User to Enumerate"));
UserAnnContainer.m_nObjectCount=0;
UserAnnContainer.Enumerate(ANNFLAG_RECURSE|ANNFLAG_NOTCONTAINER|ANNFLAG_USER, TEXT("Terry"));
}
//End of CVAnnotationToolvar11dlg::OnButtonAnnSeruser()


LAnnotation::SetUserData

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetUserData(pUserData, uUserDataSize, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 (LAnnContainer::Save, LAnnContainer::SaveMemory, LAnnContainer::SaveOffset), 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.

See Also

Functions: | LAnnAutomation::SetAutoCursor, LAnnAutomation::GetAutoCursor, Class Members, LAnnotation::SetAutoSnapCursor, LAnnotation::GetAutoSnapCursor
Topics: | Automated User Interface for Annotations
 | Implementing Annotations

Example

For an example, refer to LAnnotation::GetUserData.


LAnnotation::SetVisible

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetVisible(bVisible=TRUE, uFlags=0, pUserList=NULL)

L_BOOL bVisible; | /* flag that indicates whether to make the object or objects visible or invisible */
L_UINT uFlags; | /* flags that determine which objects to process */
L_TCHAR L_FAR *pUserList; | /* character string that contains the user list */

Sets the annotation object to be visible or invisible. This function is available in the Document/Medical Toolkits.

Parameter | Description
bVisible | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

When an object is not visible, it cannot be displayed and functions such as LAnnContainer::HitTest 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnotation::CutToClipboard.


LAnnotation::ShowLockedIcon

#include "ltwrappr.h"

virtual L_INT LAnnotation::ShowLockedIcon(bShow=TRUE, uFlags=0)

L_BOOL bShow; | /* flag that indicates whether to show the padlock icon */
L_UINT uFlags; | /* flags that determine which objects to process */

Enables or disables the displaying of the padlock icon on top the annotation object when it is locked. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 LAnnotation::ShowLockedIcon has been called with bShow set to TRUE.

Note that this information will not be saved when calling LAnnContainer::Save so you should call LAnnotation::ShowLockedIcon with the desired value after calling any of the annotation loading functions, LAnnContainer::Load, LAnnContainer::LoadMemory, LAnnContainer::LoadOffset.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Security

Example

For an example, refer to LAnnotation::Lock.


LAnnotation::TextEdit

#include "ltwrappr.h"

L_INT LAnnotation::TextEdit(L_VOID)

Causes a text-based annotation to enter edit mode. This function is available in the Document/Medical Toolkits.

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 annotation classes including:

LAnnText

LAnnTextPointer

LAnnNote

LAnnPushPin

LAnnRTF

A successful call to LAnnXXX::SetText affects the class object in the following way:

If the class object is not selected, the class object becomes selected, and all other objects become unselected.

If the class object is already selected, then the selection state of all objects is unchanged.

If the class object 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, calling LAnnotation::TextEdit(), will get the other class object out of the text edit mode, and put the class object into the text edit mode.

This function will fail with ERROR_AUTOMATION_INV_HANDLE if the class object is not contained in the root container and if it is not in the automated mode.

This function works only with the following objects:

LAnnText

LAnnTextPointer

LAnnNote

LAnnPushPin

LAnnRTF

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.

See Also

Functions: | LAnnAutomation::GetAutoText, LAnnAutomation::GetAutoTextLen, LAnnAutomation::SetAutoText
Topics: | Annotation Functions (Document/Medical only): Getting and Setting Text Properties

Example

void TexteditExample(LAnnText anntext)
{
// This example programmatically makes an annotation
 text object
// hObject go into edit mode
// Note that hObject must be a text based annotation
L_INT nRet = SUCCESS;
L_UINT uType = 0;
L_CHAR *pszError = NULL;

nRet = anntext.TextEdit();
switch(nRet)
{
case SUCCESS:
pszError = "SUCCESS";
break;
case ERROR_AUTOMATION_INV_HANDLE:
pszError = "TextEdit
 failed because you are not in automated mode";
break;
case ERROR_INV_PARAMETER:
pszError = "AnnTextEdit
 failed because hObject was not text based";
break;
default:
pszError = "AnnTextEdit
 failed";
break;
}

if (pszError)
MessageBox(NULL, pszError, "Error", MB_OK);
}


LAnnotation::Ungroup

#include "ltwrappr.h"

virtual L_INT LAnnotation::Ungroup(uFlags, pUserList=NULL)

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
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 LAnnotation::Ungroup(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.

See Also

Functions: | LAnnotation::Group
Topics: | Displaying and Manipulating Annotation Objects

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized (using CreateWnd) prior to the example
//
void CVCAnnotationToolbar11Dlg::OnButtonAnnUngroup()
{
LAnnContainer *pAnnContainer;

LAnnotationWindow m_AnnotationWindow;

pAnnContainer = &(m_AnnotationWindow.GetContainerObject());
pAnnContainer->Ungroup(ANNFLAG_RECURSE | ANNFLAG_USER , TEXT("Terry"));
}


LAnnotation::Unlock

#include "ltwrappr.h"

virtual L_INT LAnnotation::Unlock(pUnlockKey, uFlags=0)

L_TCHAR L_FAR * pUnlockKey; | /* character string containing the key */
L_UINT uFlags; | /* flags that determine which objects to process */

Unlocks the annotation object with the specified key. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

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 LAnnRedact::Unrealize.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions (Document/Medical ): Security
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnotation& LeadAnn)
{
if (LeadAnn.IsLocked() == TRUE)
// lock all selected items in the container
LeadAnn.Unlock(TEXT("MyKey"), ANNFLAG_RECURSE | ANNFLAG_SELECTED);
}


LAnnotationWindow::LAnnotationWindow

#include "ltwrappr.h"

L_VOID LAnnotationWindow::LAnnotationWindow(L_VOID)

L_VOID LAnnotationWindow::LAnnotationWindow(hWndParent, nID=0, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0, nCx=200, nCy=200)

HWND hWndParent; | /* handle to the parent window */
L_INT nID; | /* the control's id */
DWORD dwStyle; | /* the control's style */
L_INT x; | /* x position for the bitmap window */
L_INT y; | /* y position for the bitmap window */
L_INT nCx; | /* width of the annotation window */
L_INT nCy; | /* height of the annotation window */

Constructs and initializes the member variables of the LAnnotationWindow object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWndParent | Handle to the parent window.
nID | The control's id.
dwStyle | The control's style. Apply any combination of window styles and LEAD window styles. For more information on Windows styles, refer to your compiler’s help file. For more information on LEAD window styles, refer to Bitmap Window LEAD specific styles.
x | X coordinate of the origin of the annotation window.
y | Y coordinate of the origin of the annotation window.
nCx | The width of the annotation window.
nCy | The height of the annotation window.

Returns

None

Comments

LAnnotationWindow::LAnnotationWindow(L_VOID) is the default constructor for this class.

LAnnotationWindow::LAnnotationWindow(hWndParent, nID, dwStyle, x, y, nCx, nCy) creates the window for the class object using the specified parameters and initializes the annotation automation engine.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LAnnotationWindow::~LAnnotationWindow, Class Members

Example

This is an example for LAnnotationWindow::LAnnotationWindow():

L_VOID MyFunc()
{
// this will call the default constructor and destructor when it is out of scope
LAnnotationWindow LeadBitmapAnnWindow;

//…
}

This is an example for LAnnotationWindow::LAnnotationWindow(hWndParent, nID, dwStyle, x, y, nCx, nCy)

L_VOID MyFunc(HWND hParentWnd)
{
// this will call the constructor and will initialize the bitmap window with the specified parameters.

LAnnotationWindow MyLAnnotationWindow(hParentWnd, 15);

//…
//…
}


LAnnotationWindow::~LAnnotationWindow

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::~LAnnotationWindow(L_VOID)

Destroys the object and frees all resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnotationWindow class.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LAnnotationWindow LeadBitmapAnnWindow;

//…
}


LAnnotationWindow::AnnLoad

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::AnnLoad(pszFile, pLoadFileOption=NULL)

L_TCHAR L_FAR * pszFile; | /* the file name*/
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Loads the specified annotation file. This function is available in the Document/Medical Toolkits.

Parameter | Description
pszFile | Character string containing the name of the file to load.
pLoadFileOption | 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

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

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID MyFunction(HWND hParentWnd)
{
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
/*the function was successful */
if(MyLAnnotationWindow.AnnLoad(TEXT("MyAnn.Ann"))==SUCCESS)
MessageBox(0,TEXT("Loading Annotations Successful"), TEXT("Loading Annotations Successful"),MB_OK);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::AnnPrint

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::AnnPrint(hDC, x=0, y=0, width=0, height=0)

HDC hDC; | /* handle of the printer device context */
L_INT x; | /* the starting x position */
L_INT y; | /* the starting y position */
L_UINT width; | /* the printed width */
L_UINT height; | /* the printed height */

Prints the annotations to the specified device context. This function is available in the Document/Medical Toolkits.

Parameter | Description
hDC | Handle of the printer device context. The mapping mode of the device context must be MM_TEXT.
x | The starting x position.
y | The starting y position.
width | The printed width.
height | The printed height.

Returns

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

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID TestFunction(HWND hParentWnd, HDC hPrinterDC)
{
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
/*the function was successful */
/* do other processing……….*/
MyLAnnotationWindow.AnnPrint(hPrinterDC,0,0,300,300);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::AnnSave

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::AnnSave(pszFile, nFormat=ANNFMT_NATIVE, bSelected=FALSE)

L_TCHAR L_FAR * pszFile; | /* the name of the file to save */
L_INT nFormat; | /* format for saving annotation data */
L_BOOL bSelected; | /* flag that indicates which objects to save */

Saves annotations in the specified file. This function is available in the Document/Medical Toolkits.

Parameter | Description
pszFile | Character string containing the name of the file to save.
nFormat | Format for saving 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 | Use the LEAD binary format. This file size is smaller and is upward compatible. It also provides better security.
 | ANNFMT_XML | Use the XML format.
bSelected | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected functions.
 | FALSE | Save only the specified object.

Returns

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

Comments

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 bSelected parameter as follows:

To save only selected objects in the container, set bSelected to TRUE.

To save all objects in the container, set bSelected to FALSE.

For information on saving annotations as a tag in a TIFF file, refer to LAnnContainer::SaveTag.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LAnnContainer::SaveTag, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID MyFunction(HWND hParentWnd)
{
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
/*the function was successful */
/*do other processing*/
if(MyLAnnotationWindow.AnnSave(TEXT("MyAnn.Ann"))==SUCCESS)
MessageBox(0, TEXT("Saving Annotations Successful"), TEXT("Saving Annotations Successful"),MB_OK);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::CopyFromClipboard

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::CopyFromClipboard(hWnd)

HWND hWnd;

/* handle to the active window. */

Copies image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB, DDB, or a WMF. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the active window.

Returns

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

Comments

If the clipboard has any valid LEADTOOLS ANNFMT_NATIVE, ANNFMT_ENCODED, or ANNFMT_XML annotation objects, then they will also be pasted to the annotation window.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnotationWindow& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsClipboardReady())
MyBitmap.CopyFromClipboard(hWnd);
}


LAnnotationWindow::CopyToClipboard

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::CopyToClipboard(hWnd, uFlags=COPY2CB_ANNOBJECTS|COPY2CB_EMPTY|COPY2CB_DIB|COPY2CB_DDB|COPY2CB_PALETTE)

HWND hWnd; | /* handle to the active window that owns the clipboard */
L_UINT uFlags; | /* flag that indicates how image data is placed on the clipboard */

Copies the class object's bitmap to the clipboard. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the active window that owns the clipboard.
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_ANNOBJECTS | [0x4000] Copy annotation objects to the clipboard.

Returns

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

Comments

If COPY2CB_ANNOBJECTS is included in uFlags, any annotation objects present are also copied to the clipboard in the LEADTOOLS ANNFMT_NATIVE, ANNFMT_ENCODED, or ANNFMT_XML format.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(LAnnotationWindow& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsAllocated())
MyBitmap.CopyToClipboard(hWnd);
}


LAnnotationWindow::CreateWnd

#include "ltwrappr.h"

HWND LAnnotationWindow::CreateWnd(hWndParent, nID=0, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0, nCx=200, nCy=200)

HWND hWndParent; | /* handle to the parent window */
L_INT nID; | /* the control's id */
DWORD dwStyle; | /* the control's style */
L_INT x; | /* x position for the annotation bitmap window */
L_INT y; | /* y position for the annotation bitmap window */
L_INT nCx; | /* width of the annotation bitmap window */
L_INT nCy; | /* height of the annotation bitmap window */

Creates the annotation bitmap window control using the specified parameters. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWndParent | Handle to the parent window.
nID | The control's id.
dwStyle | The control's style. Apply any combination of window styles and LEAD window styles. For more information on Windows styles, refer to your compiler’s help file. For more information on LEAD window styles, refer to Bitmap Window LEAD specific styles.
x | X coordinate of the origin of the annotation bitmap window.
y | Y coordinate of the origin of the annotation bitmap window.
nCx | The width of the annotation bitmap window.
nCy | The height of the annotation bitmap window.

Returns

The window handle of the created window if the function was successful, otherwise NULL.

Comments

This function causes the class object to create the control window using the specified parameters.

It will also initialize the annotation automation engine..

This will fill in the m_hWnd data member with the handle to the new window.

If you call this function for a class object that already has a created window, the function will simply return m_hWnd.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID MyFunction(HWND hParentWnd)
{
// this will call the constructor and will initialize the bitmap window with the specified parameters.

LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd,15,WS_VISIBLE,0,0,300,400);

if(hWnd!=NULL)
{
/*the function was successful */
}
else
{
/* there is an error */
}
}


LAnnotationWindow::EndChanging

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::EndChanging(nChangeType, nChangeCategory, nRetCode)

L_UINT nChangeType; | /* the type of change */
L_UINT nChangeCategory; | /* the change category */
L_INT nRetCode; | /* the function return code */

This function is called by every function that affects the bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
nChangeType | The type of change that was done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nRetCode | The function return code.

Returns

None

Comments

This function is called by every function that affects the bitmap. You can override this function to be notified when the operation has completed changing the bitmap. This function is called after the changes to the bitmap have been made. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing, such as updating the display, after the operation has completed.

If the you override this function you must do the following:

Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

For an example, refer to LAnnotationWindow::StartChanging.


LAnnotationWindow::GetAutomationObject

#include "ltwrappr.h"

LAnnAutomation& LAnnotationWindow::GetAutomationObject(L_VOID)

Gets the internal annotation automation object used by the annotation control. This function is available in the Document/Medical Toolkits.

Returns

The internal annotation automation object used by the annotation control.

Comments

This object can be used in functions defined in the LAnnAutomation class.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(HWND hParentWnd)
{
/*initialize hParentWnd with the handle of the parent window*/
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
/*the function was successful */
MyLAnnotationWindow.GetAutomationObject().SetTool(ANNTOOL_RULER);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::GetContainerObject

#include "ltwrappr.h"

LAnnContainer& LAnnotationWindow::GetContainerObject(L_VOID)

Gets the internal annotation container object used by the annotation control. This function is available in the Document/Medical Toolkits.

Returns

The internal annotation container object used by the annotation control.

Comments

This object can be used in functions defined in the LAnnContainer class.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID TestFunction(HWND hParentWnd)
{
/*initialize hParentWnd with the handle of the parent window*/
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
/*the function was successful */
/* do other processing……….*/
MyLAnnotationWindow.GetContainerObject().Save(TEXT("MyAnn.ann"), ANNFMT_NATIVE,FALSE);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::GetToolBar

#include "ltwrappr.h"

LAnnToolBar& LAnnotationWindow::GetToolBar(L_VOID)

Gets the internal annotation toolbar object used by all the annotation controls. This function is available in the Document/Medical Toolkits.

Returns

The internal annotation toolbar object used by all the annotation controls.

Comments

Call this function to get the internal annotation toolbar object used by all the annotation controls

This object can be used in functions defined in the LAnnToolBar class.

Note:

The internal annotation toolbar object is defined as a static member so all instances of the annotation control object that you create will use the same toolbar object. This object will exist as long as there are still valid annotation control objects in your application. When the last annotation control object is destroyed the internal toolbar object will be destroyed.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

L_VOID TestFunction(HWND hParentWnd)
{
LAnnotationWindow MyLAnnotationWindow;
HWND hWnd=MyLAnnotationWindow.CreateWnd(hParentWnd);

if(hWnd!=NULL)
{
POINT Point={10,10};
/*the function was successful */
if(MyLAnnotationWindow.GetToolBar().IsCreated()==FALSE)
MyLAnnotationWindow.GetToolBar().Create(hParentWnd,&Point,0,TRUE);
}
else
{
/* there is an error */
}
}


LAnnotationWindow::MsgProcCallBack

#include "ltwrappr.h"

virtual LRESULT LAnnotationWindow::MsgProcCallBack(hWnd, uMsg, wParam, lParam)

HWND hWnd; | /* handle to the bitmap window */
UINT uMsg; | /* the window message */
WPARAM wParam; | /* the first parameter of the window message */
LPARAM lParam; | /* the second parameter of the window message */

This function is called for each message the bitmap window control receives. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the bitmap window.
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

The result of processing a specific message.

Comments

Override this function to do your own processing of window events and messages. If you override this function you must call the base class implementation (LBitmapWindow::MsgProcCallBack) for default processing.

LAnnotationWindow overrides this function to handle annotation messages and to do some other processing. If you override this function then you must call the parent-class implementation of this function to allow the annotation window to do its default processing.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LAnnotationWindow::OnZoom.


LAnnotationWindow::OnAnnEvent

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::OnAnnEvent(uAnnEvent, lParam)

L_UINT uAnnEvent; | /* the annotation event */
L_UINT32 lParam; | /* other data that depends on the annotation event */

This function is called when the annotation engine sends annotation events to the annotation window control. This function is available in the Document/Medical Toolkits.

Parameter | Description
uAnnEvent | The annotation event.
lParam | Data that depends on the annotation event.

Returns

None

Comments

Override this function in order to handle annotation events. The default implementation of this function does nothing.

For more information, see WM_LTANNEVENT Message.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

class MyAnnWnd: public LAnnotationWindow
{
public:
MyAnnWnd() ;
virtual ~MyAnnWnd();

protected:
virtual L_VOID OnAnnEvent(L_UINT uAnnEvent,L_UINT32 lParam);
};

MyAnnWnd::MyAnnWnd()
{
}

MyAnnWnd::~MyAnnWnd()
{
}

L_VOID MyAnnWnd::OnAnnEvent(L_UINT uAnnEvent,L_UINT32 lParam)
{
switch(uAnnEvent)
{
case LTANNEVENT_TOOLCHECKED:
switch(lParam)
{
case ANNTOOL_SELECT:
case ANNTOOL_LINE:
case ANNTOOL_RECT:
case ANNTOOL_ELLIPSE:
case ANNTOOL_POLYLINE:
case ANNTOOL_POLYGON:
case ANNTOOL_POINTER:
case ANNTOOL_FREEHAND:
case ANNTOOL_HILITE:
case ANNTOOL_REDACT:
case ANNTOOL_TEXT:
case ANNTOOL_NOTE:
case ANNTOOL_STAMP:
case ANNTOOL_BUTTON:
case ANNTOOL_HOTSPOT:
case ANNTOOL_AUDIO:
case ANNTOOL_RULER:
if(GetAutomationObject().IsCreated())
GetAutomationObject().SetTool(lParam);
}
break;

case LTANNEVENT_AUTOENDSET:
if(GetToolBar().IsCreated())
GetToolBar().SetToolChecked(ANNTOOL_SELECT);
break;
}

LAnnotationWindow::OnAnnEvent(uAnnEvent,lParam);
}


LAnnotationWindow::OnDraw

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::OnDraw(hdc, Rect)

HDC hdc; | /* the device context */
RECT& Rect; | /* the rectangle to be updated */

This function is called whenever the class object updates its window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hdc | The device context of the bitmap window.
Rect | The bitmap window rectangle to be updated.

Returns

None

Comments

Override this function if you want to do your own drawing on the class object's window.

This function will be called following the class object's own processing of the WM_PAINT message.

The rect parameter is passed by reference, and is a required parameter.

This function is overridden by the LAnnotationWindow to allow the class object to render the annotations to the window. If you override this function then you must call the parent-class implementation of this function for default processing.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LAnnotationWindow::OnZoom.


LAnnotationWindow::OnZoom

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::OnZoom(uZoomPercent)

L_UINT uZoomPercent;

/* the zoom percent */

This function is called whenever a zoom operation is requested on the bitmap window. This function is available in the Document/Medical Toolkits.

Parameter | Description
uZoomPercent | The zoom percent. The minimum value is 1.

Returns

None

Comments

Override this function to be notified of any zooming on the displayed bitmap.

A zoom can be requested by the following:

user presses one of the keys defined for zooming

user draws a rectangle while the current tool type is set to TOOL_ZOOMRECT

user clicks the mouse in the class object's window while the current tool type is set to TOOL_ZOOM_ON_MOUSECLICK

If the zoom occurs because the user has zoomed using the TOOL_ZOOMRECT tool, the zoom percent is updated. You can call LBitmapWindow::GetZoomPercent to get the zoom percent currently used to display the image.

This function is overridden by LAnnotationWindow to allow the class object to adjust zoom settings for the annotation container of the automation engine. If you override this function then you must call the parent-class implementation of this function for default processing.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

class LUserBWnd : public LAnnotationWindow
{
public:
LUserBWnd() ;
virtual ~LUserBWnd() ;

virtual L_VOID PanWndCallBack(L_UINT uFlag,LPRECT rcPan);
virtual LRESULT MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
virtual L_VOID OnDraw(HDC hdc,RECT& Rect);
virtual L_VOID OnZoom(L_UINT uZoomPercent);
};

LUserBWnd::LUserBWnd()
{
}

LUserBWnd::~LUserBWnd()
{
}

L_VOID LUserBWnd::PanWndCallBack(L_UINT uFlag,LPRECT rcPan)
{
// user can set his code for each message
switch (uFlag)
{
case PANWIN_CREATED:
// user code
break;
case PANWIN_UPDATED:
// user code
break;
case PANWIN_DESTROYED:
// user code
break;
case PANWIN_MOVED:
// user code
break;
}

LAnnotationWindow::PanWndCallBack(uFlag,rcPan);
}

LRESULT LUserBWnd::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM
lParam)
{
switch (uMsg)
{
case WM_CLOSE:
break ;
};

return LAnnotationWindow::MsgProcCallBack(hWnd,uMsg,wParam,lParam);
}

L_VOID LUserBWnd::OnDraw(HDC hdc,RECT& Rect)
{
Rectangle( hdc,10,10, 50,50);
LAnnotationWindow::OnDraw(hdc,Rect);
}

L_VOID LUserBWnd::OnZoom(L_UINT uZoomPercent)
{
L_TCHAR szBuffer[50];
wsprintf(szBuffer,TEXT("Zoom Percent = %u\n"),uZoomPercent) ;
::MessageBox( m_hWnd, szBuffer, TEXT("Zoom Percent"), MB_OK) ;
LAnnotationWindow::OnZoom(uZoomPercent);
}

L_INT BitmapWindowSamples(HWND hWndParent)
{
HWND hWnd;
LUserBWnd UserBitmapWindow;

UserBitmapWindow.SetFileName(TEXT("image1.cmp"));
if (UserBitmapWindow.Load(0, ORDER_BGR) == SUCCESS)
{
hWnd = UserBitmapWindow.CreateWnd( hWndParent) ;
if (hWnd == NULL)
return 0 ;
}

return SUCCESS ;
}


LAnnotationWindow::PanWndCallBack

#include "ltwrappr.h"

virtual L_VOID LAnnotationWindow::PanWndCallBack(uFlag, prcPan)

L_UINT uFlag; | /* flag that indicates the reason for the notification */
LPRECT prcPan; | /* pointer to the Pan RECT */

Called to notify the main window of changes to the associated Pan Window. This function is available in the Document/Medical Toolkits.

Parameter | Description
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] Pam 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. You must convert these coordinates to match your main window's current zoom factor.

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.

LAnnotationWindow overrides this function to be notified of Pan Window notifications. This allows the class object to render the annotations to the PanWindow. If you override this function then you must call the parent-class implementation of this function after doing your own processing to allow the annotation window to do its default processing.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LAnnotationWindow::OnZoom.


LAnnotationWindow::SetWndHandle

#include "ltwrappr.h"

L_INT LAnnotationWindow::SetWndHandle(hWnd)

HWND hWnd;

/* handle of the window*/

Sets the handle of the window to be used by the bitmap window. This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle of the window to be used by the bitmap window.

Returns

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

Comments

The passed window handle will be attached to the class object. If you pass NULL then the previously attached window will be detached from the class object.

If the class object has a created window using LAnnotationWindow::CreateWnd function then this function will return an error code.

If the passed window handle is not NULL, then this function will also initialize the annotation automation engine. Otherwise the automation engine will be destroyed.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd, HWND hWnd)
{
BmpWnd.SetWndHandle(hWnd);
}


LAnnotationWindow::StartChanging

#include "ltwrappr.h"

virtual L_INT LAnnotationWindow::StartChanging(nChangeType, nChangeCategory)

L_UINT nChangeType; | /* type of change */
L_UINT nChangeCategory; | /* the change category */

This function is called by every function that affects the bitmap. This function is available in the Document/Medical Toolkits.

Parameter | Description
nChangeType | The type of change to be done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

Returns

SUCCESS | Continue the operation without interrupting it.
< 1 | An error occurred. Refer to Return Codes. This will halt the operation and stop it.

Comments

This function is called by every function that affects the bitmap. You can override this function to have control over the different operations that are done to the bitmap. This function is called before doing any changes to the bitmap. If you want to cancel the operation, you can return an error code that is less than SUCCESS. If you return SUCCESS, the operation will continue executing. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing before starting the changing operation.

If you override this function you must do one of the following:

1. | To stop an operation, return an error code (anything other than SUCCESS). In this case the operation will stop and the parent class will not have a chance to do any default processing for the operation.
2. | Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTANN
LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

class MyBitmap: public LAnnotationWindow
{
protected:
L_BOOL m_bChanged;
virtual L_INT StartChanging(L_UINT nChangeType,L_UINT nChangeCategory);
virtual L_VOID EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode);
};

L_INT MyBitmap::StartChanging(L_UINT nChangeType,L_UINT nChangeCategory)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
/*the image is to be flipped*/
break;
/*
case ….:
do other things
*/
}

return(LAnnotationWindow::StartChanging(nChangeType,nChangeCategory));
}

L_VOID MyBitmap::EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
if(nRetCode==SUCCESS)
m_bChanged=TRUE;
break;
/*
case ….:
do other things
*/
}

LAnnotationWindow::EndChanging(nChangeType,nChangeCategory,nRetCode);
}


LAnnPoint::LAnnPoint

#include "ltwrappr.h"

L_VOID LAnnPoint::LAnnPoint(bCreate=TRUE)

L_VOID LAnnPoint::LAnnPoint(hStamp)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPoint; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPoint object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hStamp | Handle of the associated annotation object.

Returns

None

Comments

LAnnPoint::LAnnPoint(bCreate) is a constructor for the LAnnPoint class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPoint::LAnnPoint(hStamp) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_POINT. The passed annotation object is invalidated.

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:

LAnnPoint::~LAnnPoint, Class Members

Example

This is an example for : LAnnPoint::LAnnPoint(bCreate)

L_VOID TestFunction48( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnPoint MyAnnotation; //construct an annotation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for : LAnnPoint::LAnnPoint(hPoint)

L_VOID TestFunction49(HANNOBJECT& hAnnotationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnPoint MyAnnotation(hAnnotationObject); //construct an annotation object

//.... do something here ....

}


LAnnPoint::~LAnnPoint

#include "ltwrappr.h"

virtual L_VOID LAnnPoint::~LAnnPoint(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPoint class.

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:

LAnnPoint::LAnnPoint, Class Members

Example

For an example, refer to LAnnPoint::LAnnPoint(bCreate).


LAnnPoint::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPoint::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPoint::AddUserHandle, LAnnPoint::EnumerateHandles, LAnnPoint::EnumHandleCallBack, LAnnPoint::GetUserHandle, LAnnPoint::GetUserHandles, LAnnPoint::ChangeUserHandle, LAnnPoint::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a Point object.
L_VOID ExampleAnnAddUserHandle(LAnnPoint *pLPoint)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPoint->GetType ();
if (uType == ANNOBJECT_POINT)
{
pLPoint->GetRect (&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;
pLPoint->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPoint->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Point object."), TEXT("Error"), MB_OK);
}


LAnnPoint::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPoint::ChangeUserHandle(nIndex, pAnnHandle)

L_INT32 nIndex; | /* index of the user handle to change */
pANNHANDLE pAnnHandle; | /* pointer to a structure */

Changes properties of an existing user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnPoint::AddUserHandle and LAnnPoint::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPoint *LPoint)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPoint->GetUserHandles (NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPoint->GetUserHandle (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;
LPoint->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPoint::Create

#include "ltwrappr.h"

virtual L_INT LAnnPoint::Create(L_VOID)

Creates a Point annotation object. 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 use the LAnnPoint::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction50( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnPoint MyAnnotation(FALSE); //construct an annotation object

if (MyAnnotation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnPoint::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPoint::DeleteUserHandle(nIndex)

L_INT32 nIndex;

/* index of the user handle to be deleted */

Deletes an existing user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
nIndex | Index of the user-defined handle to be deleted. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnPoint *LPoint)
{
L_UINT uCount;

// Get the total count of user handles
LPoint->GetUserHandles (NULL, &uCount);
if (uCount > 0)
LPoint->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPoint::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPoint::EnumerateHandles()

Calls the LAnnPoint::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnPoint::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnPoint: public LAnnPoint
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPoint::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPoint *LPoint)
{
LPoint->EnableCallBack (TRUE);
LPoint->EnumerateHandles();
}


LAnnPoint::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPoint::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure */

Processes each annotation object from the LAnnPoint::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPoint::EnumerateHandles 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 LAnnPoint::ChangeUserHandle.

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.

To enable the LAnnPoint::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPoint::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnPoint::EnumerateHandles.


LAnnPoint::GetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetBitmap(pBitmap)

virtual L_INT LAnnPoint::GetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* address of the variable to be updated */

Gets the bitmap handle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to an LBitmapBase object to be updated with the handle to the annotation object's bitmap.
pBitmap | Address of the variable to be updated with the handle to the annotation object's bitmap.

Returns

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

Comments

Before calling LAnnPoint::GetBitmap(pBitmap), where pBitmap is of type LBitmapBase L_FAR, you must declare aan LBitmapBase object. Then, pass the address of the object in the pBitmap parameter. This function will update the object with the handle to the annotation object's bitmap.

Before calling LAnnPoint::GetBitmap(pBitmap), where pBitmap is of type pBITMAPHANDLE, 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.

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: | LAnnPoint::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example of both forms of LAnnPoint::GetBitmap(pBitmap:

void CVCAnnotation11Dlg::OnButtonPointGetSetBitmap()
{
ANNPOINT annPoint = {50,50};
ANNRECT annRect = {50,50,150,150};

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPoint *pMyAnnPoint = new(LAnnPoint);

pMyAnnPoint->SetPoints(&annPoint);
pMyAnnPoint->SetVisible(TRUE);

//Invert the primary bitmap
LBitmapBase *pBitmapBase = new(LBitmapBase);
pMyAnnPoint->GetBitmap(pBitmapBase);
//or
//BITMAPHANDLE LeadBitmap;
//pMyAnnPoint->GetBitmap(&LeadBitmap);

//Make the annotation point all white
pBitmapBase->Fill(RGB(255,255,255));

//Create container and insert annotation
LAnnContainer m_AnnContainer;
m_AnnContainer.Create(m_hWnd, &annRect, TRUE);
m_AnnContainer.Insert(*pMyAnnPoint);
m_AnnContainer.SetUserMode(ANNUSER_RUN);
}


LAnnPoint::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetFixed(pbFixed)

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

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: | Class Members, LAnnPoint::SetFixed, LAnnPoint::PushFixedState, LAnnPoint::PopFixedState, LAnnPoint::GetFixed, LAnnPoint::IsFixedInRect
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnPoint::SetFixed.


LAnnPoint::GetPointOptions

#include "ltwrappr.h"

static L_INT LAnnPoint::GetPointOptions(pPointOptions, uStructSize)

pANNPOINTOPTIONS pPointOptions; | /* pointer to a structure that specifies various point options */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pPointOptions */

Gets the options for the specified point annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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. 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 of 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

// This example toggles the appearance of a point annotation object.
// The appearance toggles between bitmap and circle.
L_VOID SampleAnnSetPointOptions(LAnnPoint *pLPoint)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;
ANNPOINTOPTIONS PointOptions;
L_UINT uObjectType;

uObjectType = pLPoint->GetType ();
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;
pLPoint->GetPointOptions(&PointOptions, sizeof(PointOptions));

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;
}
pLPoint->SetPointOptions(&PointOptions, 0);
}


LAnnPoint::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array to be filled with the endpoints of the ruler object.

Returns

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

Comments

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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnPoint::SetTransparent.


LAnnPoint::GetPredefinedBitmap

#include "ltwrappr.h"

static L_INT LAnnPoint::GetPredefinedBitmap(uType, pBitmap, uStructSize)

static L_INT LAnnPoint::GetPredefinedBitmap(uType, pLBitmap, uStructSize)

L_UINT uType; | /* constant that indicates the bitmap to retrieve */
pBITMAPHANDLE pBitmap; | /* pointer to a variable to be updated with the bitmap handle */
pLBitmapBase *pLBitmap; | /* pointer to an object to be updated with the bitmap handle */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pBitmap or pLBitmap */

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.
pLBitmap | Pointer to a valid bitmap object containing the image to set.
uStructSize | Size in bytes, of the structure pointed to by pBitmap or pLBitmap.. Use sizeof(BITMAPHANDLE).

Returns

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

Comments

You must free the bitmap handle when you are finished, using the LBitmapBase::Free function. Call the LAnnPoint::SetPredefinedBitmap 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.

See Also

Functions: | LAnnPoint::GetPredefinedBitmap
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Annotation Bitmap Objects

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()
{
LBitmap PointBitmap;

// Get predefined point bitmap
LAnnPoint::GetPredefinedBitmap(ANNBITMAP_POINT, &PointBitmap, sizeof(BITMAPHANDLE));

// Invert it
PointBitmap.Invert();

// Set as new point bitmap
LAnnPoint::SetPredefinedBitmap (ANNBITMAP_POINT, &PointBitmap);

MessageBox(NULL, TEXT("Now create a point annotation object. The bitmap is inverted"), TEXT(""), MB_OK);
}


LAnnPoint::GetTransparent

#include "ltwrappr.h"

virtual L_BOOL LAnnPoint::GetTransparent(L_VOID)

Determines whether the bitmap associated with the Point object uses a transparent color. A transparent color is not painted when the image is painted. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The bitmap uses a transparent color.
FALSE | The bitmap does not use 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.

See Also

Functions: | Class Members
Topics: | Displaying and Manipulating Annotation Objects

Example

For an example,refer to LAnnPoint::SetTransparent.


LAnnPoint::GetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetTransparentColor(pcrTransparent)

COLORREF L_FAR * pcrTransparent;

/* address of a variable to be updated */

Retrieves the transparent color set by LAnnPoint::SetTransparentColor. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::GetPixelColor.

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.

See Also

Functions: | LAnnPoint::SetTransparentColor, LAnnPoint::SetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnPoint::SetTransparent.


LAnnPoint::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPoint *LPoint)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPoint->GetUserHandles (NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPoint->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPoint::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPoint::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of structures that define user handles */
L_UINT *pCount; | /* pointer to an unsigned integer */

Gets information about all existing user-defined annotation handles. This function is available in the Document/Medical Toolkits.

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPoint * LPoint)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPoint->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPoint->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPoint::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPoint::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnPoint::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLPoint -- Pointer to LAnnPoint annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPoint *pLPoint)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPoint->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPoint::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPoint::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPoint::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPoint::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPoint::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPoint::PushFixedState / LAnnPoint::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPoint::PushFixedState and LAnnPoint::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PopFixedState (); | Fixed state is still disabled
LAnnPoint::PopFixedState (); | Fixed state is enabled

Note that LAnnPoint::PushFixedState and LAnnPoint::PopFixedState should always be called in pairs.

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: | Class Members, LAnnPoint::SetFixed, LAnnPoint::PushFixedState, LAnnPoint::GetFixed, LAnnPoint::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnPoint::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnPoint *pLPoint)
{
pLPoint->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPoint::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPoint::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPoint::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPoint::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPoint::PushFixedState / LAnnPoint::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPoint::PushFixedState and LAnnPoint::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PushFixedState (); | Fixed state is temporarily disabled
LAnnPoint::PopFixedState (); | Fixed state is still disabled
LAnnPoint::PopFixedState (); | Fixed state is enabled

Note that LAnnPoint::PushFixedState and LAnnPoint::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnPoint *pLPoint)
{
pLPoint->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPoint::SetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPoint::SetBitmap(pBitmap, uFlags=0)

virtual L_INT LAnnPoint::SetBitmap(pBitmap, uFlags=0)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the bitmap of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap object referencing the bitmap object to assign to the specified 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | LAnnPoint::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example for both forms of LAnnPoint::SetBitmap(pBitmap, uFlags=0):

void CVCAnnotation11Dlg::OnButtonSetBitmap()
{
ANNPOINT annPoint = {50,50};
ANNRECT annRect = {50,50,150,150};

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPoint *pMyAnnPoint = new(LAnnPoint);

pMyAnnPoint->SetPoints(&annPoint);
pMyAnnPoint->SetVisible(TRUE);

//Change LAnnPoint bitmap
LBitmapBase MyBitmapBasePrimary;
MyBitmapBasePrimary.Load(TEXT("d:\\work\\images\\tiny1.cmp"));
pMyAnnPoint->SetBitmap (&MyBitmapBasePrimary,0);

//Another way to change the bitmap
//pMyAnnPoint->SetBitmap(MyBitmapBasePrimary.GetHandle(),0);

//Create container and insert annotation
LAnnContainer m_AnnContainer;
m_AnnContainer.Create(m_hWnd, &annRect, TRUE);
m_AnnContainer.Insert(*pMyAnnPoint);
m_AnnContainer.SetUserMode(ANNUSER_RUN);
}


LAnnPoint::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPoint::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPoint *pLPoint)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPoint->GetFixed (&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPoint->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPoint::SetPointOptions

#include "ltwrappr.h"

static L_INT LAnnPoint::SetPointOptions(pPointOptions, uFlags)

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

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnPoint::GetPointOptions .


LAnnPoint::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPoint::SetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Defines a Point object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the endpoints 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.

Returns

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

Comments

You call this function once, passing a single 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnPoint::SetPoints.


LAnnPoint::SetPredefinedBitmap

#include "ltwrappr.h"

static L_INT LAnnPoint::SetPredefinedBitmap(uType, pBitmap)

static L_INT LAnnPoint::SetPredefinedBitmap(uType, pLBitmap)

L_UINT uType; | /* value that indicates the bitmap to change */
pBITMAPHANDLE pBitmap; | /* pointer to a valid bitmap handle containing an image*/
pLBitmapBase *pLBitmap; | /* pointer to an object to be updated with the bitmap handle */

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.
pLBitmap | Pointer to a valid bitmap object containing the image to set.

Returns

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

Comments

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 in automation mode when the ANNBITMAP_POINT tool is used 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:

LAnnPoint::SetPredefinedBitmap(ANNBITMAP_POINT, (pBITMAPHANDLE)NULL);

Call the LAnnPoint::GetPredefinedBitmap 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.

See Also

Functions: | LAnnPoint::GetPredefinedBitmap, LAnnPoint::GetTransparentColor
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Annotation Bitmap Objects

Example

For an example, refer to LAnnPoint::GetPredefinedBitmap.


LAnnPoint::SetTransparent

#include "ltwrappr.h"

virtual L_INT LAnnPoint::SetTransparent(bTransparent, uFlags=0)

L_BOOL bTransparent; | /* flag that indicates whether to make the bitmap transparent */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the bitmap associated with the Point object 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
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

Only Point and Stamp objects that are using a bitmap can be set 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.

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: | Class Members
Topics: | Annotation Functions (Document/Medical only) Displaying Annotations
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

void CVCAnnotation11Dlg::OnButtonTransparentColor2()
{
LBitmap MyBitmap;
RECT rect;
L_TCHAR szTemp[100];

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Load an image containing color RED
LBitmapBase BitmapBase;
BitmapBase.Load(TEXT("d:\\work\\images\\rgbw.bmp"));
LAnnPoint MyAnnPoint;

//Make RED transparent
MyAnnPoint.SetBitmap(&BitmapBase);

//Make WHITE transparent
MyAnnPoint.SetTransparentColor(RGB(255,255,255));

//Get old transparent state
if (!MyAnnPoint.GetTransparent())
AfxMessageBox(TEXT("Originally,
 no transparent color"));
else
{
COLORREF ColorRef;

MyAnnPoint.GetTransparentColor(&ColorRef);
wsprintf( szTemp,
TEXT("Old Transparent Color: %x"),
ColorRef);
AfxMessageBox(szTemp);
}

MyAnnPoint.SetTransparent(TRUE);

//Display the Point annotation
ANNPOINT annPoint = {100,100 };
MyAnnPoint.SetPoints(&annPoint);

//Verify location of point
ANNPOINT annPointTemp;
MyAnnPoint.GetPoints(&annPointTemp);
wsprintf( szTemp,
TEXT("Center
 of AnnPoint(%d, %d)"),
(int)annPointTemp.x,
(int)annPointTemp.y
 );

AfxMessageBox(szTemp);

MyAnnPoint.SetVisible(TRUE);
MyAnnPoint.GetBoundingRect(&rect)
 ;

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnPoint.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnPoint::SetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnPoint::SetTransparentColor(crTransparent, uFlags=0)

COLORREF crTransparent; | /* transparent color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Only objects that have a bitmap will use the transparent color.

This transparent color is used only if the object is set to transparent using LAnnPoint::SetTransparent.

By default, the transparent color is white (0x00FFFFFF).

All objects created by this automation object will have this transparent color.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

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: | LAnnPoint::GetTransparentColor, LAnnPoint::SetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnPoint::SetTransparent.


LAnnPointer::LAnnPointer

#include "ltwrappr.h"

L_VOID LAnnPointer::LAnnPointer(bCreate=TRUE)

L_VOID LAnnPointer::LAnnPointer(hPointer)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPointer; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPointer object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hPointer | Handle of the associated annotation object.

Returns

None

Comments

LAnnPointer::LAnnPointer(bCreate) is a constructor for the LAnnPointer class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPointer::LAnnPointer(hPointer) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_POINTER. The passed annotation object is invalidated.

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:

Class Members

Example

This is an example for LAnnPointer::LAnnPointer(bCreate):

L_VOID TestConstructor()
{
// this will call the default constructor and destructor when it is out of scope
LAnnPointer LeadAPointer(TRUE) ;

//...
}

This is an example for LAnnPointer::LAnnPointer(hPointer)

L_VOID TestConstructor (HANNOBJECT& hPointer)
{
// this will call the default constructor and destructor when it is out of scope
LAnnPointer LeadAPointer(hPointer) ;

//...
}


LAnnPointer::~LAnnPointer

#include "ltwrappr.h"

virtual L_VOID LAnnPointer::~LAnnPointer(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPointer class.

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:

Class Members

Example

For an example, refer to LAnnPointer::LAnnPointer.


LAnnPointer::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPointer::AddUserHandle, LAnnPointer::EnumerateHandles, LAnnPointer::EnumHandleCallBack, LAnnPointer::GetUserHandle, LAnnPointer::GetUserHandles, LAnnPointer::ChangeUserHandle, LAnnPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Pointer
L_VOID ExampleAnnAddUserHandle(LAnnPointer *pLPointer)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPointer->GetType();
if (uType == ANNOBJECT_POINTER)
{
pLPointer->GetRect(&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;
pLPointer->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPointer->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation Object Must be a Pointer"), TEXT("Error"), MB_OK);
}


LAnnPointer::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnPointer::AddUserHandle and LAnnPointer::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnPointer *LPointer)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPointer->GetUserHandle(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;
LPointer->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPointer::Create

#include "ltwrappr.h"

virtual L_INT LAnnPointer::Create(L_VOID)

Creates a Pointer annotation object. 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 use the LAnnPointer::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnPointer LeadPointer(FALSE); //construct an annotation pointer object

if (LeadPointer.Create()==SUCCESS)
{
//... do something here
}
}


LAnnPointer::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnPointer *LPointer)
{
L_UINT uCount;

// Get the total count of user handles
LPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LPointer->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPointer::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPointer::EnumerateHandles()

Calls the LAnnPointer::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnPointer::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnPointer: public LAnnPointer
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPointer::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPointer *LPointer)
{
LPointer->EnableCallBack(TRUE);
LPointer->EnumerateHandles();
}


LAnnPointer::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPointer::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnPointer::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPointer::EnumerateHandles 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 LAnnPointer::ChangeUserHandle.

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.

To enable the LAnnPointer::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPointer::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnPointer::EnumerateHandles.


LAnnPointer::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPointer::GetFixed(pbFixed)

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

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: | Class Members, LAnnPointer::SetFixed, LAnnPointer::PushFixedState, LAnnPointer::PopFixedState, LAnnPointer::GetFixed, LAnnPointer::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnPointer::SetFixed.


LAnnPointer::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnPointer::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn(LAnnPointer L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnPointer::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnPointer::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnPointer L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnPointer::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnPointer::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnPointer L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnPointer::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples displays the rotation angle of the Pointer annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnPointer * pLPointer)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLPointer->GetRotateAngle(&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);
}
}


LAnnPointer::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPointer *LPointer)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPointer->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPointer::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPointer::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPointer * LPointer)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPointer->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPointer->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPointer::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPointer::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnPointer::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLPointer -- Pointer to LAnnPointer annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPointer *pLPointer)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPointer->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPointer::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPointer::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPointer::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPointer::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPointer::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPointer::PushFixedState / LAnnPointer::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPointer::PushFixedState and LAnnPointer::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnPointer::PopFixedState (); | Fixed state is still disabled
LAnnPointer::PopFixedState (); | Fixed state is enabled

Note that LAnnPointer::PushFixedState and LAnnPointer::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnPointer::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnPointer *pLPointer)
{
pLPointer->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPointer::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPointer::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPointer::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPointer::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPointer::PushFixedState / LAnnPointer::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPointer::PushFixedState and LAnnPointer::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnPointer::PopFixedState (); | Fixed state is still disabled
LAnnPointer::PopFixedState (); | Fixed state is enabled

Note that LAnnPointer::PushFixedState and LAnnPointer::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnPointer *pLPointer)
{
pLPointer->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPointer::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPointer::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPointer *pLPointer)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPointer->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPointer->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPointer::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnPointer::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPointer::GetForeColor.


LAnnPointer::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnPointer::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPointer::GetLineStyle.


LAnnPointer::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnPointer::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the width to set*/
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPointer::GetLineWidth.


LAnnPolygon::LAnnPolygon

#include "ltwrappr.h"

L_VOID LAnnPolygon::LAnnPolygon(bCreate=TRUE)

L_VOID LAnnPolygon::LAnnPolygon(hPolygon)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPolygon; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPolygon object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hPolygon | Handle of the associated annotation object.

Returns

None

Comments

LAnnPolygon::LAnnPolygon(bCreate) is a constructor for the LAnnPolygon class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPolygon::LAnnPolygon(hPolygon) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_POLYGON. The passed annotation object is invalidated.

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:

LAnnPolygon::~LAnnPolygon, Class Members

Example

This is an example for LAnnPolygon::LAnnPolygon(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnPolygon LeadAPolygon(TRUE) ;

//...
}

This is an example for LAnnPolygon::LAnnPolygon(hPolygon):

L_VOID TestConstructor (HANNOBJECT& hPolygon)
{
// this will call the constructor and destructor when it is out of scope
LAnnPolygon LeadAPolygon(hPolygon) ;

//...
}


LAnnPolygon::~LAnnPolygon

#include "ltwrappr.h"

virtual L_VOID LAnnPolygon::~LAnnPolygon(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPolygon class.

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:

LAnnPolygon::LAnnPolygon, Class Members

Example

For an example, refer to LAnnPolygon::LAnnPolygon.


LAnnPolygon::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPolygon::EnumerateHandles, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandle, LAnnPolygon::GetUserHandles, LAnnPolygon::ChangeUserHandle, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a Polygon object

L_VOID ExampleAnnAddUserHandle(LAnnPolygon *pLPolygon)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPolygon->GetType();
if (uType == ANNOBJECT_POLYGON)
{
pLPolygon->GetRect (&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;
pLPolygon->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPolygon->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Polygon object."), TEXT("Error"), MB_OK);
}


LAnnPolygon::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnPolygon::AddUserHandle and LAnnPolygon::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumerateHandles, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandle, LAnnPolygon::GetUserHandles, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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(LAnnPolygon *LPolygon)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolygon->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolygon->GetUserHandle(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;
LPolygon->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolygon::Create

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::Create(L_VOID)

Creates a Polygon annotation object. 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 use the LAnnPolygon::SetXXX() functions to initialize the object after it is created.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnPolygon LeadPolygon(FALSE); //construct an polgon object

if (LeadPolygon.Create()==SUCCESS)
{
//... do something here
}
}


LAnnPolygon::Define

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::Define(pPoint, uState)

LPPOINT pPoint; | /* pointer to a POINT structure */
L_UINT uState; | /* state of the process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

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
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. Possible values are:
 | 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 the 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.

Returns

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

Comments

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.

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.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID MyDefine(LAnnPolygon L_FAR * pAnnObject,HWND hWnd)
{
RECT rClientRect;
POINT MyPoint;

GetClientRect(hWnd,&rClientRect) ;

// Set the point for the opposite corner of the rectangle
MyPoint.x = rClientRect.right / 2;
MyPoint.y = rClientRect.bottom / 2;

// Finish defining the rectangular annotation object
pAnnObject->Define( &MyPoint, ANNDEFINE_END);
}


LAnnPolygon::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::DeleteUserHandle(nIndex)

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

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: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumerateHandles, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandle, LAnnPolygon::GetUserHandles, LAnnPolygon::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This examples deletes the first user handle of an object

L_VOID ExampleAnnDeleteUserHandle(LAnnPolygon *LPolygon)
{
L_UINT uCount;

// Get the total count of user handles
LPolygon->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LPolygon->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolygon::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::EnumerateHandles()

Calls the LAnnPolygon::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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.

Polygon 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 LAnnPolygon::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandle, LAnnPolygon::GetUserHandles, LAnnPolygon::ChangeUserHandle, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnPolygon: public LAnnPolygon
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPolygon::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPolygon *LPolygon)
{
LPolygon->EnableCallBack(TRUE);
LPolygon->EnumerateHandles();
}


LAnnPolygon::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnPolygon::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPolygon::EnumerateHandles 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 LAnnPolygon::ChangeUserHandle.

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.

To enable the LAnnPolygon::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPolygon::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumerateHandles, LAnnPolygon::GetUserHandle, LAnnPolygon::GetUserHandles, LAnnPolygon::ChangeUserHandle, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

For an example, refer to LAnnPolygon::EnumerateHandles.


LAnnPolygon::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnPolygon::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color of the annotation object.

Comments

To see how the background color relates to the fill modes, 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnPolygon L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnPolygon::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnPolygon::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values of the fill mode are:

ANNMODE_TRANSPARENT [0]

ANNMODE_TRANSLUCENT [1]

ANNMODE_OPAQUE [2]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn (LAnnPolygon L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */

/* Set the fill mode to transparent, unless it already is */
FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT, 0);
}


LAnnPolygon::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnPolygon::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible values are:

ANNPATTERN_SOLID [0]

ANNPATTERN_BDIAGONAL [1]

ANNPATTERN_CROSS [2]

ANNPATTERN_DIAGCROSS [3]

ANNPATTERN_FDIAGONAL [4]

ANNPATTERN_HORIZONTAL [5]

ANNPATTERN_VERTICAL [6]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolygon L_FAR * pAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */

/* Set the fill pattern to solid, unless it already is */
FillPattern = pAnnObject->GetFillPattern();
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID, 0);
}


LAnnPolygon::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::GetFixed(pbFixed)

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

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: | Class Members, LAnnPolygon::SetFixed, LAnnPolygon::PushFixedState, LAnnPolygon::PopFixedState, LAnnPolygon::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnPolygon::SetFixed.


LAnnPolygon::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnPolygon::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current foreground color.

Comments

To see how the foreground color relates to the fill modes, 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of
the object passed by the caller */
L_VOID TestModifyAnn(LAnnPolygon L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnPolygon::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnPolygon::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnPolygon L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnPolygon::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnPolygon::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnPolygon L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnPolygon::GetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::GetNodes(pbShowNodes, puGapNodes)

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

Comments

Note:

The last node is always shown. Therefore, using a large value for puGapNodes will probably result in only the first and last nodes being shown.

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.

See Also

Functions: | LAnnPolygon::SetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnPolygon::SetNodes.


LAnnPolygon::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnPolygon::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in an object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

for an example, refer to LAnnPolygon::GetPoints.


LAnnPolygon::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array to be filled with the vertices of the object.

Returns

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

Comments

You can use the LAnnPolygon::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer,
L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest ( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnPolygon LeadPolygon(hObject) ;

// first, get the # of points in the object
uCount = LeadPolygon.GetPointCount ();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadPolygon.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadPolygon.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadPolygon.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnPolygon::GetPolyFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnPolygon::GetPolyFillMode(L_VOID)

Gets a value that indicates how a Polygon annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Returns

The polygonal fill-mode constant. 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolygon L_FAR * pAnnObject)
{
L_UINT PolyFillMode; /* Object's polygonal fill mode */
/* Change the fill mode */
PolyFillMode = pAnnObject->GetPolyFillMode();
if (PolyFillMode == ANNPOLYFILL_WINDING)
pAnnObject->SetPolyFillMode(ANNPOLYFILL_ALTERNATE, 0);
else
pAnnObject->SetPolyFillMode(ANNPOLYFILL_WINDING, 0);
}


LAnnPolygon::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumerateHandles, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandles, LAnnPolygon::ChangeUserHandle, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnPolygon *LPolygon)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolygon->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolygon->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolygon::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members, LAnnPolygon::AddUserHandle, LAnnPolygon::EnumerateHandles, LAnnPolygon::EnumHandleCallBack, LAnnPolygon::GetUserHandle, LAnnPolygon::ChangeUserHandle, LAnnPolygon::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnPolygon * LPolygon)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPolygon->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPolygon->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPolygon::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnPolygon::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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

// pLPolygon -- Pointer to LAnnPolygon annotation object.

L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPolygon *pLPolygon)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPolygon->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPolygon::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPolygon::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolygon::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolygon::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolygon::PushFixedState / LAnnPolygon::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolygon::PushFixedState and LAnnPolygon::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolygon::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolygon::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolygon::PopFixedState (); | Fixed state is still disabled
LAnnPolygon::PopFixedState (); | Fixed state is enabled

Note that LAnnPolygon::PushFixedState and LAnnPolygon::PopFixedState should always be called in pairs.

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: | Class Members, LAnnPolygon::SetFixed, LAnnPolygon::PushFixedState, LAnnPolygon::GetFixed, LAnnPolygon::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property of all objects in the container that

// have been temporarily disabled with a call to LAnnPolygon::PushFixedState.

// For an example using the magnifying glass, see the source code

// for the main Class Library annotation demo.

L_VOID SampleAnnPopFixedState(LAnnPolygon *pLPolygon)
{
pLPolygon->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolygon::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolygon::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolygon::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolygon::PushFixedState / LAnnPolygon::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolygon::PushFixedState and LAnnPolygon::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolygon::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolygon::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolygon::PopFixedState (); | Fixed state is still disabled
LAnnPolygon::PopFixedState (); | Fixed state is enabled

Note that LAnnPolygon::PushFixedState and LAnnPolygon::PopFixedState should always be called in pairs.

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: | Class Members, LAnnPolygon::SetFixed, LAnnPolygon::PopFixedState, LAnnPolygon::GetFixed, LAnnPolygon::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container.

// This is useful when fixed objects need to be temporarily painted larger or smaller than

// the fixed size. For an example using the magnifying glass, see the source code

// for the main Class Library annotation demo.

L_VOID SampleAnnPushFixedState(LAnnPolygon *pLPolygon)
{
pLPolygon->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolygon::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an exampe, refer to LAnnPolygon::GetBackColor.


LAnnPolygon::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* the object's fill mode */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillMode | The constant that specifies the object's fill mode. The following are the possible values of the fill mode:
 | ANNMODE_TRANSPARENT [0]
 | ANNMODE_TRANSLUCENT [1]
 | ANNMODE_OPAQUE [2]
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolygon::GetFillMode.


LAnnPolygon::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetFillPattern( uFillPattern=ANNPATTERN_SOLID, uFlags=0 )

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillPattern | The constant that specifies the fill pattern. Possible values are:
 | ANNPATTERN_SOLID [0]
 | ANNPATTERN_BDIAGONAL [1]
 | ANNPATTERN_CROSS [2]
 | ANNPATTERN_DIAGCROSS [3]
 | ANNPATTERN_FDIAGONAL [4]
 | ANNPATTERN_HORIZONTAL [5]
 | ANNPATTERN_VERTICAL [6]
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolygon::GetLineStyle.


LAnnPolygon::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members, LAnnPolygon::PushFixedState, LAnnPolygon::PopFixedState, LAnnPolygon::GetFixed, LAnnPolygon::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnPolygon *pLPolygon)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPolygon->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPolygon->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPolygon::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnPolygon::GetForeColor.


LAnnPolygon::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolygon::GetLineStyle.


LAnnPolygon::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolygon::GetLineWidth.


LAnnPolygon::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a Polygon object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the object will be displayed in design mode.

If bShowNodes is 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.

See Also

Functions: | LAnnPolygon::GetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void CVCAnnotation11Dlg::OnButton3()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPolygon MyAnnPolygon;

ANNPOINT MyPts[4] = { 40,40,
140,40,
140,140,
100,180
};

pANNPOINT pMyPts = MyPts;
MyAnnPolygon.SetPoints(pMyPts, 4);

L_BOOL bShowNodes;
L_UINT uGapNodes;
MyAnnPolygon.GetNodes(&bShowNodes, &uGapNodes);

//skip more nodes than currently skipping
MyAnnPolygon.SetNodes(uGapNodes + 1);
}


LAnnPolygon::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /* pointer to an array */
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object, which requires multiple points. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnPolygon::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnPolygon::GetPoints.


LAnnPolygon::SetPolyFillMode

#include "ltwrappr.h"

virtual L_INT LAnnPolygon::SetPolyFillMode(uPolyFillMode=ANNPOLYFILL_WINDING, uFlags=0)

L_UINT uPolyFillMode; | /* constant that specifies the polygon fill mode */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the value that determines how a Polygon annotation with crossing lines is filled. This function is available in the Document/Medical Toolkits.

Parameter | Description
uPolyFillMode | The constant that specifies the polygon fill mode. The following are possible values:
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolygon::GetPolyFillMode.


LAnnPolyline::LAnnPolyline

#include "ltwrappr.h"

L_VOID LAnnPolyline:: LAnnPolyline(bCreate=TRUE)

L_VOID LAnnPolyline::LAnnPolyline(hPolyline)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPolyline; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPolyline object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hPolyline | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnPolyline::LAnnPolyline(bCreate) is a constructor for the LAnnPolyline class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPolyline::LAnnPolyline(hPolyline) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_POLYLINE. The passed annotation object is invalidated.

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:

LAnnPolyline::~LAnnPolyline, Class Members

Example

This is an example for LAnnPolyline::LAnnPolyline(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnPolyline LeadAPolyLine(TRUE) ;

//...
}

This is an example for LAnnPolyline::LAnnPolyline(hPolyline):

L_VOID TestConstructor (HANNOBJECT& hPolyLine)
{
// this will call the default constructor and destructor when it is out of scope
LAnnPolyline LeadAPolyLine(hPolyLine) ;

//...
}


LAnnPolyline::~LAnnPolyline

#include "ltwrappr.h"

virtual L_VOID LAnnPolyline::~LAnnPolyline (L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPolyline class.

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:

LAnnPolyline::LAnnPolyline, Class Members

Example

For an example, refer to LAnnPolyline::LAnnPolyline.


LAnnPolyline::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPoint::AddUserHandle, LAnnPoint::EnumerateHandles, LAnnPoint::EnumHandleCallBack, LAnnPoint::GetUserHandle, LAnnPoint::GetUserHandles, LAnnPoint::ChangeUserHandle, LAnnPoint::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Polyline
L_VOID ExampleAnnAddUserHandle(LAnnPolyline *pLPolyline)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPolyline->GetType ();
if (uType == ANNOBJECT_POLYLINE)
{
pLPolyline->GetRect (&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;
pLPolyline->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPolyline->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation Object Must be a Polyline"), TEXT("Error"), MB_OK);
}


LAnnPolyline::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnPolyline::AddUserHandle and LAnnPolyline::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPolyline *LPolyline)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolyline->GetUserHandles (NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolyline->GetUserHandle (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;
LPolyline->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyline::Create

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::Create(L_VOID)

Creates a Polyline annotation object. 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 use the LAnnPolyline::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnPolyline LeadPolyLine(FALSE); //construct a Polyline object

if (LeadPolyLine.Create()==SUCCESS)
{
//... do something here
}
}


LAnnPolyline::Define

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::Define(pPoint, uState)

LPPOINT pPoint; | /* pointer to a POINT structure */
L_UINT uState; | /* state of the process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

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
pPoint | Pointer to a POINT structure. The points in the array must be in the order in which the vertices are connected. 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 the 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.

Returns

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

Comments

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.

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.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations
 | Displaying and Manipulating Annotation Objects

Example

L_VOID MyDefine(LAnnPolyline L_FAR * pAnnObject,HWND hWnd)
{
RECT rClientRect;
POINT MyPoint;

GetClientRect(hWnd,&rClientRect) ;

// Set the point for the opposite corner of the rectangle
MyPoint.x = rClientRect.right / 2;
MyPoint.y = rClientRect.bottom / 2;

// Finish defining the rectangular annotation object
pAnnObject->Define( &MyPoint, ANNDEFINE_END);
}


LAnnPolyline::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnPolyline *LPolyline)
{
L_UINT uCount;

// Get the total count of user handles
LPolyline->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LPolyline->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyline::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::EnumerateHandles()

Calls the LAnnPolyline::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnPolyline::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnPolyline: public LAnnPolyline
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPolyline::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPolyline *LPolyline)
{
LPolyline->EnableCallBack (TRUE);
LPolyline->EnumerateHandles();
}


LAnnPolyline::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnPolyline::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPolyline::EnumerateHandles 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 LAnnPolyline::ChangeUserHandle.

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.

To enable the LAnnPolyline::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPolyline::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnPolyline::EnumerateHandles.


LAnnPolyline::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::GetFixed(pbFixed)

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

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: | Class Members, LAnnPoint::SetFixed, LAnnPoint::PushFixedState, LAnnPoint::PopFixedState, LAnnPoint::GetFixed, LAnnPoint::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnPolyline::SetFixed.


LAnnPolyline::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnPolyline::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn(LAnnPolyline L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnPolyline::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnPolyline::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolyline L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnPolyline::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnPolyline::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolyline L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnPolyline::GetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::GetNodes(pbShowNodes, puGapNodes)

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

Comments

Note:

The last node is always shown. Therefore, using a large value for puGapNodes will probably result in only the first and last nodes being shown.

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.

See Also

Functions: | LAnnPolyline::SetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnPolyline::SetNodes.


LAnnPolyline::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnPolyline::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | Displaying and Manipulating Annotation Objects

Example

For an example, refer to LAnnPolyline::GetPoints.


LAnnPolyline::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to the array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array that this function will fill with the vertices of the object.

Returns

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

Comments

You can use the LAnnPolyline::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer,
L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnPolyline LeadPolyline(hObject) ;

// first, get the # of points in the object
uCount = LeadPolyline.GetPointCount();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadPolyline.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadPolyline.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadPolyline.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnPolyline::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPolyline *LPolyline)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolyline->GetUserHandles (NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolyline->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyline::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of structures */
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
pAnnHandle | Pointer to an 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPolyline * LPolyline)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPolyline->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPolyline->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPolyline::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnPolyline::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLPolyline -- Pointer to LAnnPolyline annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPolyline *pLPolyline)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPolyline->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPolyline::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPolyline::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolyline::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolyline::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolyline::PushFixedState / LAnnPolyline::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolyline::PushFixedState and LAnnPolyline::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolyline::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyline::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyline::PopFixedState (); | Fixed state is still disabled
LAnnPolyline::PopFixedState (); | Fixed state is enabled

Note that LAnnPolyline::PushFixedState and LAnnPolyline::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnPolyline::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnPolyline *pLPolyline)
{
pLPolyline->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolyline::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolyline::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolyline::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolyline::PushFixedState / LAnnPolyline::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolyline::PushFixedState and LAnnPolyline::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolyline::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyline::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyline::PopFixedState (); | Fixed state is still disabled
LAnnPolyline::PopFixedState (); | Fixed state is enabled

Note that LAnnPolyline::PushFixedState and LAnnPolyline::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnPolyline *pLPolyline)
{
pLPolyline->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolyline::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPolyline *pLPolyline)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPolyline->GetFixed (&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPolyline->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPolyline::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnPolyline::GetForeColor.


LAnnPolyline::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolyline::GetLineStyle.


LAnnPolyline::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolyline::GetLineWidth.


LAnnPolyline::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a Polyline object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the object will be displayed in design mode.

If bShowNodes is 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.

See Also

Functions: | LAnnPolyline::GetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void CVCAnnotation11Dlg::OnButtonPolylineGetsetnodes()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPolyline MyAnnPolyline;

ANNPOINT MyPts[4] = { 40,40,
140,40,
140,140,
100,180
};

pANNPOINT pMyPts = MyPts;
MyAnnPolyline.SetPoints(pMyPts, 4);

L_BOOL bShowNodes;
L_UINT uGapNodes;
MyAnnPolyline.GetNodes(&bShowNodes, &uGapNodes);

//skip more nodes than currently skipping
MyAnnPolyline.SetNodes(uGapNodes + 1);
}


LAnnPolyline::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolyline::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /*pointer to the array of LEADTOOLS ANNPOINT structures*/
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnPolyline::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnPolyline::GetPoints.


LAnnPolyRuler::LAnnPolyRuler

#include "ltwrappr.h"

L_VOID LAnnPolyRuler::LAnnPolyRuler(bCreate=TRUE)

L_VOID LAnnPolyRuler::LAnnPolyRuler(hPolyRuler)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPolyRuler; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPolyRuler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hPolyRuler | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnPolyRuler::LAnnPolyRuler(bCreate) is a constructor for the LAnnPolyRuler class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPolyRuler::LAnnPolyRuler(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnPolyRuler. The passed annotation object is invalidated.

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:

LAnnPolyRuler::~LAnnPolyRuler, Class Members

Example

This is an example for LAnnPolyRuler::LAnnPolyRuler(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnPolyRuler LeadAPolyRuler(TRUE) ;

//...
}

This is an example for LAnnPolyRuler::LAnnPolyRuler(hPolyRuler):

L_VOID TestConstructor (HANNOBJECT& hPolyRuler)
{
// this will call the constructor and destructor when it is out of scope
LAnnPolyRuler LeadAFTR(hPolyRuler) ;

//...
}


LAnnPolyRuler::~LAnnPolyRuler

#include "ltwrappr.h"

virtual L_VOID LAnnPolyRuler::~LAnnPolyRuler(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPolyRuler class.

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:

Class Members

Example

For an example, refer to LAnnPolyRuler::LAnnPolyRuler.


LAnnPolyRuler::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPolyRuler::AddUserHandle, LAnnPolyRuler::EnumerateHandles, LAnnPolyRuler::EnumHandleCallBack, LAnnPolyRuler::GetUserHandle, LAnnPolyRuler::GetUserHandles, LAnnPolyRuler::ChangeUserHandle, LAnnPolyRuler::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example adds user handles to the center of the top and bottom of a PolyRuler object
L_VOID ExampleAnnAddUserHandle(LAnnPolyRuler *pLPolyRuler)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPolyRuler->GetType();
if (uType == ANNOBJECT_POLYRULER)
{
pLPolyRuler->GetRect(&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;
pLPolyRuler->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPolyRuler->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a PolyRuler object."), TEXT("Error"), MB_OK);
}


LAnnPolyRuler::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnPolyRuler::AddUserHandle and LAnnPolyRuler::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnPolyRuler *LPolyRuler)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolyRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolyRuler->GetUserHandle(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;
LPolyRuler->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyRuler::Create

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::Create(L_VOID)

Creates a PolyRuler annotation object. 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 use the LAnnPolyRuler::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnPolyRuler LeadPolyRuler(FALSE); //construct an annotation note object

if (LeadPolyRuler.Create()==SUCCESS)
{
//... do something here
}
}


LAnnPolyRuler::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnPolyRuler *LPolyRuler)
{
L_UINT uCount;

// Get the total count of user handles
LPolyRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LPolyRuler->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyRuler::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::EnumerateHandles()

Calls the LAnnPolyRuler::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnPolyRuler::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnPolyRuler: public LAnnPolyRuler
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPolyRuler::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPolyRuler *LPolyRuler)
{
LPolyRuler->EnableCallBack(TRUE);
LPolyRuler->EnumerateHandles();
}


LAnnPolyRuler::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnPolyRuler::EnumerateHandles function. . This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPolyRuler::EnumerateHandles 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 LAnnPolyRuler::ChangeUserHandle.

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.

To enable the LAnnPolyRuler::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPolyRuler::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

For an example, refer to LAnnPolyRuler::EnumerateHandles.


LAnnPolyRuler::GetDistance

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetDistance(pdDistance, pdDistance2=0)

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(s) in the object's unit of measurement, set by LAnnRuler::SetUnit. This function is available in the Document/Medical Toolkits.

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

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnRuler::SetUnit, LAnnRuler::GetUnit, LAnnRuler::SetGaugeLength, LAnnRuler::GetGaugeLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects

Example

/* gets the current measurement unit settings and displays
 them */
/* if unit is not inches, make it so */

L_VOID ModifyAnnUnit(LAnnPolyRuler L_FAR * pAnnObject)
{
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;

/* first, get unit abbreviation string len */
uLen = pAnnObject->GetUnitLen();

/* allocate enough memory for the abbreviation string
 */
hUnitAbbrev = GlobalAlloc(GMEM_MOVEABLE, (uLen+1)*sizeof(L_TCHAR));
pUnitAbbrev = (L_TCHAR L_FAR*)GlobalLock(hUnitAbbrev);

/* get the settings */
uUnit = pAnnObject->GetUnit
 (pUnitAbbrev, &uPrecision);

/* and, get the distance */
pAnnObject->GetDistance(&dDistance);

/* display current settings & distance in current
 unit of measurement */
wsprintf(buf, TEXT("Unit: %d\nAbbrev: %s\nPrecision:
 %d\n"),
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)
pAnnObject->SetUnit
 (ANNUNIT_INCHES, TEXT("in"), 2, 0);

GlobalUnlock(hUnitAbbrev);
GlobalFree(hUnitAbbrev);
}


LAnnPolyRuler::GetDistance2

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetDistance2(puCount, pDistance, pTotalDistance, uStructSize)

L_UINT puCount; | /* address of variable to be updated */
pANNSMARTDISTANCE pDistance; | /*address of an array of structures*/
pANNSMARTDISTANCE pTotalDistance; | /*address of an ANNSMARTDISTANCE variable*/
L_UINT uStructSize; | /* size of the structure */

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

Returns

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

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;

pPolyRuler->GetDistance2(&uCount,
 NULL, NULL, sizeof(ANNSMARTDISTANCE));
pDistance = (pANNSMARTDISTANCE)malloc(uCount
 * sizeof(ANNSMARTDISTANCE));
pPolyRuler->GetDistance2(&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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Working with the Toolbar
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This sample calls GetDistance2 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_MILIMETERS");
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);

if (pszSmartDistance)
{
lstrcpy(pszSmartDistance, szMsg);
}

if (puLength)
{
*puLength = uLength;
}
}

L_VOID SampleAnnGetDistance(LAnnPolyRuler * pObject)
{
L_UINT uCount;
L_TCHAR *pszObject;
L_UINT uType;
L_INT nRet;
L_TCHAR szMsg[500];
ANNSMARTDISTANCE sdTotalDistance;
pANNSMARTDISTANCE pDistance = NULL;

uType = pObject->GetType();
pszObject = annGetObjectString(uType);
nRet= pObject->GetDistance2(&uCount,
 NULL, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}
// We know the number of rulers
pDistance = (ANNSMARTDISTANCE * )malloc(uCount * sizeof(ANNSMARTDISTANCE));
if (!pDistance)
MessageBox(NULL, TEXT("Not enough memory"), TEXT("Error"),
 MB_OK);

nRet = pObject->GetDistance2(&uCount,
 pDistance, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}

free(pDistance);
}


LAnnPolyRuler::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetFixed(pbFixed)

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

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: | Class Members, LAnnPolyRuler::SetFixed, LAnnPolyRuler::PushFixedState, LAnnPolyRuler::PopFixedState, LAnnPolyRuler::GetFixed, LAnnPolyRuler::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnPolyRuler::SetFixed.


LAnnPolyRuler::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnPolyRuler::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolyRuler L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnPolyRuler::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnPolyRuler::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnPolyRuler L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnPolyRuler::GetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetNodes(pbShowNodes, puGapNodes)

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

Comments

Note:

The last node is always shown. Therefore, using a large value for puGapNodes will probably result in only the first and last nodes being shown.

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.

See Also

Functions: | LAnnPolyRuler::SetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnPolyRuler::SetNodes.


LAnnPolyRuler::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnPolyRuler::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnPolyRuler::GetPoints.


LAnnPolyRuler::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to the array */

Fills the specified array of ANNPOINT structures with the vertices of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array that this function will fill with the vertices of the object.

Returns

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

Comments

You can use the LAnnPolyRuler::GetPointCount 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 .

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

/* This example gets the points for an object, shrinks the object by 1/2 */
/* and then puts the points back to the object. */
L_VOID TestPolyPoints(HWND hwnd, LAnnContainer& LeadContainer,
L_BOOL fDoubleClick, L_INT x, L_INT y, L_UINT keyFlags)
{
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
L_UINT uCount; // Number of points in the object
L_INT i;
ANNRECT rcDefine;// Defining rectangle for the object
L_DOUBLE cx; // Center x point
L_DOUBLE cy; // Center y point
LBuffer LeadBuffer ;

// 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
LeadContainer.HitTest ( &PointToTest, &TestResult, &hObject);
if ( TestResult == ANNHIT_BODY )
{
LAnnPolyRuler LeadPolyRuler(hObject) ;

// first, get the # of points in the object
uCount = LeadPolyRuler.GetPointCount ();

LeadBuffer.Reallocate(sizeof(ANNPOINT) * uCount);

pPoints = (pANNPOINT)LeadBuffer.Lock() ;

// Now, get the points
LeadPolyRuler.GetPoints(pPoints);

// Get the defining rect, and find the center point
LeadPolyRuler.GetRect ( &rcDefine );
cx = (rcDefine.right + rcDefine.left) / 2;
cy = (rcDefine.bottom + rcDefine.top) / 2;
for (i=0; i<(L_INT)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
LeadPolyRuler.SetPoints ( pPoints, uCount);

LeadBuffer.Unlock() ;
}
}


LAnnPolyRuler::GetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetTicMarkLength(pdLength)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Working with the Toolbar
 | Types of Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnPolyRuler::SetTicMarkLength.


LAnnPolyRuler::GetUnitLen

#include "ltwrappr.h"

virtual L_UINT LAnnPolyRuler::GetUnitLen(L_VOID)

Gets the size of the buffer required to hold pUnitAbbrev in LAnnRuler::GetUnit. This function is available in the Document/Medical Toolkits.

Returns

The length of the unit abbreviation string.

Comments

Call this function before calling LAnnRuler::GetUnit 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.

See Also

Functions: | LAnnAutomation::SetBitmapDpiX, LAnnAutomation::SetBitmapDpiY, LAnnAutomation::GetBitmapDpiX, LAnnAutomation::GetBitmapDpiY, LAnnRuler::SetUnit, LAnnRuler::GetUnit, LAnnPolyRuler::GetDistance, LAnnRuler::SetGaugeLength, LAnnRuler::GetGaugeLength, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnPolyRuler::GetDistance.


LAnnPolyRuler::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnPolyRuler *LPolyRuler)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPolyRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPolyRuler->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPolyRuler::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnPolyRuler * LPolyRuler)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPolyRuler->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPolyRuler->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPolyRuler::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnPolyRuler::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLPolyRuler -- Pointer to LAnnPolyRuler annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPolyRuler *pLPolyRuler)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPolyRuler->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPolyRuler::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPolyRuler::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolyRuler::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolyRuler::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolyRuler::PushFixedState / LAnnPolyRuler::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolyRuler::PushFixedState and LAnnPolyRuler::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolyRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyRuler::PopFixedState (); | Fixed state is still disabled
LAnnPolyRuler::PopFixedState (); | Fixed state is enabled

Note that LAnnPolyRuler::PushFixedState and LAnnPolyRuler::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the "fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnPolyRuler::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnPolyRuler *pLPolyRuler)
{
pLPolyRuler->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolyRuler::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPolyRuler::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPolyRuler::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPolyRuler::PushFixedState / LAnnPolyRuler::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPolyRuler::PushFixedState and LAnnPolyRuler::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPolyRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnPolyRuler::PopFixedState (); | Fixed state is still disabled
LAnnPolyRuler::PopFixedState (); | Fixed state is enabled

Note that LAnnPolyRuler::PushFixedState and LAnnPolyRuler::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnPolyRuler *pLPolyRuler)
{
pLPolyRuler->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPolyRuler::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnPolyRuler *pLPolyRuler)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPolyRuler->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPolyRuler->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPolyRuler::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolyRuler::GetLineStyle.


LAnnPolyRuler::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnPolyRuler::GetLineWidth.


LAnnPolyRuler::SetNodes

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetNodes(bShowNodes=TRUE, uGapNodes=0, uFlags=0)

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 a PolyRuler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

This function determines how the nodes for the object will be displayed in design mode.

If bShowNodes is 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.

See Also

Functions: | LAnnPolyRuler::GetNodes
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

void CVCAnnotation11Dlg::OnButtonPolyRulerGetsetnodes()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPolyRuler MyAnnPolyRuler;

ANNPOINT MyPts[4] = { 40,40,
140,40,
140,140,
100,180
};

pANNPOINT pMyPts = MyPts;
MyAnnPolyRuler.SetPoints(pMyPts, 4);

L_BOOL bShowNodes;
L_UINT uGapNodes;
MyAnnPolyRuler.GetNodes(&bShowNodes, &uGapNodes);

//skip more nodes than currently skipping
MyAnnPolyRuler.SetNodes(uGapNodes + 1);
}


LAnnPolyRuler::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /* pointer to the array of LEADTOOLS ANNPOINT structures */
L_UINT uCount; | /* number of points in the array */

Defines the shape of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::Define function to specify the array of points interactively.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnPolyRuler::GetPoints.


LAnnPolyRuler::SetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnPolyRuler::SetTicMarkLength(dLength, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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.

See Also

Functions: | Class Members, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Working with the Toolbar
 | Types of Annotations
 | 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
 pObjec
L_VOID SampleAnnTicMarkLength(LAnnPolyRuler *pObject)
{
L_INT nRet;
L_DOUBLE dLength;
L_TCHAR szMsg[200];

nRet = pObject->GetTicMarkLength(&dLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Old Tic
 Mark Length: %f\nNew Tic Mark Length %f"),
dLength,
2 * dLength);

pObject->SetTicMarkLength(2
 * dLength, 0);
MessageBox(NULL, szMsg, TEXT(""),
 MB_OK);
}
}


LAnnProtractor::LAnnProtractor

#include "ltwrappr.h"

L_VOID LAnnProtractor::LAnnProtractor(bCreate=TRUE)

L_VOID LAnnProtractor::LAnnProtractor(hProtractor)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hProtractor; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnProtractor object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hProtractor | Handle of the associated annotation object.

Returns

None

Comments

LAnnProtractor::LAnnProtractor(bCreate) is a constructor for the LAnnProtractor class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnProtractor::LAnnProtractor(hProtractor) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_RULER. The passed annotation object is invalidated.

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:

LAnnProtractor::~LAnnProtractor, Class Members

Example

This is an example for LAnnProtractor::LAnnProtractor(bCreate):

L_VOID TestFunction36( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnProtractor MyAnnotation; //construct an annotation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for LAnnProtractor::LAnnProtractor(hProtractor):

L_VOID TestFunction37(HANNOBJECT& hAnnotationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnProtractor MyAnnotation(hAnnotationObject); //construct an annotation object

//.... do something here ....

}


LAnnProtractor::~LAnnProtractor

#include "ltwrappr.h"

virtual L_VOID LAnnProtractor::~LAnnProtractor(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnProtractor class.

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:

Class Members

Example

For an example, refer to LAnnProtractor::LAnnProtractor(bCreate).


LAnnProtractor::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnProtractor::AddUserHandle, LAnnProtractor::EnumerateHandles, LAnnProtractor::EnumHandleCallBack, LAnnProtractor::GetUserHandle, LAnnProtractor::GetUserHandles, LAnnProtractor::ChangeUserHandle, LAnnProtractor::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Protractor
L_VOID ExampleAnnAddUserHandle(LAnnProtractor *pLProtractor)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLProtractor->GetType();
if (uType == ANNOBJECT_PROTRACTOR)
{
pLProtractor->GetRect(&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;
pLProtractor->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLProtractor->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Protractor."), TEXT("Error"), MB_OK);
}


LAnnProtractor::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnProtractor::AddUserHandle and LAnnProtractor::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnProtractor *LProtractor)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LProtractor->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LProtractor->GetUserHandle(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;
LProtractor->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnProtractor::Create

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::Create(L_VOID)

Creates a Protractor annotation object. 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 use the LAnnProtractor::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction38( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnProtractor MyAnnotation(FALSE); //construct an annotation object

if (MyAnnotation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnProtractor::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnProtractor *LProtractor)
{
L_UINT uCount;

// Get the total count of user handles
LProtractor->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LProtractor->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnProtractor::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::EnumerateHandles()

Calls the LAnnProtractor::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnProtractor::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnProtractor: public LAnnProtractor
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnProtractor::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnProtractor *LProtractor)
{
LProtractor->EnableCallBack(TRUE);
LProtractor->EnumerateHandles();
}


LAnnProtractor::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnProtractor::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnProtractor::EnumerateHandles 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 LAnnProtractor::ChangeUserHandle.

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.

To enable the LAnnProtractor::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnProtractor::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnProtractor::EnumerateHandles.


LAnnProtractor::GetAngle

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetAngle(pdAngle)

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 LAnnProtractor::SetProtractorOptions. This function is available in the Document/Medical Toolkits.

Parameter | Description
pdAngle | Address of a variable to be updated with the angle of the protractor object.

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.

See Also

Functions: | LAnnProtractor::SetProtractorOptions, LAnnProtractor::GetProtractorOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations

Example

For an example, refer to LAnnProtractor::GetDistance.


LAnnProtractor::GetDistance

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetDistance(pdDistance, pdDistance2)

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 rulers in the object's unit of measurement, set by LAnnProtractor::SetProtractorOptions. This function is available in the Document/Medical Toolkits.

Parameter | Description
pdDistance | Address of the variable to be updated with the distance of the primary ruler. Since protractors 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 secondary ruler. Since protractors 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.

See Also

Functions: | Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects

Example

void CVCAnnotation11Dlg::OnButtonProtractor()
{
LBitmap MyBitmap;
RECT rect;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnProtractor MyAnnProtractor;

ANNPOINT MyPts[3] = { 40,40,
140,40,
140,140
};
pANNPOINT pMyPts = MyPts;
MyAnnProtractor.SetPoints(pMyPts,
 3);

//Change protractor options
L_BOOL bAcute;
MyAnnProtractor.GetProtractorOptions(&bAcute);
MyAnnProtractor.SetProtractorOptions(bAcute,
 //keep unchanged
ANNANGLE_DEGREES,
TEXT("units"),
4, //precision
60, //arc radius
0);

L_DOUBLE dAngle;
L_TCHAR szTemp[100];
MyAnnProtractor.GetAngle(&dAngle);
wsprintf(szTemp, TEXT("Angle %d"), (int)dAngle);
AfxMessageBox(szTemp);

L_UINT uShowFlags;
MyAnnProtractor.GetShowFlags(&uShowFlags);
MyAnnProtractor.SetShowFlags(ANNSHOW_LENGTH,0);

//Get Distances
L_DOUBLE dDist1=0, dDist2=0;
dDist1 = 0; dDist2=0; MyAnnProtractor.GetDistance(&dDist1,
 &dDist2);

//Set Protractor properties
MyAnnProtractor.SetVisible(TRUE);
MyAnnProtractor.GetBoundingRect(&rect)
 ;

HDC hDC = ::GetDC(m_hWnd);
MyAnnProtractor.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnProtractor::GetDistance2

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetDistance2(puCount, pDistance, pTotalDistance, uStructSize)

L_UINT puCount; | /* address of variable to be updated */
pANNSMARTDISTANCE pDistance; | /* address of an array of structures */
pANNSMARTDISTANCE pTotalDistance; | /* address of a variable */
L_UINT uStructSize; | /* size of the structure */

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

Returns

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

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;

pProtractor->GetDistance2(&uCount,
 NULL, NULL, sizeof(ANNSMARTDISTANCE));
pDistance = (p ANNSMARTDISTANCE)malloc(uCount
 * sizeof(ANNSMARTDISTANCE));
pProtractor->GetDistance2(&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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This sample calls GetDistance2 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_MILIMETERS");
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);

if (pszSmartDistance)
{
lstrcpy(pszSmartDistance, szMsg);
}

if (puLength)
{
*puLength = uLength;
}
}

L_VOID SampleAnnGetDistance(LAnnProtractor * pObject)
{
L_UINT uCount;
L_TCHAR *pszObject;
L_UINT uType;
L_INT nRet;
L_TCHAR szMsg[500];
ANNSMARTDISTANCE sdTotalDistance;
pANNSMARTDISTANCE pDistance = NULL;

uType = pObject->GetType();
pszObject = annGetObjectString(uType);
nRet= pObject->GetDistance2(&uCount,
 NULL, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}
// We know the number of rulers
pDistance = (ANNSMARTDISTANCE * )malloc(uCount * sizeof(ANNSMARTDISTANCE));
if (!pDistance)
MessageBox(NULL, TEXT("Not enough memory"), TEXT("Error"),
 MB_OK);

nRet = pObject->GetDistance2(&uCount,
 pDistance, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}

free(pDistance);
}


LAnnProtractor::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetFixed(pbFixed)

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

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: | Class Members, LAnnProtractor::SetFixed, LAnnProtractor::PushFixedState, LAnnProtractor::PopFixedState, LAnnProtractor::GetFixed, LAnnProtractor::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnProtractor::SetFixed.


LAnnProtractor::GetPointCount

#include "ltwrappr.h"

virtual L_UINT LAnnProtractor::GetPointCount(L_VOID)

Gets the number of vertices (corner points) in an object. This function is available in the Document/Medical Toolkits.

Returns

The number of vertices.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

for an example, refer to LAnnProtractor::GetPoints.


LAnnProtractor::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array to be filled with the vertices of the protractor object.

Returns

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

Comments

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.

The order of the vertices in the array is shown below:

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

void CVCAnnotation11Dlg::OnButtonGetPointCount()
{
LBitmap MyBitmap;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnProtractor MyAnnProtractor;

ANNPOINT MyPts[3] = { 40,40,
140,40,
140,140
};
pANNPOINT pMyPts = MyPts;
MyAnnProtractor.SetPoints(pMyPts,
 3);

L_UINT uPointCount = MyAnnProtractor.GetPointCount();
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, sizeof(ANNPOINT)
 * uPointCount);
pANNPOINT pAnnPoint = (pANNPOINT)GlobalLock(hGlobal);

MyAnnProtractor.GetPoints(pAnnPoint);

for (unsigned int i=0; i<uPointCount; i++)
{
L_TCHAR szTemp[100];

wsprintf(szTemp, TEXT("[%d]Point(%d,
 %d)"), i, (int)pAnnPoint[i].x, (int)pAnnPoint[i].y);
AfxMessageBox(szTemp);
}
GlobalFree(hGlobal);
}


LAnnProtractor::GetProtractorOptions

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetProtractorOptions(pbAcute=NULL, puUnit=NULL, puAbbrevLen=NULL, pszAbbrev=NULL, puPrecision=NULL, pdArcRadius=NULL)

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; | /* addresss of the variable to be updated */
L_DOUBLE L_FAR * pdArcRadius; | /* address of the variable to be updated */

Gets the options for the Protractor object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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.
 | 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".
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.

See Also

Functions: | LAnnProtractor::SetProtractorOptions, LAnnProtractor::GetAngle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnProtractor::GetDistance.


LAnnProtractor::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnProtractor *LProtractor)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LProtractor->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LProtractor->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnProtractor::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnProtractor * LProtractor)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LProtractor->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LProtractor->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnProtractor::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnProtractor::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLProtractor -- Pointer to LAnnProtractor annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnProtractor *pLProtractor)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLProtractor->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnProtractor::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnProtractor::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnProtractor::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnProtractor::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnProtractor::PushFixedState / LAnnProtractor::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnProtractor::PushFixedState and LAnnProtractor::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnProtractor::PushFixedState (); | Fixed state is temporarily disabled
LAnnProtractor::PushFixedState (); | Fixed state is temporarily disabled
LAnnProtractor::PopFixedState (); | Fixed state is still disabled
LAnnProtractor::PopFixedState (); | Fixed state is enabled

Note that LAnnProtractor::PushFixedState and LAnnProtractor::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnProtractor::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnProtractor *pLProtractor)
{
pLProtractor->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnProtractor::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnProtractor::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnProtractor::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnProtractor::PushFixedState / LAnnProtractor::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnProtractor::PushFixedState and LAnnProtractor::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnProtractor::PushFixedState (); | Fixed state is temporarily disabled
LAnnProtractor::PushFixedState (); | Fixed state is temporarily disabled
LAnnProtractor::PopFixedState (); | Fixed state is still disabled
LAnnProtractor::PopFixedState (); | Fixed state is enabled

Note that LAnnProtractor::PushFixedState and LAnnProtractor::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnProtractor *pLProtractor)
{
pLProtractor->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnProtractor::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnProtractor *pLProtractor)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLProtractor->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLProtractor->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnProtractor::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::SetPoints(pPoints, uCount=3)

pANNPOINT pPoints; | /* pointer to an array */
L_UINT uCount; | /* number of points in the array */

Defines the vertices of the protractor object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the vertices 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.

When setting the points of a protractor in the array, the vertices must be given in a specific order. The order of the vertices in the array is shown below:

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnProtractor::GetDistance.


LAnnProtractor::SetProtractorOptions

#include "ltwrappr.h"

virtual L_INT LAnnProtractor::SetProtractorOptions(bAcute=TRUE, uUnit=ANNANGLE_DEGREES, pszAbbrev=NULL, uPrecision=2, dArcRadius=30, uFlags=0)

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 after the decimal */
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
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. ( "." )
dArcRadius | The arc radius.
uFlags | Flags that determine which objects to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | LAnnProtractor::GetProtractorOptions, LAnnProtractor::GetAngle
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features

Example

For an example, refer to LAnnProtractor::GetDistance.


LAnnPushPin::LAnnPushPin

#include "ltwrappr.h"

L_VOID LAnnPushPin::LAnnPushPin(bCreate=TRUE)

L_VOID LAnnPushPin::LAnnPushPin(hPushPin)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hPushPin; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnPushPin object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hPushPin | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnPushPin::LAnnPushPin(bCreate) is a constructor for the LAnnPushPin class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnPushPin::LAnnPushPin(hPushPin) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_PUSHPIN. The passed annotation object is invalidated.

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:

LAnnPushPin::~LAnnPushPin, Class Members

Example

This is an example for LAnnPushPin::LAnnPushPin(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnPushPin LeadAPushPin(TRUE) ;

//...
}

This is an example for LAnnPushPin::LAnnPushPin(hPushPin):

L_VOID TestConstructor (HANNOBJECT& hPushPin)
{
// this will call the constructor and destructor when it is out of scope
LAnnPushPin LeadAPushPin(hPushPin) ;

//...
}


LAnnPushPin::~LAnnPushPin

#include "ltwrappr.h"

virtual L_VOID LAnnPushPin::~LAnnPushPin(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnPushPin class.

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:

Class Members

Example

For an example, refer to LAnnPushPin::LAnnPushPin.


LAnnPushPin::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnPushPin::AddUserHandle, LAnnPushPin::EnumerateHandles, LAnnPushPin::EnumHandleCallBack, LAnnPushPin::GetUserHandle, LAnnPushPin::GetUserHandles, LAnnPushPin::ChangeUserHandle, LAnnPushPin::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a PushPin
L_VOID ExampleAnnAddUserHandle(LAnnPushPin *pLPushPin)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLPushPin->GetType();
if (uType == ANNOBJECT_PUSHPIN)
{
pLPushPin->GetRect(&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;
pLPushPin->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLPushPin->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a PushPin"), TEXT("Error"), MB_OK);
}


LAnnPushPin::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnPushPin::AddUserHandle and LAnnPushPin::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPushPin *LPushPin)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPushPin->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPushPin->GetUserHandle(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;
LPushPin->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPushPin::Create

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::Create(L_VOID)

Creates a PushPin annotation object. 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 use the LAnnPushPin::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnPushPin LeadPushPin(FALSE); //construct an annotation note object

if (LeadPushPin.Create()==SUCCESS)
{
//... do something here
}
}


LAnnPushPin::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnPushPin *LPushPin)
{
L_UINT uCount;

// Get the total count of user handles
LPushPin->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LPushPin->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPushPin::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::EnumerateHandles()

Calls the LAnnPushPin::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnPushPin::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnPushPin: public LAnnPushPin
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnPushPin::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnPushPin *LPushPin)
{
LPushPin->EnableCallBack(TRUE);
LPushPin->EnumerateHandles();
}


LAnnPushPin::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnPushPin::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnPushPin::EnumerateHandles 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 LAnnPushPin::ChangeUserHandle.

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.

To enable the LAnnPushPin::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnPushPin::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnPushPin::EnumerateHandles.


LAnnPushPin::GetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetBitmap(pLBitmap)

virtual L_INT LAnnPushPin::GetBitmap(pBitmap)

LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* address of the variable to be updated */

Gets the bitmap handle for the primary bitmap of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pLBitmap | Pointer to an LBitmapBase object to be updated with the handle to the annotation object's primary bitmap.
pBitmap | Address of the variable to be updated with the handle to the annotation object's primary bitmap.

Returns

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

Comments

Before calling LAnnPushPin::GetBitmap(pLBitmap), where pLBitmap is of type LBitmapBase L_FAR, you must declare an LBitmapBase object. Then, pass the address of the object in the pLBitmap parameter. This function will update the object with the handle to the annotation object's primary bitmap.

Before calling LAnnPushPin::GetBitmap(pBitmap), where pBitmap is of type pBITMAPHANDLE, 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 primary bitmap.

A pushpin object has a primary bitmap, (manipulated using LAnnPushPin::SetBitmap/LAnnPushPin::GetBitmap) when the text is shown, and a secondary bitmap, manipulated using LAnnPushPin::SetSecondaryBitmap/LAnnPushPin::GetSecondaryBitmap. 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.

See Also

Functions: | LAnnPushPin::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example for both forms of LAnnPushPin::GetBitmap(pBitmap:

//***IMPORTANT: In the OnPaint(), add the following code:
// RECT rect;
// m_AnnContainer.GetBoundingRect(&rect) ;
// HDC hdc = ::GetDC(m_hWnd);
// m_AnnContainer.Draw(hdc,&rect);
// ::ReleaseDC(m_hWnd, hdc);

void CVCAnnotation11Dlg::OnButtonGetPrimarySecondary()
{
LBitmap MyBitmap;
ANNRECT annRect;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPushPin *pMyAnnPushPin = new(LAnnPushPin);

annRect.left = 50;
annRect.top = 50;
annRect.right = 170;
annRect.bottom = 170;
pMyAnnPushPin->SetRect(&annRect);

//Set pushpin properties
pMyAnnPushPin->SetVisible(TRUE);

//Flip the primary bitmap
LBitmapBase *pBitmapBasePrimary = new(LBitmapBase);
pMyAnnPushPin->GetBitmap(pBitmapBasePrimary);
//or
//BITMAPHANDLE LeadBitmap;
//pMyAnnPushPin->GetBitmap(&LeadBitmap);
pBitmapBasePrimary->Flip();

//Flip the secondary bitmap
LBitmapBase *pBitmapBaseSecondary = new(LBitmapBase);
pMyAnnPushPin->GetSecondaryBitmap(pBitmapBaseSecondary, sizeof(BITMAPHANDLE));
//or
//BITMAPHANDLE LeadBitmap;
//pMyAnnPushPin->GetSecondaryBitmap(&LeadBitmap, sizeof(BITMAPHANDLE));

pBitmapBaseSecondary->Flip();

//Create container and insert annotation
//LAnnContainer m_AnnContainer is a member varible
m_AnnContainer.Create(m_hWnd, &annRect, TRUE);
m_AnnContainer.Insert(*pMyAnnPushPin);
m_AnnContainer.SetUserMode(ANNUSER_RUN);

//member variable L_BOOL m_bPrimary
if (m_bPrimary)
pMyAnnPushPin->SetActiveState(ANNACTIVE_ENABLED);
else
pMyAnnPushPin->SetActiveState(ANNACTIVE_DISABLED);

}

void CVCAnnotation11Dlg::OnButtonBrimary()
{
m_bPrimary = !m_bPrimary;
}


LAnnPushPin::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetFixed(pbFixed)

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

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: | Class Members, LAnnPushPin::SetFixed, LAnnPushPin::PushFixedState, LAnnPushPin::PopFixedState, LAnnPushPin::GetFixed, LAnnPushPin::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnPushPin::SetFixed.


LAnnPushPin::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples displays the rotation angle of the PushPin annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnPushPin * pLPushPin)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLPushPin->GetRotateAngle(&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);
}
}


LAnnPushPin::GetSecondaryBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetSecondaryBitmap(pLBitmap, uStructSize)

virtual L_INT LAnnPushPin::GetSecondaryBitmap(pBitmap, uStructSize)

LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* address of the variable to be updated */
L_UINT uStructSize; | /* size of the structure */

Gets the bitmap handle for the secondary bitmap of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pLBitmap | Pointer to an LBitmapBase object to be updated with the handle to the annotation object's secondary bitmap.
pBitmap | Address of the variable to be updated with the handle to the annotation object's 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

Before calling LAnnPushPin::GetSecondaryBitmap(pLBitmap), where pLBitmap is of type LBitmapBase L_FAR, you must declare an LBitmapBase object. Then, pass the address of the object in the pLBitmap parameter. This function will update the object with the handle to the annotation object's secondary bitmap.

Before calling LAnnPushPin::GetBitmap(pBitmap), where pBitmap is of type pBITMAPHANDLE, 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 secondary bitmap.

A pushpin object has a primary bitmap, (manipulated using LAnnPushPin::SetBitmap/LAnnPushPin::GetBitmap) when the text is shown, and a secondary bitmap, manipulated using LAnnPushPin::SetSecondaryBitmap/LAnnPushPin::GetSecondaryBitmap. 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.

See Also

Functions: | LAnnPushPin::SetSecondaryBitmap, LAnnPushPin::GetBitmap, LAnnPushPin::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

For an example of both forms of LAnnPushPin::GetSecondaryBitmap(pBitmap), refer to LAnnPushPin::GetBitmap.


LAnnPushPin::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPushPin *LPushPin)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LPushPin->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LPushPin->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnPushPin::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

Libraries

win32

ltkrn14n.dll (ltkrn_n.lib import library)
ltann14n.dll (ltann_n.lib import library)

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnPushPin * LPushPin)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LPushPin->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LPushPin->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnPushPin::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnPushPin::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLPushPin -- Pointer to LAnnPushPin annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnPushPin *pLPushPin)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLPushPin->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnPushPin::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnPushPin::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPushPin::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPushPin::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPushPin::PushFixedState / LAnnPushPin::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPushPin::PushFixedState and LAnnPushPin::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPushPin::PushFixedState (); | Fixed state is temporarily disabled
LAnnPushPin::PushFixedState (); | Fixed state is temporarily disabled
LAnnPushPin::PopFixedState (); | Fixed state is still disabled
LAnnPushPin::PopFixedState (); | Fixed state is enabled

Note that LAnnPushPin::PushFixedState and LAnnPushPin::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnPushPin::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnPushPin *pLPushPin)
{
pLPushPin->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPushPin::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnPushPin::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnPushPin::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnPushPin::PushFixedState / LAnnPushPin::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnPushPin::PushFixedState and LAnnPushPin::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnPushPin::PushFixedState (); | Fixed state is temporarily disabled
LAnnPushPin::PushFixedState (); | Fixed state is temporarily disabled
LAnnPushPin::PopFixedState (); | Fixed state is still disabled
LAnnPushPin::PopFixedState (); | Fixed state is enabled

Note that LAnnPushPin::PushFixedState and LAnnPushPin::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnPushPin *pLPushPin)
{
pLPushPin->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnPushPin::SetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::SetBitmap(pBitmap, uFlags=0)

virtual L_INT LAnnPushPin::SetBitmap(pBitmap, uFlags=0)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the bitmap of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap object referencing the bitmap object to assign to the specified 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
ANNFLAG_NOINVALIDATE | [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Comments

A pushpin object has a primary bitmap, (manipulated using LAnnPushPin::SetBitmap/LAnnPushPin::GetBitmap) when the text is shown, and a secondary bitmap, manipulated using LAnnPushPin::SetSecondaryBitmap/LAnnPushPin::GetSecondaryBitmap. 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.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example for both forms of LAnnPushPin::SetBitmap(pBitmap, uFlags=0):

//This example sets the primary and secondary images of a pushpin
//The pushpin is displayed. The image (primary or secondary) displayed
//depends on the state of the boolean 'm_bPrimary'
//***IMPORTANT: In the OnPaint(), add the following code:
// RECT rect;
// m_AnnContainer.GetBoundingRect(&rect) ;
// HDC hdc = ::GetDC(m_hWnd);
// m_AnnContainer.Draw(hdc,&rect);
// ::ReleaseDC(m_hWnd, hdc);
void CVCAnnotation11Dlg::OnButtonPushPin()
{
LBitmap MyBitmap;
ANNRECT annRect;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnPushPin *pMyAnnPushPin = new (LAnnPushPin);

annRect.left = 50;
annRect.top = 50;
annRect.right = 170;
annRect.bottom = 170;
pMyAnnPushPin->SetRect(&annRect);
pMyAnnPushPin->SetVisible(TRUE);

//Set pushpin properties
LBitmapBase MyBitmapBasePrimary;
MyBitmapBasePrimary.Load(TEXT("d:\\work\\images\\tiny1.cmp"));
pMyAnnPushPin->SetBitmap(&MyBitmapBasePrimary,0);
//or
//pMyAnnPushPin->SetBitmap(MyBitmapBasePrimary.GetHandle(),0);

LBitmapBase MyBitmapBaseSecondary;
MyBitmapBaseSecondary.Load(TEXT("d:\\work\\images\\tiny2.cmp"));
pMyAnnPushPin->SetSecondaryBitmap(&MyBitmapBaseSecondary,0);
//or
//pMyAnnPushPin->SetSecondaryBitmap (MyBitmapBaseSecondary.GetHandle(),0);

//Create container and insert annotation
//LAnnContainer m_AnnContainer
m_AnnContainer.Create(m_hWnd, &annRect, TRUE);
m_AnnContainer.Insert(*pMyAnnPushPin);
m_AnnContainer.SetUserMode(ANNUSER_RUN);

//member variable L_BOOL m_bPrimary
if (m_bPrimary)
//Draw pushpin with primary bitmap
pMyAnnPushPin->SetActiveState(ANNACTIVE_ENABLED);

else
//Draw pushpin with secondary bitmap
pMyAnnPushPin->SetActiveState (ANNACTIVE_DISABLED);
}


LAnnPushPin::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnPushPin *pLPushPin)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLPushPin->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLPushPin->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnPushPin::SetSecondaryBitmap

#include "ltwrappr.h"

virtual L_INT LAnnPushPin::SetSecondaryBitmap(pBitmap, uFlags=0)

virtual L_INT LAnnPushPin::SetSecondaryBitmap(pBitmap, uFlags=0)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the secondary bitmap of the pushpin object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap object referencing the secondary bitmap object to assign to the specified object.
pBitmap | Pointer to the bitmap handle referencing the secondary 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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.

Comments

A pushpin object has a primary bitmap, (manipulated using LAnnPushPin::SetBitmap/LAnnPushPin::GetBitmap) when the text is shown, and a secondary bitmap, manipulated using LAnnPushPin::SetSecondaryBitmap/LAnnPushPin::GetSecondaryBitmap. 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.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

For an example of both forms of LAnnPushPin::SetSecondaryBitmap(pBitmap, uFlags=0), refer to LAnnPushPin::SetBitmap.


LAnnRectangle::LAnnRectangle

#include "ltwrappr.h"

L_VOID LAnnRectangle::LAnnRectangle(bCreate=TRUE)

L_VOID LAnnRectangle::LAnnRectangle(hRectangle)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hRectangle; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnRectangleobject. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hRectangle | Handle of the associated annotation object.

Returns

None

Comments

LAnnRectangle::LAnnRectangle(bCreate) is a constructor for the LAnnRectangle class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnRectangle::LAnnRectangle(hRectangle) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_RECT. The passed annotation object is invalidated.

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:

LAnnRectangle::LAnnRectangle, Class Members

Example

This is an example for LAnnRectangle::LAnnRectangle(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnRectangle LeadARect((L_BOOL)FALSE) ;

//...
}

This is an example for LAnnRectangle::LAnnRectangle(hRectangle):

L_VOID TestConstructor (HANNOBJECT& hRect)
{
// this will call the constructor and destructor when it is out of scope
LAnnRectangle LeadARect(hRect) ;

//...
}


LAnnRectangle::~LAnnRectangle

#include "ltwrappr.h"

virtual L_VOID LAnnRectangle::~LAnnRectangle(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnRectangle class.

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:

Class Members

Example

For an example, refer to LAnnRectangle::LAnnRectangle.


LAnnRectangle::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

// This example adds user handles to the center of the top and bottom of a Rectangle object
L_VOID ExampleAnnAddUserHandle(LAnnRectangle *pLRectangle)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLRectangle->GetType();
if (uType == ANNOBJECT_RECT)
{
pLRectangle->GetRect(&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;
pLRectangle->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLRectangle->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Rectangle object."), TEXT("Error"), MB_OK);
}


LAnnRectangle::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnRectangle::AddUserHandle and LAnnRectangle::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnRectangle *LRectangle)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRectangle->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRectangle->GetUserHandle(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;
LRectangle->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRectangle::Create

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::Create(L_VOID)

Creates a Rectangle annotation object. 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 use the LAnnRectangle::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnRectangle LeadRect(FALSE); //construct an rectangle object

if (LeadRect.Create()==SUCCESS)
{
//... do something here
}
}


LAnnRectangle::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnRectangle *LRectangle)
{
L_UINT uCount;

// Get the total count of user handles
LRectangle->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LRectangle->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRectangle::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::EnumerateHandles()

Calls the LAnnRectangle::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnRectangle::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnRectangle: public LAnnRectangle
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnRectangle::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnRectangle *LRectangle)
{
LRectangle->EnableCallBack(TRUE);
LRectangle->EnumerateHandles();
}


LAnnRectangle::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnRectangle::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnRectangle::EnumerateHandles 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 LAnnRectangle::ChangeUserHandle.

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.

To enable the LAnnRectangle::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnRectangle::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnRectangle::EnumerateHandles.


LAnnRectangle::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnRectangle::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn (LAnnRectangle L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnRectangle::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnRectangle::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

ANNMODE_TRANSPARENT [0]

ANNMODE_TRANSLUCENT [1]

ANNMODE_OPAQUE [2]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnRectangle L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */

/* Set the fill mode to transparent, unless it already is */
FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT, 0);
}


LAnnRectangle::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnRectangle::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible values are:

ANNPATTERN_SOLID [0]

ANNPATTERN_BDIAGONAL [1]

ANNPATTERN_CROSS [2]

ANNPATTERN_DIAGCROSS [3]

ANNPATTERN_FDIAGONAL [4]

ANNPATTERN_HORIZONTAL [5]

ANNPATTERN_VERTICAL [6]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRectangle L_FAR * pAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */

/* Set the fill pattern to solid, unless it already is */
FillPattern = pAnnObject->GetFillPattern();
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID, 0);
}


LAnnRectangle::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::GetFixed(pbFixed)

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

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: | Class Members, LAnnRectangle::SetFixed, LAnnRectangle::PushFixedState, LAnnRectangle::PopFixedState, LAnnRectangle::GetFixed, LAnnRectangle::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnRectangle::SetFixed.


LAnnRectangle::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnRectangle::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn(LAnnRectangle L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnRectangle::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnRectangle::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRectangle L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnRectangle::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnRectangle::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRectangle L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnRectangle::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Implementing Custom Annotations

Example

// This examples displays the rotation angle of the Rectangle annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnRectangle * pLRectangle)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLRectangle->GetRotateAngle(&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);
}
}


LAnnRectangle::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRectangle *LRectangle)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRectangle->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRectangle->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRectangle::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRectangle * LRectangle)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LRectangle->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LRectangle->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnRectangle::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnRectangle::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLRectangle -- Pointer to LAnnRectangle annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnRectangle *pLRectangle)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLRectangle->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnRectangle::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnRectangle::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnRectangle::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRectangle::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRectangle::PushFixedState / LAnnRectangle::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRectangle::PushFixedState and LAnnRectangle::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRectangle::PushFixedState (); | Fixed state is temporarily disabled
LAnnRectangle::PushFixedState (); | Fixed state is temporarily disabled
LAnnRectangle::PopFixedState (); | Fixed state is still disabled
LAnnRectangle::PopFixedState (); | Fixed state is enabled

Note that LAnnRectangle::PushFixedState and LAnnRectangle::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnRectangle::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnRectangle *pLRectangle)
{
pLRectangle->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRectangle::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnRectangle::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRectangle::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRectangle::PushFixedState / LAnnRectangle::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRectangle::PushFixedState and LAnnRectangle::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRectangle::PushFixedState (); | Fixed state is temporarily disabled
LAnnRectangle::PushFixedState (); | Fixed state is temporarily disabled
LAnnRectangle::PopFixedState (); | Fixed state is still disabled
LAnnRectangle::PopFixedState (); | Fixed state is enabled

Note that LAnnRectangle::PushFixedState and LAnnRectangle::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnRectangle *pLRectangle)
{
pLRectangle->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRectangle::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnRectangle::GetFillMode.


LAnnRectangle::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* the object's fill mode */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillMode | The constant that specifies the object's fill mode. The following are the possible values of the fill mode:
 | ANNMODE_TRANSPARENT [0]
 | ANNMODE_TRANSLUCENT [1]
 | ANNMODE_OPAQUE [2]
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRectangle::GetFillMode.


LAnnRectangle::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetFillPattern(uFillPattern=ANNPATTERN_SOLID, uFlags=0)

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillPattern | The constant that specifies the fill pattern. The following are the possible values of the fill pattern:
 | ANNPATTERN_SOLID [0]
 | ANNPATTERN_BDIAGONAL [1]
 | ANNPATTERN_CROSS [2]
 | ANNPATTERN_DIAGCROSS [3]
 | ANNPATTERN_FDIAGONAL [4]
 | ANNPATTERN_HORIZONTAL [5]
 | ANNPATTERN_VERTICAL [6]
 | To see the possible fill modes and patterns, refer to Illustration of Fill Options for Annotations.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRectangle::GetFillPattern.


LAnnRectangle::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnRectangle *pLRectangle)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLRectangle->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLRectangle->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnRectangle::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnRectangle::GetForeColor.


LAnnRectangle::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRectangle::GetLineStyle.


LAnnRectangle::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of the object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected() and LAnnotation::SetSelected() functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRectangle::GetLineWidth.


LAnnRTF::LAnnRTF

#include "ltwrappr.h"

L_VOID LAnnRTF::LAnnRTF(bCreate=TRUE)

L_VOID LAnnRTF::LAnnRTF(hRTF)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hRTF; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnRTF object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRTF | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnRTF::LAnnRTF(bCreate) is a constructor for the LAnnRTF class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnRTF::LAnnRTF(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnRTF. The passed annotation object is invalidated.

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:

LAnnRTF::~LAnnRTF, Class Members

Example

This is an example for LAnnRTF::LAnnRTF(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnRTF LeadARTF(TRUE) ;

//...
}

This is an example for LAnnRTF::LAnnRTF(hRTF):

L_VOID TestConstructor (HANNOBJECT& hRTF)
{
// this will call the constructor and destructor when it is out of scope
LAnnRTF LeadAFTR(hRTF) ;

//...
}


LAnnRTF::~LAnnRTF

#include "ltwrappr.h"

virtual L_VOID LAnnRTF::~LAnnRTF(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnRTF class.

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:

Class Members

Example

For an example, refer to LAnnRTF::LAnnRTF.


LAnnRTF::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRTF::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnRTF::AddUserHandle, LAnnRTF::EnumerateHandles, LAnnRTF::EnumHandleCallBack, LAnnRTF::GetUserHandle, LAnnRTF::GetUserHandles, LAnnRTF::ChangeUserHandle, LAnnRTF::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a RTF object

L_VOID ExampleAnnAddUserHandle(LAnnRTF *LRtf)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = LRtf->GetType();
if (uType == ANNOBJECT_RTF)
{
LRtf->GetRect(&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;
LRtf->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
LRtf->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a RTF object."), TEXT("Error"), MB_OK);
}


LAnnRTF::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRTF::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnRTF::AddUserHandle and LAnnRTF::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnRTF *LRtf)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRtf->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRtf->GetUserHandle(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;
LRtf->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRTF::Create

#include "ltwrappr.h"

virtual L_INT LAnnRTF::Create(L_VOID)

Creates a RTF annotation object. 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 use the LAnnRTF::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnRTF LeadRTF(FALSE); //construct an annotation note object

if (LeadRTF.Create()==SUCCESS)
{
//... do something here
}
}


LAnnRTF::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRTF::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnRTF *LRtf)
{
L_UINT uCount;

// Get the total count of user handles
LRtf->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LRtf->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRTF::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnRTF::EnumerateHandles()

Calls the LAnnRTF::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnRTF::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnRTF: public LAnnRTF
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnRTF::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnRTF *LRtf)
{
LRtf->EnableCallBack(TRUE);
LRtf->EnumerateHandles();
}


LAnnRTF::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnRTF::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnRTF::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnRTF::EnumerateHandles 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 LAnnRTF::ChangeUserHandle.

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.

To enable the LAnnRTF::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnRTF::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnRTF::EnumerateHandles.


LAnnRTF::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRTF::GetFixed(pbFixed)

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

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: | Class Members, LAnnRTF::SetFixed, LAnnRTF::PushFixedState, LAnnRTF::PopFixedState, LAnnRTF::GetFixed, LAnnRTF::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnRTF::SetFixed.


LAnnRTF::GetText

#include "ltwrappr.h"

virtual L_INT LAnnRTF::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

GetText can be used to retreive text that was set using LAnnRTF::SetTextRTF, but no formatting information will be preserved. To retrieve the text with formatting, use LAnnRTF::GetTextRTF.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnRTF L_FAR * pAnnObject)
{
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 */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new text */
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 */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current text */
lstrcat(pText,TEXT(" - New"));
pAnnObject->SetText(pText, 0);

/* Free memory that we no longer need */
GlobalFree(hText);
}


LAnnRTF::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnRTF::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the annotation object's character string.

Comments

Use this value to allocate a buffer to read the text property.

To get the length of Rich Text formatted text, use LAnnRTF::GetTextRTF.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRTF::GetText.


LAnnRTF::GetTextRTF

#include "ltwrappr.h"

virtual L_INT LAnnRTF::GetTextRTF(uFormat, pText, puLen)

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 annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

Comments

This function is used to retrieve the text from an ANNOBJECT_RTF 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:

LAnnRTF lRTF; // assume this is a valid ANNOBJECT_RTF object
L_UINT uLength;
L_TCHAR *pText;

// Get the length
lRTF .GetTextRTF(RTFFORMAT_RTF, NULL, &uLength);

// Allocate a buffer
pText = (L_TCHAR *)malloc((uLength+1) * sizeof(L_TCHAR));

// Retrieve the text
lRTF .GetTextRTF(RTFFORMAT_RTF, pText, &uLength);

To get or set the text of other text objects, see the documentation for LAnnRTF::GetTextLen, LAnnRTF::GetText, and LAnnRTF::SetText.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This sample gets the text from Rich Text annotation object in one of two formats (text, or rich text)
// plRTF: the Rich Text annotation object
// uFormat: the format of the retrieved text--one of
// RTFFORMAT_TEXT
// RTFFORMAT_RTF
L_VOID SampleAnnGetTextRTF(LAnnRTF *plRTF, 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 = plRTF->GetTextRTF( uFormat, NULL, &uLength);
if (nRet != SUCCESS)
return;

pText = (L_TCHAR *)malloc((uLength+1) * sizeof(L_TCHAR));
nRet = plRTF->GetTextRTF( uFormat, pText, &uLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Format: %s\nLength: %d"), pszFormat, uLength);
MessageBox(NULL, pText, szMsg, MB_OK);
}

free(pText);
}


LAnnRTF::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRTF::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRTF *LRtf)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRtf->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRtf->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRTF::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnRTF::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRTF * LRtf)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LRtf->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LRtf->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnRTF::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnRTF::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnRTF::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. For more information, refer to FixedAnnotations.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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
// pLRTF -- Pointer to LAnnRTF annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnRTF *pLRTF)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLRTF->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnRTF::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRTF::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnRTF::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. For more information, refer to Fixed Annotations.

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 LAnnRTF::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRTF::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRTF::PushFixedState / LAnnRTF::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRTF::PushFixedState and LAnnRTF::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRTF::PushFixedState (); | Fixed state is temporarily disabled
LAnnRTF::PushFixedState (); | Fixed state is temporarily disabled
LAnnRTF::PopFixedState (); | Fixed state is still disabled
LAnnRTF::PopFixedState (); | Fixed state is enabled

Note that LAnnRTF::PushFixedState and LAnnRTF::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the "fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnRTF::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnRTF *pLRTF)
{
pLRTF->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRTF::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRTF::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnRTF::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRTF::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRTF::PushFixedState / LAnnRTF::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRTF::PushFixedState and LAnnRTF::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRTF::PushFixedState (); | Fixed state is temporarily disabled
LAnnRTF::PushFixedState (); | Fixed state is temporarily disabled
LAnnRTF::PopFixedState (); | Fixed state is still disabled
LAnnRTF::PopFixedState (); | Fixed state is enabled

Note that LAnnRTF::PushFixedState and LAnnRTF::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnRTF *pLRTF)
{
pLRTF->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRTF::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRTF::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnRTF *pLRTF)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLRTF->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLRTF->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnRTF::SetText

#include "ltwrappr.h"

virtual L_INT LAnnRTF::SetText(pText, uFlags=0)

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 the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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 can be used to load unformatted text. Use LAnnRTF::SetTextRTF to load rich text or unformatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRTF::GetText.


LAnnRTF::SetTextRTF

#include "ltwrappr.h"

virtual L_INT LAnnRTF::SetTextRTF(uFormat, pText, uFlags)

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_RTF object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client are

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.

To get or set the text of other text objects, see the documentation for LAnnRTF::GetTextLen, LAnnRTF::GetText, and LAnnRTF::SetText.

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: | Class Members, LAnnRTF::GetTextLen, LAnnRTF::GetText, LAnnRTF::SetText, LAnnRTF::SetText, LAnnRTF::SetText
Topics: | Annotation Objects - Automated Features
 | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations

Example

// This sample loads a rich text annotation object with text
// It illustrates how SetTextRTF() 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(LAnnRTF *plRTF, L_UINT uFormat)
{
L_TCHAR *pszFormat;
L_TCHAR szMsg[200];
L_INT nRet;

switch(uFormat)
{
case RTFFORMAT_TEXT:
pszFormat = TEXT("RTFFORMAT_TEXT");
nRet = plRTF->SetTextRTF(uFormat, RICH_STRING, 0);
break;

case RTFFORMAT_RTF:
pszFormat = TEXT("RTFFORMAT_RTF");
nRet = plRTF->SetTextRTF(uFormat, RICH_STRING, 0);
break;

default:
return;
break;
}

wsprintf(szMsg, TEXT("SetTextRTF returned %d\nFormat: %s"), nRet, pszFormat);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}


LAnnRedact::LAnnRedact

#include "ltwrappr.h"

L_VOID LAnnRedact::LAnnRedact(bCreate=TRUE)

L_VOID LAnnRedact::LAnnRedact(hRedact)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hRedact; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnRedact object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hRedact | Handle of the associated annotation object.

Returns

None

Comments

LAnnRedact::LAnnRedact(bCreate) is a constructor for the LAnnFreehand class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnRedact::LAnnRedact(hRedact) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_REDACT. The passed annotation object is invalidated.

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:

Class Members

Example

This is an example for LAnnRedact::LAnnRedact(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnRedact LeadARedact(TRUE) ;

//...
}

This is an example for LAnnRedact::LAnnRedact(hRedact):

L_VOID TestConstructor (HANNOBJECT& hRedact)
{
// this will call the constructor and destructor when it is out of scope
LAnnRedact LeadARedact(hRedact) ;

//...
}


LAnnRedact::~LAnnRedact

#include "ltwrappr.h"

virtual L_VOID LAnnRedact::~LAnnRedact(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnRedact class.

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:

LAnnRedact::LAnnRedact, Class Members

Example

For an example, refr to LAnnRedact::LAnnRedact.


LAnnRedact::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRedact::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnRedact::AddUserHandle, LAnnRedact::EnumerateHandles, LAnnRedact::EnumHandleCallBack, LAnnRedact::GetUserHandle, LAnnRedact::GetUserHandles, LAnnRedact::ChangeUserHandle, LAnnRedact::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a Redact object
L_VOID ExampleAnnAddUserHandle(LAnnRedact *pLRedact)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLRedact->GetType();
if (uType == ANNOBJECT_REDACT)
{
pLRedact->GetRect(&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;
pLRedact->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLRedact->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Redact object."), TEXT("Error"), MB_OK);
}


LAnnRedact::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRedact::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnRedact::AddUserHandle and LAnnRedact::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnRedact *LRedact)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRedact->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRedact->GetUserHandle(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;
LRedact->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRedact::Create

#include "ltwrappr.h"

virtual L_INT LAnnRedact::Create(L_VOID)

Creates a Redact annotation object. 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 use the LAnnRedact::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnRedact LeadRedact(FALSE); //construct an annotation redact object

if (LeadRedact.Create()==SUCCESS)
{
//... do something here
}
}


LAnnRedact::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRedact::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnRedact *LRedact)
{
L_UINT uCount;

// Get the total count of user handles
LRedact->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LRedact->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRedact::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnRedact::EnumerateHandles()

Calls the LAnnRedact::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnRedact::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnRedact: public LAnnRedact
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnRedact::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnRedact *LRedact)
{
LRedact->EnableCallBack(TRUE);
LRedact->EnumerateHandles();
}


LAnnRedact::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnRedact::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnRedact::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnRedact::EnumerateHandles 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 LAnnRedact::ChangeUserHandle.

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.

To enable the LAnnRedact::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnRedact::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnRedact::EnumerateHandles.


LAnnRedact::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnRedact::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

/* This example gets and updates the property of the object passed by the caller */
L_VOID TestModifyAnn(LAnnRedact L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnRedact::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnRedact::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples displays the rotation angle of the Redact annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnRedact * pLRedact)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLRedact->GetRotateAngle(&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);
}
}


LAnnRedact::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRedact::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRedact *LRedact)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRedact->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRedact->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRedact::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnRedact::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRedact * LRedact)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LRedact->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LRedact->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnRedact::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnRedact::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crBack | The COLORREF value that specifies the background color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnRedact::GetBackColor.


LAnnRedact::Unrealize

#include "ltwrappr.h"

virtual L_INT LAnnRedact::Unrealize(pBitmap, prcBounds)

virtual L_INT LAnnRedact::Unrealize(pBitmap, prcBounds)

LBitmapBase L_FAR * pBitmap; | /* pointer to the LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LPRECT prcBounds; | /* pointer to the Windows RECT structure */

Restores Redact annotation objects that have a bitmap saved inside them. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap object referencing the bitmap to update.
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.

Returns

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

Comments

Restores the background of a 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 LAnnContainer::Realize 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 LAnnContainer::Unrealize. LAnnContainer::Unrealize 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. bSelected indicates whether all the Redact objects included in the container should be restored, or if only selected objects should be restored. 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.

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: | Class Members
Topics: | Annotation FunctionsRealizing to a Bitmap
 | Displaying and Manipulating Annotation Objects

Example

This is an example for LAnnRedact::Unrealize(pBitmap, prcBounds):

L_VOID TestUnRealize(pBITMAPHANDLE pLeadBitmap,LAnnRedact L_FAR * pLeadRedact)
{
// unrealize all of the redact objects
if(pLeadRedact->Unrealize(pLeadBitmap, NULL) == ERROR_ANN_LOCKED)
MessageBox(NULL, TEXT("Some redact objects are locked and cannot be restored"), TEXT("Warning"), MB_OK);
}

This is an example for LAnnRedact::Unrealize(pBitmap, prcBounds):

L_VOID TestUnRealize (LBitmapBase L_FAR * pLeadBitmap,LAnnRedact L_FAR * pLeadRedact)
{
// unrealize all of the redact objects
if(pLeadRedact->Unrealize(pLeadBitmap, NULL) == ERROR_ANN_LOCKED)
MessageBox(NULL, TEXT("Some redact objects are locked and cannot be restored"), TEXT("Warning"), MB_OK);
}


LAnnRuler::LAnnRuler

#include "ltwrappr.h"

L_VOID LAnnRuler::LAnnRuler(bCreate=TRUE)

L_VOID LAnnRuler::LAnnRuler(hRuler)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hRuler; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnRuler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hRuler | Handle of the associated annotation object.

Returns

None

Comments

LAnnRuler::LAnnRuler(bCreate) is a constructor for the LAnnRuler class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnRuler::LAnnRuler(hRuler) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_RULER. The passed annotation object is invalidated.

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:

LAnnRuler::~LAnnRuler, Class Members

Example

This is an example for LAnnRuler::LAnnRuler(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnRuler LeadARuler(TRUE) ;

//...
}

This is an example for LAnnRuler::LAnnRuler(hRuler):

L_VOID TestConstructor (HANNOBJECT& hRuler)
{
// this will call the constructor and destructor when it is out of scope
LAnnRuler LeadARuler(hRuler) ;

//...
}


LAnnRuler::~LAnnRuler

#include "ltwrappr.h"

virtual L_VOID LAnnRuler::~LAnnRuler(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnRuler class.

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:

Class Members

Example

For an example, refer to LAnnRuler::LAnnRuler.


LAnnRuler::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnRuler::EnumerateHandles, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandle, LAnnRuler::GetUserHandles, LAnnRuler::DeleteUserHandle, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a Ruler object
L_VOID ExampleAnnAddUserHandle(LAnnRuler *pLRuler)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLRuler->GetType();
if (uType == ANNOBJECT_RULER)
{
pLRuler->GetRect(&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;
pLRuler->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLRuler->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Ruler object."), TEXT("Error"), MB_OK);
}


LAnnRuler::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnRuler::AddUserHandle and LAnnRuler::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumerateHandles, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandle, LAnnRuler::DeleteUserHandle, LAnnRuler::GetUserHandles
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// * Displaying the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(LAnnRuler *LRuler)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRuler->GetUserHandle(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;
LRuler->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRuler::Create

#include "ltwrappr.h"

virtual L_INT LAnnRuler::Create(L_VOID)

Creates a Ruler annotation object. 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 use the LAnnRuler::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnRuler LeadRuler(FALSE); //construct an annotation ruler object

if (LeadRuler.Create()==SUCCESS)
{
//... do something here
}
}


LAnnRuler::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumerateHandles, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandle, LAnnRuler::GetUserHandles, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnRuler *LRuler)
{
L_UINT uCount;

// Get the total count of user handles
LRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LRuler->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRuler::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnRuler::EnumerateHandles()

Calls the LAnnRuler::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnRuler::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandle, LAnnRuler::GetUserHandles, LAnnRuler::DeleteUserHandle, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnRuler: public LAnnRuler
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnRuler::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnRuler *LRuler)
{
LRuler->EnableCallBack(TRUE);
LRuler->EnumerateHandles();
}


LAnnRuler::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnRuler::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnRuler::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object.
SUCCESS_NOCHANGE | [2] Do not change the object.

Comments

The LAnnRuler::EnumerateHandles 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 LAnnRuler::ChangeUserHandle.

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.

To enable the LAnnRuler::EnumHandleCallBack
 you must call LBase::EnableCallBack
 before calling LAnnRuler::EnumerateHandles
 function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumerateHandles, LAnnRuler::GetUserHandle, LAnnRuler::GetUserHandles, LAnnRuler::DeleteUserHandle, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnRuler::EnumerateHandles.


LAnnRuler::GetDistance

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetDistance(pdDistance)

L_DOUBLE L_FAR *pdDistance;

/* address of the variable that will be updated with the distance of a ruler object */

Gets the distance of the annotation object in the object's unit of measurement, set by LAnnRuler::SetUnit. This function is available in the Document/Medical Toolkits.

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

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.

See Also

Functions: | Class Members, LAnnAutomation::GetTicMarkLength, LAnnAutomation::SetTicMarkLength
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects

Example

void CVCAnnotation11Dlg::OnButtonRuler()
{
LBitmap MyBitmap;
RECT rect;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnRuler MyAnnRuler;

ANNPOINT MyPts[3] = { 40,40,
140,40,
};
pANNPOINT pMyPts = MyPts;
MyAnnRuler.SetPoints(pMyPts, 2);

L_UINT uShowFlags;
MyAnnRuler.GetShowFlags(&uShowFlags);

MyAnnRuler.SetShowFlags(ANNSHOW_LENGTH,0);

//Set Ruler properties
MyAnnRuler.SetVisible(TRUE);
MyAnnRuler.GetBoundingRect(&rect)
 ;

L_DOUBLE dDist=0;
MyAnnRuler.GetDistance(&dDist);

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnRuler.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnRuler::GetDistance2

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetDistance2(puCount, pDistance, pTotalDistance, uStructSize)

L_UINT puCount; | /* address of variable to be updated */
pANNSMARTDISTANCE pDistance; | /* address of an array of structures */
pANNSMARTDISTANCE pTotalDistance; | /* address of a variable */
L_UINT uStructSize; | /* size of the structure */

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

Returns

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

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;

pRuler->GetDistance2(&uCount,
 NULL, NULL, sizeof(ANNSMARTDISTANCE));
pDistance = (pANNSMARTDISTANCE)malloc(uCount
 * sizeof(ANNSMARTDISTANCE));
pRuler->GetDistance2(&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.

See Also

Functions: | Class Member
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

// This sample calls GetDistance2 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_MILIMETERS");
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);

if (pszSmartDistance)
{
lstrcpy(pszSmartDistance, szMsg);
}

if (puLength)
{
*puLength = uLength;
}
}

L_VOID SampleAnnGetDistance(LAnnRuler * pObject)
{
L_UINT uCount;
L_TCHAR *pszObject;
L_UINT uType;
L_INT nRet;
L_TCHAR szMsg[500];
ANNSMARTDISTANCE sdTotalDistance;
pANNSMARTDISTANCE pDistance = NULL;

uType = pObject->GetType();
pszObject = annGetObjectString(uType);
nRet= pObject->GetDistance2(&uCount,
 NULL, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}
// We know the number of rulers
pDistance = (ANNSMARTDISTANCE * )malloc(uCount * sizeof(ANNSMARTDISTANCE));
if (!pDistance)
MessageBox(NULL, TEXT("Not enough memory"), TEXT("Error"),
 MB_OK);

nRet = pObject->GetDistance2(&uCount,
 pDistance, &sdTotalDistance, sizeof(ANNSMARTDISTANCE));
if (nRet != SUCCESS)
{
wsprintf(szMsg, TEXT("GetDistance2 Failed[%d]: [%d]%10s"),
nRet, uType, pszObject);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
return;
}

free(pDistance);
}


LAnnRuler::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetFixed(pbFixed)

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

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: | Class Members, LAnnRuler::SetFixed, LAnnRuler::PushFixedState, LAnnRuler::PopFixedState, LAnnRuler::GetFixed, LAnnRuler::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnRuler::SetFixed.


LAnnRuler::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* character string to be updated */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | Character string to be updated with the name of the font used by the Ruler object.

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
L_TCHAR L_FAR * pFontName; /* The object's font name */
L_UINT uNameLength;/* Length of the object's font name */
LBuffer LeadBuffer ;

/* Get the length of the current font name */
uNameLength = pAnnObject->GetFontNameLen();

LeadBuffer.Reallocate((DWORD)uNameLength * sizeof(L_TCHAR)) ;

pFontName = (L_TCHAR L_FAR *)LeadBuffer.Lock() ;

/* Get the current font name */
pAnnObject->GetFontName(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
pAnnObject->SetFontName(TEXT("Times New Roman"), 0);

LeadBuffer.Unlock() ;
}


LAnnRuler::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnRuler::GetFontNameLen(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the length of the character string that holds the name of the font used by the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The string length of the ruler 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::GetFontName.


LAnnRuler::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnRuler::GetFontSize(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current unscaled value of the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the ruler object.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
L_DOUBLE FontSize; /* Object font size */

/* Double the font size */
FontSize = pAnnObject->GetFontSize();
pAnnObject->SetFontSize(FontSize * 2, 0);
}


LAnnRuler::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnRuler::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

L_VOID TestModifyAnn(LAnnRuler L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF);
}


LAnnRuler::GetGaugeLength

#include "ltwrappr.h"

virtual L_DOUBLE LAnnRuler::GetGaugeLength(L_VOID)

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.

Returns

The object's gauge length.

Comments

The gauge length applies only to LAnnRuler and Ruler objects. Refer to Annotation LAnnRuler Object.

Length is expressed in pixels, not in points. The length is for the whole line, not just from the end point of the ruler to the end point of the gauge - it is from one end of the gauge to the other end of the gauge.

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: | Class Members, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

L_VOID ModifyAnnGauge(LAnnRuler L_FAR * pAnnObject)
{
L_DOUBLE dLength;

/* if gauge length setting for the Automation object
is larger than 5 pixels, then make it 5 pixels. */
dLength = pAnnObject->GetGaugeLength();
if(dLength > 5.0f)
pAnnObject->SetGaugeLength(
 5.0f, 0);
}


LAnnRuler::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnRuler::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style property. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH);
}


LAnnRuler::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnRuler::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2);
}


LAnnRuler::GetPoints

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetPoints(pPoints)

pANNPOINT pPoints;

/* pointer to an array */

Fills the specified array of ANNPOINT structures with the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array to be filled with the endpoints of the ruler object.

Returns

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

Comments

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.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

void CVCAnnotation11Dlg::OnButton4()
{
LBitmap MyBitmap;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnRuler MyAnnRuler;

ANNPOINT MyPts[2] = { 40,40,
140,40,
};

ANNPOINT AnnPoints[2];

pANNPOINT pMyPts = MyPts;
MyAnnRuler.SetPoints(pMyPts,
 2);

MyAnnRuler.GetPoints(AnnPoints);

for (int i=0; i<2; i++)
{
L_TCHAR szTemp[100];

wsprintf(szTemp, TEXT("[%d]Point(%d, %d)"),
 i, (int)AnnPoints[i].x, (int)AnnPoints[i].y);
AfxMessageBox(szTemp);
}


LAnnRuler::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetRotateAngle(pdAngle)

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

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: | Class Members,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples displays the rotation angle of the Ruler annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnRuler * pLRuler)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLRuler->GetRotateAngle(&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);
}
}


LAnnRuler::GetShowFlags

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetShowFlags(puShowFlags)

L_UINT L_FAR * puShowFlags;

/* address of the variable to be updated */

Gets a value that indicates how the Ruler, PolyRuler, Cross-Product, and Protractor objects created by the automation object will be displayed.This function is available in the Document/Medical Toolkits.

Parameter | Description
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

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.

See Also

Functions: | LAnnRuler::SetShowFlags, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::GetDistance.


LAnnRuler::GetText

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnRuler L_FAR * pAnnObject)
{
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 */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new text */
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 */
pAnnObject->GetText(pText);
/* Free memory that we no longer need */
GlobalFree(hText);
}


LAnnRuler::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnRuler::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object's character string.

Comments

Use this value to allocate a buffer to read the text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::GetText.


LAnnRuler::GetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetTicMarkLength(pdLength)

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_RULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

Parameter | Description
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_RULER

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.

See Also

Functions: | Class Member
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::SetTicMarkLength.


LAnnRuler::GetUnit

#include "ltwrappr.h"

virtual L_UINT LAnnRuler::GetUnit(pUnitAbbrev, puPrecision)

L_TCHAR L_FAR * pUnitAbbrev; | /* character string to be updated */
L_UINT L_FAR * puPrecision; | /* pointer to a variable to be updated */

Gets the current unit of measurement values set by the LAnnRuler::SetUnit function. This function is available in the Document/Medical Toolkits.

Parameter | Description
pUnitAbbrev | Character string to be updated with the unit abbreviation string to be displayed after the distance.
puPrecision | Pointer to 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_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 LAnnAutomation::GetUnit function or the LAnnRuler::GetUnit 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 LAnnAutomation::SetUnit or the LAnnRuler::SetUnit 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.

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: | Class Members, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::SetUnit.


LAnnRuler::GetUnitLen

#include "ltwrappr.h"

virtual L_UINT LAnnRuler::GetUnitLen(L_VOID)

Gets the size of the buffer required to hold pUnitAbbrev in LAnnRuler::GetUnit. This function is available in the Document/Medical Toolkits.

Returns

The length of the unit abbreviation string.

Comments

Call this function before calling LAnnRuler::GetUnit 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.

See Also

Functions: | Class Members, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::SetUnit.


LAnnRuler::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumerateHandles, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandles, LAnnRuler::DeleteUserHandle, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRuler *LRuler)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LRuler->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LRuler->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnRuler::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnRuler::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members, LAnnRuler::AddUserHandle, LAnnRuler::EnumerateHandles, LAnnRuler::EnumHandleCallBack, LAnnRuler::GetUserHandle, LAnnRuler::DeleteUserHandle, LAnnRuler::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnRuler * LRuler)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LRuler->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LRuler->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnRuler::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnRuler::IsFixedInRect(prc, uFlags)

LPRECT prc; /* address of variable representing client area */

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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::Begin

LDoubleBuffer::End

A successful call to LAnnRuler::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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
// pLRuler -- Pointer to LAnnRuler annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnRuler *pLRuler)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLRuler->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible.") : TEXT("There are NO fixed annotations visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnRuler::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnRuler::IsFontBold(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the property that determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
/* Set the font to bold, unless it already is */
if (pAnnObject->IsFontBold())
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontBold(TRUE, 0);

/* Set the font to italic, unless it already is */
if (pAnnObject->IsFontItalic()== TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontItalic(TRUE, 0);
}


LAnnRuler::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnRuler::IsFontItalic(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the property that determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::IsFontBold.


LAnnRuler::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnRuler::IsFontStrikeThrough(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the property that determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
/* Set the font to have a strike-through, unless it already has one */
if (pAnnObject->IsFontStrikeThrough())
MessageBox (NULL, TEXT("Already has strike-through"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontStrikeThrough(TRUE, 0);
}


LAnnRuler::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnRuler::IsFontUnderline(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn (LAnnRuler L_FAR * pAnnObject)
{
/* Set the font to have an underline, unless it already has one */
if (pAnnObject->IsFontUnderline())
MessageBox (NULL, TEXT("Already has an underline"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontUnderline(TRUE, 0);
}


LAnnRuler::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRuler::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnRuler::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnRuler::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRuler::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRuler::PushFixedState / LAnnRuler::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRuler::PushFixedState and LAnnRuler::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnRuler::PopFixedState (); | Fixed state is still disabled
LAnnRuler::PopFixedState (); | Fixed state is enabled

Note that LAnnRuler::PushFixedState and LAnnRuler::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnRuler::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnRuler *pLRuler)
{
pLRuler->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRuler::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnRuler::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnRuler::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnRuler::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnRuler::PushFixedState / LAnnRuler::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnRuler::PushFixedState and LAnnRuler::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnRuler::PushFixedState (); | Fixed state is temporarily disabled
LAnnRuler::PopFixedState (); | Fixed state is still disabled
LAnnRuler::PopFixedState (); | Fixed state is enabled

Note that LAnnRuler::PushFixedState and LAnnRuler::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnRuler *pLRuler)
{
pLRuler->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnRuler::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnRuler *pLRuler)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLRuler->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLRuler->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnRuler::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | Make the font not bold.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::IsFontBold.


LAnnRuler::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic. Possible values are:
 | Value | Meaning
 | TRUE | Make the font italic.
 | FALSE | Make the font not italic.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::IsFontBold.


LAnnRuler::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* the name of the font to assign */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | Character string containing the name of the font to assign.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You specify the name of the font in a 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::GetFontName.


LAnnRuler::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* font size to set */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
dFontSize | The font size to set, expressed as an unscaled value relative to the container.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::GetFontSize.


LAnnRuler::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply or remove a strike-through */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the strike-through (a line through the middle of the text), of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply or remove a strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through.
 | FALSE | Remove a strike-through.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::IsFontStrikeThrough.


LAnnRuler::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply or remove an underline */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the underline of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply or remove an underline. Possible values are:
 | Value | Meaning
 | TRUE | Apply an underline to the text.
 | FALSE | Remove an underline from the text.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::IsFontUnderline.


LAnnRuler::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine the object to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
crFore | The COLORREF value that specifies the foreground color.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnRuler::GetForeColor.


LAnnRuler::SetGaugeLength

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetGaugeLength(dLength, uFlags=0)

L_DOUBLE dLength; | /* the new gauge length */
L_UINT uFlags; | /* flags that determine the object 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
dLength | The new length of the ruler object's gauge.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
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

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.

See Also

Functions: | Class Members, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::GetGaugeLength.


LAnnRuler::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnRuler::GetLineStyle.


LAnnRuler::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* the line width of an object */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example,refer to LAnnRuler::GetLineWidth.


LAnnRuler::SetPoints

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetPoints(pPoints, uCount)

pANNPOINT pPoints; | /* pointer to an array */
L_UINT uCount; | /* number of points in the array */

Defines the endpoints of the ruler object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pPoints | Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the endpoints 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.

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: | Class Members
Topics: | Annotation Functions: Getting and Setting Geometric Properties
 | Annotation Functions: Using Window Coordinates to Define an Object

Example

For an example, refer to LAnnRuler::GetDistance.


LAnnRuler::SetShowFlags

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetShowFlags(uShowFlags=0, uFlags=0)

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, PolyRulers, Cross-Products, and Protractors created by the automation object will be displayed. This function is available in the Document/Medical Toolkits.

Parameter | Description
uShowFlags | Flag that indicates how to display the rulers. Possible values are:
 | Value | Meaning
 | 0 | Display neither the ruler length or the ruler gauge.
 | 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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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 determines whether the length and gauge will be shown for the next Ruler, PolyRuler, Cross-Product, or Protractor object created in automated mode.

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.

See Also

Functions: | LAnnRuler::GetShowFlags, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Using Rulers in Annotation Objects
 | New Annotation Features of Version 14.5
 | Calibrating Annotation Ruler Objects

Example

For an example, refer to LAnnRuler::GetDistance.


LAnnRuler::SetTicMarkLength

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetTicMarkLength(dLength, uFlags)

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_RULER. The tic marks are the perpendicular lines that measure the units. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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_RULER

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.

See Also

Functions: | Class Member, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Automated User Interface for Annotations
 | 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
 pObjec
L_VOID SampleAnnTicMarkLength(LAnnRuler *pObject)
{
L_INT nRet;
L_DOUBLE dLength;
L_TCHAR szMsg[200];

nRet = pObject->GetTicMarkLength(&dLength);
if (nRet == SUCCESS)
{
wsprintf(szMsg, TEXT("Old Tic
 Mark Length: %f\nNew Tic Mark Length %f"),dLength, 2 * dLength);

pObject->SetTicMarkLength(2
 * dLength, 0);
MessageBox(NULL, szMsg, TEXT(""),
 MB_OK);
}
}


LAnnRuler::SetUnit

#include "ltwrappr.h"

virtual L_INT LAnnRuler::SetUnit(uUnit, pUnitAbbrev, uPrecision, uFlags=0)

L_UINT uUnit; | /* unit of measure */
L_TCHAR L_FAR * pUnitAbbrev; | /* character string containing the unit abbreviation string */
L_UINT uPrecision; | /* number of digits to be displayed after the decimal place */
L_UINT uFlags; | /* flags that determine the object 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
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 | 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.
uFlags | Flags that determine the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnAutomation::GetUnit function or the LAnnRuler::GetUnit 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 LAnnAutomation::SetUnit or the LAnnRuler::SetUnit 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.

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: | Class Members, LAnnPolyRuler::GetDistance2, ANNSMARTDISTANCE, LAnnotation::CalibrateRuler
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Rulers in Annotation Objects
 | Calibrating Annotation Ruler Objects

Example

L_VOID ModifyAnnUnit(LAnnRuler L_FAR * pAnnObject)
{
L_UINT uLen;
L_UINT uUnit;
L_TCHAR L_FAR* pUnitAbbrev=NULL;
L_UINT uPrecision;
L_TCHAR buf[180];
L_DOUBLE dDistance;
LBuffer LeadBuffer ;

/* first, get unit abbreviation string len */
uLen = pAnnObject->GetUnitLen();

LeadBuffer.Reallocate((DWORD)uLen
 * sizeof(L_TCHAR)) ;
pUnitAbbrev = (L_TCHAR L_FAR*)LeadBuffer.Lock();

/* get the settings */
uUnit = pAnnObject->GetUnit(pUnitAbbrev,
 &uPrecision);

/* and, get the distance */
pAnnObject->GetDistance(&dDistance);

/* display current settings & distance in current
 unit of measurement */
wsprintf(buf, TEXT("Unit: %d\nAbbrev: %s\nPrecision:
 %d\nDistance: %d\n"),
uUnit, pUnitAbbrev, uPrecision, dDistance);

MessageBox(NULL, buf, TEXT("Units"), MB_OK);

/* if unit is not inches, make it so */
if(uUnit != ANNUNIT_INCHES)
pAnnObject->SetUnit(ANNUNIT_INCHES,
 TEXT("Inch"), 2, 0);

LeadBuffer.Unlock();
}


LAnnStamp::LAnnStamp

#include "ltwrappr.h"

L_VOID LAnnStamp::LAnnStamp(bCreate=TRUE)

L_VOID LAnnStamp::LAnnStamp(hStamp)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hStamp; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnStamp object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hStamp | Handle of the associated annotation object.

Returns

None

Comments

LAnnStamp::LAnnStamp(bCreate) is a constructor for the LAnnStamp class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnStamp::LAnnStamp(hStamp) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_STAMP. The passed annotation object is invalidated.

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:

LAnnStamp::~LAnnStamp, Class Members

Example

This is an example for : LAnnStamp::LAnnStamp(bCreate)

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnStamp MyAnnotation; //construct an annotation object

//.... do something here ....
//Destructor is called upon returning from function
}

This is an example for : LAnnStamp::LAnnStamp(hStamp)

L_VOID TestFunction(HANNOBJECT& hAnnotationObject)
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnStamp MyAnnotation(hAnnotationObject); //construct an annotation object

//.... do something here ....

}


LAnnStamp::~LAnnStamp

#include "ltwrappr.h"

virtual L_VOID LAnnStamp::~LAnnStamp(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnStamp class.

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:

LAnnStamp::LAnnStamp, Class Members

Example

For an example, refer to LAnnStamp::LAnnStamp.


LAnnStamp::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Stamp
L_VOID ExampleAnnAddUserHandle(LAnnStamp *pLStamp)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLStamp->GetType();
if (uType == ANNOBJECT_STAMP)
{
pLStamp->GetRect(&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;
pLStamp->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLStamp->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Stamp."), TEXT("Error"), MB_OK);
}


LAnnStamp::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnStamp::AddUserHandle and LAnnStamp::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnStamp *LStamp)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LStamp->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LStamp->GetUserHandle(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;
LStamp->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnStamp::Create

#include "ltwrappr.h"

virtual L_INT LAnnStamp::Create(L_VOID)

Creates a Stamp annotation object. 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 use the LAnnStamp::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction( )
{
LBase::LoadLibraries(LT_ALL_LEADLIB);//make sure all libraries are loaded

LAnnStamp MyAnnotation(FALSE); //construct an annotation object

if (MyAnnotation.Create()==SUCCESS)
{
//…. do something here ….
}
}


LAnnStamp::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::DeleteUserHandle(nIndex)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnStamp *LStamp)
{
L_UINT uCount;

// Get the total count of user handles
LStamp->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LStamp->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnStamp::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnStamp::EnumerateHandles()

Calls the LAnnStamp::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnStamp::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnStamp: public LAnnStamp
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnStamp::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnStamp *LStamp)
{
LStamp->EnableCallBack(TRUE);
LStamp->EnumerateHandles();
}


LAnnStamp::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnStamp::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnStamp::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnStamp::EnumerateHandles 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 LAnnStamp::ChangeUserHandle.

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.

To enable the LAnnStamp::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnStamp::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnStamp::EnumerateHandles.


LAnnStamp::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnStamp::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnStamp::GetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetBitmap(pBitmap)

virtual L_INT LAnnStamp::GetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* address of the variable to be updated */

Gets the bitmap handle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to an LBitmapBase object to be updated with the handle to the annotation object's bitmap.
pBitmap | Address of the variable to be updated with the handle to the annotation object's bitmap.

Returns

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

Comments

Before calling LAnnStamp::GetBitmap(pBitmap), where pBitmap is of type LBitmapBase L_FAR, you must declare aan LBitmapBase object. Then, pass the address of the object in the pBitmap parameter. This function will update the object with the handle to the annotation object's bitmap.

Before calling LAnnStamp::GetBitmap(pBitmap), where pBitmap is of type pBITMAPHANDLE, 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.

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: | LAnnStamp::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example for LAnnStamp::GetBitmap(pBitmap), where pBitmap is of type pBITMAPHANDLE:

L_VOID TestGetAnnBitmap(LAnnStamp L_FAR * pAnnStamp, pBITMAPHANDLE pBitmap )
{
if (pAnnStamp && pBitmap)
{
pAnnStamp->GetBitmap(pBitmap);
}
}

This is an example for LAnnStamp::GetBitmap(pBitmap), where pBitmap is of type LBitmapBase L_FAR:

L_VOID TestGetAnnBitmap(LAnnStamp L_FAR * pAnnStamp, LBitmapBase L_FAR * pLBitmap )
{
if (pAnnStamp && pLBitmap)
{
pAnnStamp->GetBitmap(pLBitmap);
}
}


LAnnStamp::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnStamp::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

The fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant.Possible values of the fill mode are:

ANNMODE_TRANSPARENT [0]

ANNMODE_TRANSLUCENT [1]

ANNMODE_OPAQUE [2]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */
/* Set the fill mode to transparent, unless it already is */

FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT, 0);
}


LAnnStamp::GetFillPattern

#include "ltwrappr.h"

virtual L_UINT LAnnStamp::GetFillPattern(L_VOID)

Gets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill pattern constant. Possible values of the fill pattern are:

ANNPATTERN_SOLID [0]

ANNPATTERN_BDIAGONAL [1]

ANNPATTERN_CROSS [2]

ANNPATTERN_DIAGCROSS [3]

ANNPATTERN_FDIAGONAL [4]

ANNPATTERN_HORIZONTAL [5]

ANNPATTERN_VERTICAL [6]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
L_UINT FillPattern; /* Object fill pattern */
/* Set the fill pattern to solid, unless it already is */
FillPattern = pAnnObject->GetFillPattern();
if (FillPattern == ANNPATTERN_SOLID)
MessageBox (NULL, TEXT("Already solid"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillPattern(ANNPATTERN_SOLID, 0);
}


LAnnStamp::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetFixed(pbFixed)

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

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: | Class Members, LAnnStamp::SetFixed, LAnnStamp::PushFixedState, LAnnStamp::PopFixedState, LAnnStamp::GetFixed, LAnnStamp::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnStamp::SetFixed.


LAnnStamp::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* character string to be updated */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | 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

pFontName must be large enough to hold the returned 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
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 */
NameLength = pAnnObject->GetFontNameLen();

/* 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 */
pAnnObject->GetFontName(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
pAnnObject->SetFontName(TEXT("Times New Roman"), 0);

/* Free memory that we no longer need */
GlobalFree(hFontname);
}


LAnnStamp::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnStamp::GetFontNameLen(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the length of the character string that holds the font name of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The string length of the annotation object's font name.

Comments

Use this value to allocate a buffer when reading the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetFontName.


LAnnStamp::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnStamp::GetFontSize(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current unscaled value of the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the annotation object.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
L_DOUBLE FontSize; /* Object font size */
/* Double the font size */
FontSize = pAnnObject->GetFontSize();
pAnnObject->SetFontSize(FontSize * 2, 0);

}


LAnnStamp::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnStamp::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnStamp::GetLineStyle

#include "ltwrappr.h"

virtual L_UINT LAnnStamp::GetLineStyle(L_VOID)

Gets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line style. Possible values are:

ANNLINE_SOLID [0]

ANNLINE_DASH [1]

ANNLINE_DOT [2]

ANNLINE_DASHDOT [3]

ANNLINE_DASHDOTDOT [4]

ANNLINE_NULL [5]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
L_UINT LineStyle; /* Line style property of the object */
/* Set the style to a dashed line, unless it is already dashed */
LineStyle = pAnnObject->GetLineStyle();
if (LineStyle == ANNLINE_DASH)
MessageBox (NULL, TEXT("Already dashed line"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetLineStyle(ANNLINE_DASH, 0);
}


LAnnStamp::GetLineWidth

#include "ltwrappr.h"

virtual L_DOUBLE LAnnStamp::GetLineWidth(L_VOID)

Gets the current unscaled value of the line width of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The annotation object's current line width.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
L_DOUBLE LineWidth; /* Object line width */
/* Double the line width */
LineWidth = pAnnObject->GetLineWidth();
pAnnObject->SetLineWidth(LineWidth * 2, 0);
}


LAnnStamp::GetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetMetafile(phMetafile)

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. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 by phMetafile will be updated with the metafile handle.

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: | LAnnStamp::SetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

void Example2()
{
LAnnStamp MyAnnStamp;
HMETAFILE hMetafile;

//...metafile is associated with stamp annotation
MyAnnStamp.GetMetafile(&hMetafile);
//... do something with hMetafile
}


LAnnStamp::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This examples displays the rotation angle of the Stamp annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnStamp * pLStamp)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLStamp->GetRotateAngle(&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);
}
}


LAnnStamp::GetSecondaryMetafile

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetSecondaryMetafile(phMetafile)

HMETAFILE L_FAR * phMetafile;

/* pointer to a variable to be updated with the handle to a metafile */

Retrieves the metafile handle associated with an Stamp object when it is in the ‘decryptor’ state. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 stamp 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 LAnnStamp::GetMetafile 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

L_VOID SampleAnnGetSecondaryMetafile(LAnnStamp *pLStamp)
{
HMETAFILE hMetafile1=0;
HMETAFILE hMetafile2=0;

L_UINT uObjectType;

uObjectType = pLStamp->GetType();
if (uObjectType != ANNOBJECT_STAMP)
{
MessageBox(NULL, TEXT("This object is not an stamp."), TEXT("Error"), MB_OK);
return;
}

pLStamp->GetMetafile(&hMetafile1);
pLStamp->GetSecondaryMetafile(&hMetafile2);

}


LAnnStamp::GetText

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

The LAnnStamp class gets and sets text without formatting. Use the LAnnRTF class to use formatted text.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
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 */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new text */
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 */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current text */
lstrcat(pText,TEXT(" - New"));
pAnnObject->SetText(pText, 0);

/* Free memory that we no longer need */
GlobalFree(hText);
}


LAnnStamp::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnStamp::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object's character string.

Comments

Use this value to allocate a buffer to read the text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetText.


LAnnStamp::GetTransparent

#include "ltwrappr.h"

virtual L_BOOL LAnnStamp::GetTransparent(L_VOID)

Determines whether the bitmap Stamp is transparent. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The bitmap stamp is transparent.
FALSE | The bitmap stamp is not transparent.

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: | Class Members, LAnnotation::GetFillModeExt, LAnnotation::SetFillModeExt, LAnnotation::GetOptions, LAnnotation::SetOptions
Topics: | Displaying and Manipulating Annotation Objects

Example

For an example,refer to LAnnStamp::SetTransparent.


LAnnStamp::GetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetTransparentColor(pcrTransparent)

COLORREF L_FAR * pcrTransparent;

/* address of a variable to be updated */

Retrieves the transparent color set by LAnnStamp::SetTransparentColor. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::GetPixelColor.

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.

See Also

Functions: | LAnnStamp::SetTransparentColor, LAnnStamp::SetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS


LAnnStamp::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnStamp *LStamp)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LStamp->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LStamp->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnStamp::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnStamp::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnStamp * LStamp)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LStamp->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LStamp->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnStamp::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnStamp::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnStamp::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLStamp -- Pointer to LAnnStamp annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnStamp *pLStamp)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLStamp->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnStamp::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnStamp::IsFontBold(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
/* Set the font to bold, unless it already is */
if (pAnnObject->IsFontBold())
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontBold(TRUE, 0);
}


LAnnStamp::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnStamp::IsFontItalic(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
/* Set the font to italic, unless it already is */

if (pAnnObject->IsFontItalic()== TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontItalic(TRUE, 0);
}


LAnnStamp::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnStamp::IsFontStrikeThrough(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{
/* Set the font to have a strike-through, unless it already has one */

if (pAnnObject->IsFontStrikeThrough())
MessageBox (NULL, TEXT("Already has strike-through"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontStrikeThrough(TRUE, 0);
}


LAnnStamp::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnStamp::IsFontUnderline(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnStamp L_FAR * pAnnObject)
{

/* Set the font to have an underline, unless it already has one */

if (pAnnObject->IsFontUnderline())
MessageBox (NULL, TEXT("Already has an underline"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontUnderline(TRUE, 0);
}


LAnnStamp::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnStamp::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnStamp::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnStamp::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnStamp::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnStamp::PushFixedState / LAnnStamp::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnStamp::PushFixedState and LAnnStamp::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnStamp::PushFixedState (); | Fixed state is temporarily disabled
LAnnStamp::PushFixedState (); | Fixed state is temporarily disabled
LAnnStamp::PopFixedState (); | Fixed state is still disabled
LAnnStamp::PopFixedState (); | Fixed state is enabled

Note that LAnnStamp::PushFixedState and LAnnStamp::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnStamp::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnStamp *pLStamp)
{
pLStamp->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnStamp::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnStamp::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnStamp::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnStamp::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnStamp::PushFixedState / LAnnStamp::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnStamp::PushFixedState and LAnnStamp::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnStamp::PushFixedState (); | Fixed state is temporarily disabled
LAnnStamp::PushFixedState (); | Fixed state is temporarily disabled
LAnnStamp::PopFixedState (); | Fixed state is still disabled
LAnnStamp::PopFixedState (); | Fixed state is enabled

Note that LAnnStamp::PushFixedState and LAnnStamp::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnStamp *pLStamp)
{
pLStamp->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnStamp::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnStamp::GetBackColor.


LAnnStamp::SetBitmap

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetBitmap(pBitmap, uFlags=0)

virtual L_INT LAnnStamp::SetBitmap(pBitmap, uFlags=0)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UINT uFlags; | /* flags that determine the object to process */

Sets the bitmap of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBitmap | Pointer to the bitmap object referencing the bitmap object to assign to the specified 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | LAnnStamp::SetBitmap, Class Members
Topics: | Annotation Functions: Object Properties
 | Using Annotation Bitmap Objects

Example

This is an example for LAnnStamp::SetBitmap(pBitmap, uFlags=0), with pBitmap of type pBITMAPHANDLE:

void TestAddAnn(HWND hWnd, pBITMAPHANDLE pBitmap, LAnnContainer L_FAR * pAnnContainer, LAnnStamp L_FAR * pAnnStamp)
{
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT MyStampRect; /* Rectangle for the stamp 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 */
pAnnContainer->GetRect(&ContainerRect);

/* 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(pBitmap)) / BITMAPWIDTH(pBitmap));
pAnnStamp->SetRect(&MyStampRect);

/* Assign the bitmap to the stamp;*/
pAnnStamp->SetBitmap(pBitmap,0);
/* Display the stamp */
pAnnStamp->GetBoundingRect(&rAnnBounds);
pAnnStamp->Draw(hWindowDC, &rAnnBounds);
ReleaseDC(hWnd, hWindowDC);

/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
}

This is an example for LAnnStamp::SetBitmap(pBitmap, uFlags=0), with pBitmap of type LBitmapBase L_FAR:

void TestAddAnnBitmap(HWND hWnd, LBitmapBase L_FAR * pLBitmap, LAnnContainer L_FAR * pAnnContainer, LAnnStamp L_FAR * pAnnStamp)
{
HDC hWindowDC; /* Device context of the current window */
ANNRECT ContainerRect; /* Root container's rectangle */
ANNRECT MyStampRect; /* Rectangle for the stamp 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 */
pAnnContainer->GetRect(&ContainerRect);

/* 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) * (pLBitmap->GetWidth())) / (pLBitmap->GetHeight()));

pAnnStamp->SetRect(&MyStampRect);

/* Assign the bitmap to the stamp;*/
pAnnStamp->SetBitmap(pLBitmap,0);
/* Display the stamp */
pAnnStamp->GetBoundingRect(&rAnnBounds);
pAnnStamp->Draw(hWindowDC, &rAnnBounds);
ReleaseDC(hWnd, hWindowDC);

/* Remove the queued paint message */
ValidateRect(hWnd, &rAnnBounds);
}


LAnnStamp::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillMode | The constant that specifies the object's fill mode. The following are the possible values of the fill mode:
 | NNMODE_TRANSPARENT [0]
 | NNMODE_TRANSLUCENT [1]
 | NNMODE_OPAQUE [2]
 | 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetFillMode.


LAnnStamp::SetFillPattern

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFillPattern(uFillPattern=ANNPATTERN_SOLID, uFlags=0)

L_UINT uFillPattern; | /* constant that specifies the fill pattern */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the fill pattern of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillPattern | The constant that specifies the fill pattern. The following are the possible values of the fill pattern:
 | ANNPATTERN_SOLID [0]
 | ANNPATTERN_BDIAGONAL [1]
 | ANNPATTERN_CROSS [2]
 | ANNPATTERN_DIAGCROSS [3]
 | ANNPATTERN_FDIAGONAL [4]
 | ANNPATTERN_HORIZONTAL [5]
 | ANNPATTERN_VERTICAL [6]
 | 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetFillPattern.


LAnnStamp::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnStamp *pLStamp)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLStamp->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLStamp->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnStamp::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | make the font not bold.
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::IsFontBold.


LAnnStamp::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic. Possible values are:
 | Value | Meaning
 | TRUE | Make the font italic.
 | FALSE | make the font not italic.
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::IsFontItalic.


LAnnStamp::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* the name of the font to assign */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You specify the name of the font in a 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetFontName.


LAnnStamp::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* the font size to set */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetFontSize.


LAnnStamp::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply or remove a strike-through*/
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the strike-through (a line through the middle of the text) of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply or remove a strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through.
 | FALSE | Remove a 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::IsFontStrikeThrough.


LAnnStamp::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply or remove an underline */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the underline of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply or remove an underline. Possible values are:
 | Value | Meaning
 | TRUE | Apply an underline.
 | FALSE | Remove an underline.
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::IsFontUnderline.


LAnnStamp::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetForeColor(crFore=RGB(255,0,0), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnStamp::GetForeColor.


LAnnStamp::SetLineStyle

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetLineStyle(uLineStyle=ANNLINE_SOLID, uFlags=0)

L_UINT uLineStyle; | /* constant that specifies the line style */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the line style of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uLineStyle | The constant that specifies the line style. The following are the possible values of the line style:
 | ANNLINE_SOLID [0]
 | ANNLINE_DASH [1]
 | ANNLINE_DOT [2]
 | ANNLINE_DASHDOT [3]
 | ANNLINE_DASHDOTDOT [4]
 | ANNLINE_NULL [5]
 | 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetLineStyle.


LAnnStamp::SetLineWidth

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetLineWidth(dLineWidth, uFlags=0)

L_DOUBLE dLineWidth; | /* line width of an object */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the unscaled line width of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dLineWidth = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetLineWidth.


LAnnStamp::SetMetafile

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetMetafile(hMetafile, uType, uFlags=0)

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 a stamp object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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_EXTENDED | [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_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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

Only stamp objects, hotspot objects, and freehand hotspot objects can have metafiles. Note that for stamps, setting the metafile destroys the stamp object’s bitmap and text. Also, setting a bitmap or text destroys the metafile associated with the stamp object. (The stamp object can have Text, Bitmap or Metafile and each of these cancels the other two).

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, then hMetafile is ignored and the default metafiles are used instead. The annotation DLL has 25 predefined metafiles. You can change the predefined metafiles by using LAnnotation::SetPredefinedMetafile.

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: | LAnnStamp::GetMetafile, LAnnotation::SetPredefinedMetafile, LAnnotation::GetPredefinedMetafile, Class Members, LBitmap::Scramble, LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, LAnnContainer::EncryptApply, LAnnEncrypt::GetSecondaryMetafile, LAnnStamp::GetSecondaryMetafile, LAnnEncrypt::GetSecondaryMetafile, LAnnPoint::GetPredefinedBitmap, LAnnPoint::SetPredefinedBitmap, LAnnPoint::GetPointOptions
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Using Annotation Bitmap Objects

Example

//This example sets the metafile in the stamp annotation to the predfined
//metafile ANNMETAFILE_IMPORTANT
void CVCAnnotation11Dlg::OnButtonStamp()
{
LBitmap MyBitmap;
RECT rect;
ANNRECT annRect;
HMETAFILE hNotUsed;

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

LAnnStamp MyAnnStamp;

annRect.left = 50;
annRect.top = 50;
annRect.right = 150;
annRect.bottom = 150;

hNotUsed = 0;
MyAnnStamp.SetMetafile(hNotUsed, ANNMETAFILE_IMPORTANT, 0);

MyAnnStamp.SetRect(&annRect);
MyAnnStamp.SetVisible(TRUE);
MyAnnStamp.GetBoundingRect(&rect) ;

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnStamp.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnStamp::SetText

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetText(pText, uFlags=0)

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 the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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 | 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnStamp::GetText.


LAnnStamp::SetTransparent

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetTransparent(bTransparent, uFlags=0)

L_BOOL bTransparent; | /* flag that indicates whether to make the bitmap transparent */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the bitmap associated with the Stamp object 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
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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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

Only Point and Stamp objects that are using a bitmap can be set 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.

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: | Class Members
Topics | Annotation Functions (Document/Medical only) Displaying Annotations
 | Displaying and Manipulating Annotation Objects

Example

void TestAnnWnd(LAnnStamp L_FAR*pLAnnStamp)
{
if(pLAnnStamp->GetTransparent()==FALSE)
pLAnnStamp->SetTransparent(TRUE);
}


LAnnStamp::SetTransparentColor

#include "ltwrappr.h"

virtual L_INT LAnnStamp::SetTransparentColor(crTransparent, uFlags=0)

COLORREF crTransparent; | /* transparent color */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets the transparent color. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 toolkits, 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 LBitmapBase::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 LAnnContainer::GetSelectItems and LAnnotation::SetSelected 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

Only stamp objects that have a bitmap will use the transparent color.

This transparent color is used only if the object is set to transparent using LAnnStamp::SetTransparent.

By default, the transparent color is white (0x00FFFFFF).

All objects created by this automation object will have this transparent color.

In design mode, the transparent color can be picked by selecting the Transparent color from the properties menu. If the object’s bitmap has a palette, a dialog box will come up allowing you to select a color from the palette colors. If the object’s bitmap does not have a palette, the standard Windows color pick dialog box is used to select a transparent color.

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: | LAnnStamp::GetTransparentColor, LAnnStamp::SetTransparent
Topics: | Annotation Functions: Object Properties
 | Annotation Objects - Default Values
 | Annotation Objects - Automated Features
 | Displaying and Manipulating Annotation Objects
 | Using Color Values in LEADTOOLS

Example

void CVCAnnotation11Dlg::OnButtonTransparentColor()
{
LBitmap MyBitmap;
RECT rect;
ANNRECT annRect;
L_TCHAR szTemp[100];

L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);

//Load an image containing color RED
LBitmapBase BitmapBase;
BitmapBase.Load(TEXT("d:\\work\\images\\rgbw.bmp"));
LAnnStamp MyAnnStamp;

//Make RED transparent
MyAnnStamp.SetBitmap(&BitmapBase);
MyAnnStamp.SetTransparentColor(RGB(255,0,0));
MyAnnStamp.SetTransparent(TRUE);

//Verify transparent color
COLORREF ColorRef;
MyAnnStamp.GetTransparentColor(&ColorRef);
wsprintf( szTemp,
TEXT("Transparent Color: %x"),
ColorRef);
AfxMessageBox(szTemp);

//Display the stamp annotation
annRect.left = 50;
annRect.top = 50;
annRect.right = 150;
annRect.bottom = 150;
MyAnnStamp.SetRect(&annRect);

MyAnnStamp.SetVisible(TRUE);
MyAnnStamp.GetBoundingRect(&rect) ;

//Draw the annotation
HDC hDC = ::GetDC(m_hWnd);
MyAnnStamp.Draw(hDC,&rect);
::ReleaseDC(m_hWnd, hDC);
}


LAnnText::LAnnText

#include "ltwrappr.h"

L_VOID LAnnText::LAnnText(bCreate=TRUE)

L_VOID LAnnText::LAnnText(hText)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hText; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnText object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.
hText | Handle of the associated annotation object.

Returns

None

Comments

LAnnText::LAnnText(bCreate) is a constructor for the LAnnText class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnText::LAnnText(hText) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_TEXT. The passed annotation object is invalidated.

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:

LAnnText::~LAnnText, Class Members

Example

This is an example for LAnnText::LAnnText(bCreate):

L_VOID TestFunction()
{
LAnnText MyTextAnnotation; //Constructor is called here

//Destructor is called upon returning from this function
}

This is an example for LAnnText::LAnnText(hText):

L_VOID AnnSample(HANNOBJECT& hText)
{
LAnnText MyTextAnnotation(hText);

//....Do Something here...
}


LAnnText::~LAnnText

#include "ltwrappr.h"

virtual L_VOID LAnnText::~LAnnText(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnText class.

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:

LAnnText::LAnnText, Class Members

Example

For an example, refer to LAnnText::LAnnText.


LAnnText::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnText::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example adds user handles to the center of the top and bottom lines of a Text object
L_VOID ExampleAnnAddUserHandle(LAnnText *pLText)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLText->GetType();
if (uType == ANNOBJECT_TEXT)
{
pLText->GetRect(&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;
pLText->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLText->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Text object."), TEXT("Error"), MB_OK);
}


LAnnText::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnText::ChangeUserHandle(nIndex, pAnnHandle)

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
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 Text annotation handle.

This function is used in conjunction with the LAnnText::AddUserHandle and LAnnText::EnumerateHandles 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnText *LText)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LText->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LText->GetUserHandle(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;
LText->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnText::Create

#include "ltwrappr.h"

virtual L_INT LAnnText::Create(L_VOID)

Creates a Text annotation object. 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 use the LAnnText::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID AnnSample()
{
LAnnText MyTextAnnotation(FALSE);

if (MyTextAnnotation.Create()==SUCCESS)
{
//....Do Something here...
//...
MyTextAnnotation.Destroy();
}
}


LAnnText::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnText::DeleteUserHandle(nIndex)

L_INT32 nIndex;

/* index of the user handle to delete */

Deletes an existing user-defined Text annotation handle. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 a Text annotation object.

Set uIndex to -1 to delete all the user-defined handles for a Text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnText *LText)
{
L_UINT uCount;

// Get the total count of user handles
LText->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LText->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnText::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnText::EnumerateHandles()

Calls the LAnnText::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 a Text annotation object.

Note that this function returns information about both default annotation handles and user-defined Text annotation handles.

This function can also be used to change some of the properties of a Text annotation handle.

For more information, refer to the LAnnText::EnumHandleCallBack 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

class MyAnnText: public LAnnText
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnText::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnText *LText)
{
LText->EnableCallBack(TRUE);
LText->EnumerateHandles();
}


LAnnText::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnText::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnText::EnumerateHandles function.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnText::EnumerateHandles 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 LAnnText::ChangeUserHandle.

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.

To enable the LAnnText::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnText::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnText::EnumerateHandles.


LAnnText::GetBackColor

#include "ltwrappr.h"

virtual COLORREF LAnnText::GetBackColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The background color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object background color */
/* Invert the background color */
ThisColor = pAnnObject->GetBackColor();
pAnnObject->SetBackColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnText::GetFillMode

#include "ltwrappr.h"

virtual L_UINT LAnnText::GetFillMode(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The object's fill mode constant. Possible values are:

ANNMODE_TRANSPARENT [0]

ANNMODE_TRANSLUCENT [1]

ANNMODE_OPAQUE [2]

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
L_UINT FillMode; /* Object fill mode */
/* Set the fill mode to transparent, unless it already is */

FillMode = pAnnObject->GetFillMode();
if (FillMode == ANNMODE_TRANSPARENT)
MessageBox (NULL, TEXT("Already transparent"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFillMode(ANNMODE_TRANSPARENT, 0);
}


LAnnText::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnText::GetFixed(pbFixed)

L_BOOL *pbFixed;

/* address of a variable to be updated */

Gets a value that indicates whether the Text annotation object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
pbFixed | Address of the variable to be updated with a value that indicates whether the Text annotation object 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnText::SetFixed.


LAnnText::GetFontName

#include "ltwrappr.h"

virtual L_INT LAnnText::GetFontName(pFontName)

L_TCHAR L_FAR * pFontName;

/* the name of the font used */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the font name (character string) for text in the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pFontName | 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

pFontName must be large enough to hold the returned 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
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 */
NameLength = pAnnObject->GetFontNameLen();

/* 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 */
pAnnObject->GetFontName(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
pAnnObject->SetFontName(TEXT("Times New Roman"), 0);

/* Free memory that we no longer need */
GlobalFree(hFontname);
}


LAnnText::GetFontNameLen

#include "ltwrappr.h"

virtual L_UINT LAnnText::GetFontNameLen(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the length of the character string that holds the font name of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The string length of the annotation object's font name.

Comments

Use this value to allocate a buffer when reading the 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetFontName.


LAnnText::GetFontSize

#include "ltwrappr.h"

virtual L_DOUBLE LAnnText::GetFontSize(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current unscaled value of the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Returns

The current unscaled font size of the annotation object.

Comments

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
L_DOUBLE FontSize; /* Object font size */
/* Double the font size */
FontSize = pAnnObject->GetFontSize();
pAnnObject->SetFontSize(FontSize * 2, 0);

}


LAnnText::GetForeColor

#include "ltwrappr.h"

virtual COLORREF LAnnText::GetForeColor(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Gets the current value of the annotation object's foreground color. This function is available in the Document/Medical Toolkits.

Returns

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
COLORREF ThisColor; /* Object foreground color */

/* Invert the foreground color */
ThisColor = pAnnObject->GetForeColor();
pAnnObject->SetForeColor(ThisColor ^ 0x00FFFFFF, 0);
}


LAnnText::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnText::GetRotateAngle(pdAngle)

L_DOUBLE *pdAngle;

/* pointer to a double that returns the rotate angle */

Gets the rotation angle for a Text annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 this 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations

Example

// This examples displays the rotation angle of the Text object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnText * pLText)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLText->GetRotateAngle(&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);
}
}


LAnnText::GetText

#include "ltwrappr.h"

virtual L_INT LAnnText::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
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 */
TextLength = pAnnObject->GetTextLen();
/* Add six characters to the length for our new text */
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 */
pAnnObject->GetText(pText);
/* Add " - New" to the end of the current text */
lstrcat(pText,TEXT(" - New"));
pAnnObject->SetText(pText, 0);

/* Free memory that we no longer need */
GlobalFree(hText);
}


LAnnText::GetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnText::GetTextAlign(puTextAlign)

L_UINT *puTextAlign;

/* address of a variable to be updated with the object's text alignment */

Gets the text alignment of this annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 a Text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations

Example

// Sample for LAnnText::SetTextAlign, LAnnText::GetTextAlign

// This example changes the text alignment of a text annotation object

L_VOID SampleAnnSetTextAlign(LAnnText *pLText)
{
L_INT nRet;
L_UINT uTextAlign;
L_TCHAR szMsg[100];
L_UINT uType;

pLText->GetTextAlign(&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= pLText->SetTextAlign(uTextAlign, 0);
if (nRet != SUCCESS)
{
uType = pLText->GetType();
wsprintf(szMsg, TEXT("SetTextAlign Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnText::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnText::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the annotation object's character string.

Comments

Use this value to allocate a buffer to read the text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetText.


LAnnText::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnText::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnText *LText)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LText->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LText->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnText::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnText::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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\nuStructSize: %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(LAnnText * LText)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LText->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LText->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnText::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnText::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
L_UINT uFlags; | /* flags that determine which objects to process */

Indicates whether there are any fixed Text annotation objects in the client rectangle prc. This function is available in the Document/Medical Toolkits.

Parameter | Description
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

Comments

This function is used primarily as an aid in scrolling Text annotation objects without using double buffering. For more information on double buffering, see the documentation for:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnText::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example displays a message box telling if there are any fixed Text annotation objects
// visible in the client area of hWnd. This is useful for handling scrolling and zooming
// of fixed Text annotation objects without double-buffering.
// hWnd -- window displaying annotations
// pLText -- Pointer to LAnnText annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnText *pLText)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLText->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed Text annotations objects visible.") : TEXT("There are NO fixed Text annotations objects visible.");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnText::IsFontBold

#include "ltwrappr.h"

virtual L_BOOL LAnnText::IsFontBold(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is bold. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is bold.
FALSE | The font is not bold.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

L_VOID TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
/* Set the font to bold, unless it already is */
if (pAnnObject->IsFontBold())
MessageBox (NULL, TEXT("Already bold"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontBold(TRUE, 0);
}


LAnnText::IsFontItalic

#include "ltwrappr.h"

virtual L_BOOL LAnnText::IsFontItalic(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object is italic. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font is italic.
FALSE | The font is not italic.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
/* Set the font to italic, unless it already is */

if (pAnnObject->IsFontItalic()== TRUE)
MessageBox (NULL, TEXT("Already italic"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontItalic(TRUE, 0);
}


LAnnText::IsFontStrikeThrough

#include "ltwrappr.h"

virtual L_BOOL LAnnText::IsFontStrikeThrough(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has a strike-through (a line through the middle of the text). This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has a strike-through.
FALSE | The font does not have a strike-through.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{
/* Set the font to have a strike-through, unless it already has one */

if (pAnnObject->IsFontStrikeThrough())
MessageBox (NULL, TEXT("Already has strike-through"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontStrikeThrough(TRUE, 0);
}


LAnnText::IsFontUnderline

#include "ltwrappr.h"

virtual L_BOOL LAnnText::IsFontUnderline(L_VOID)

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Determines whether the font of the annotation object has an underline. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The font has an underline.
FALSE | The font does not have an underline.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void TestModifyAnn(LAnnText L_FAR * pAnnObject)
{

/* Set the font to have an underline, unless it already has one */

if (pAnnObject->IsFontUnderline())
MessageBox (NULL, TEXT("Already has an underline"), TEXT("Notice"), MB_OK);
else
pAnnObject->SetFontUnderline(TRUE, 0);
}


LAnnText::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnText::PopFixedState(uFlags)

L_UINT uFlags;

/* flags that determine which objects to process */

Re-enables the ‘fixed’ state of a Text annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 Text annotation objects. It is to be called after the ‘fixed’ state as been temporarily disabled by a call to LAnnText::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnText::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnText::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnText::PushFixedState / LAnnText::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnText::PushFixedState and LAnnText::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnText::PushFixedState (); | Fixed state is temporarily disabled
LAnnText::PushFixedState (); | Fixed state is temporarily disabled
LAnnText::PopFixedState (); | Fixed state is still disabled
LAnnText::PopFixedState (); | Fixed state is enabled

Note that LAnnText::PushFixedState and LAnnText::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnText::PushFixedState
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnText *pLText)
{
pLText->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnText::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnText::PushFixedState(uFlags)

L_UINT uFlags;

/* flags that determine which objects to process */

Temporarily disables the ‘fixed’ state of a Text annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 Text annotation objects.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnText::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnText::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnText::PushFixedState / LAnnText::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnText::PushFixedState and LAnnText::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnText::PushFixedState (); | Fixed state is temporarily disabled
LAnnText::PushFixedState (); | Fixed state is temporarily disabled
LAnnText::PopFixedState (); | Fixed state is still disabled
LAnnText::PopFixedState (); | Fixed state is enabled

Note that LAnnText::PushFixedState and LAnnText::PopFixedState should always be called in pairs.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

// This example temporarily disables the "fixed" property of all objects in the container
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnText *pLText)
{
pLText->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnText::SetBackColor

#include "ltwrappr.h"

virtual L_INT LAnnText::SetBackColor(crBack=RGB(0,0,0), uFlags=0)

COLORREF crBack; | /* the background color */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the background color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnText::GetBackColor.


LAnnText::SetFillMode

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFillMode(uFillMode=ANNMODE_TRANSPARENT, uFlags=0)

L_UINT uFillMode; | /* constant that specifies the object's fill mode */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the fill mode of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
uFillMode | The constant that specifies the object's fill mode. The following are the possible values of the fill mode:
 | ANNMODE_TRANSPARENT [0]
 | ANNMODE_TRANSLUCENT [1]
 | ANNMODE_OPAQUE [2]
 | 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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetFillMode.


LAnnText::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFixed(bFixed, bAdjust, uFlags)

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 Text annotation object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFixed | Value that specifies whether the Text 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

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(LAnnText *pLText)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLText->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLText->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnText::SetFontBold

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontBold(bFontBold=TRUE, uFlags=0)

L_BOOL bFontBold; | /* flag that indicates whether to make the font bold */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the bold-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontBold | Flag that indicates whether to make the font bold. Possible values are:
 | Value | Meaning
 | TRUE | Make the font bold.
 | FALSE | Make the font not bold.
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::IsFontBold.


LAnnText::SetFontItalic

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontItalic(bFontItalic=TRUE, uFlags=0)

L_BOOL bFontItalic; | /* flag that indicates whether to make the font italic */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the italic-font property of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontItalic | Flag that indicates whether to make the font italic.
 | 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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::IsFontItalic.


LAnnText::SetFontName

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontName(pFontName, uFlags=0)

L_TCHAR L_FAR * pFontName; | /* the name of the font to assign */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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

You specify the name of the font in a 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetFontName.


LAnnText::SetFontSize

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontSize(dFontSize, uFlags=0)

L_DOUBLE dFontSize; | /* the font size to set */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the font size of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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 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 LAnnotation::GetScalarX function, and C is the value that you get from the LAnnotation::GetScalarY function:

dFontSize = A / sqrt( B * C )

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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetFontSize.


LAnnText::SetFontStrikeThrough

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontStrikeThrough(bFontStrikeThrough=TRUE, uFlags=0)

L_BOOL bFontStrikeThrough; | /* flag that indicates whether to apply or remove the strike-through*/
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the strike-through (a line through the middle of the text), of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontStrikeThrough | Flag that indicates whether to apply or remove the strike-through. Possible values are:
 | Value | Meaning
 | TRUE | Apply a strike-through.
 | FALSE | Remove the strike-through.
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::IsFontStrikeThrough.


LAnnText::SetFontUnderline

#include "ltwrappr.h"

virtual L_INT LAnnText::SetFontUnderline(bFontUnderline=TRUE, uFlags=0)

L_BOOL bFontUnderline; | /* flag that indicates whether to apply or remove an underline */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Applies or removes the underline of an annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
bFontUnderline | Flag that indicates whether to apply or remove an underline. Possible values are:
 | Value | Meaning
 | TRUE | Apply an underline to the text.
FALSE |  | Remove an 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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::IsFontUnderline.


LAnnText::SetForeColor

#include "ltwrappr.h"

virtual L_INT LAnnText::SetForeColor(crFore=RGB(255,0,0,), uFlags=0)

COLORREF crFore; | /* the foreground color */
L_UINT uFlags; | /* flags that determine which objects to process */

NOTE:

THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.

Sets the foreground color of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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
 |  | 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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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

You use the Windows COLORREF data type to specify the color. For example, you can use the LBitmapBase::GetPixelColor function or the Windows RGB macro to get a color 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LAnnText::GetForeColor.


LAnnText::SetText

#include "ltwrappr.h"

virtual L_INT LAnnText::SetText(pText, uFlags=0)

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 the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnContainer::GetSelectItems() and LAnnotation::SetSelected() functions.
 | 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.

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: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnText::GetText.


LAnnText::SetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnText::SetTextAlign(uTextAlign, uFlags)

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 a Text annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 a Text 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering
 | Annotation Functions: Working with the Toolbar

Example

For an example, refer to LAnnText::GetTextAlign.


LAnnTextPointer::LAnnTextPointer

#include "ltwrappr.h"

L_VOID LAnnTextPointer::LAnnTextPointer(bCreate=TRUE)

L_VOID LAnnTextPointer::LAnnTextPointer(hTextPointer)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hTextPointer; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnTextPointer object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hTextPointer | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnTextPointer::LAnnTextPointer(bCreate) is a constructor for the LAnnTextPointer class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnTextPointer::LAnnTextPointer(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type LAnnTextPointer. The passed annotation object is invalidated.

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:

LAnnTextPointer::~LAnnTextPointer, Class Members

Example

This is an example for LAnnTextPointer::LAnnTextPointer(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnTextPointer LeadATextPointer(TRUE) ;

//...
}

This is an example for LAnnTextPointer::LAnnTextPointer(hTextPointer):

L_VOID TestConstructor (HANNOBJECT& hTextPointer)
{
// this will call the constructor and destructor when it is out of scope
LAnnTextPointer LeadAFTR(hTextPointer) ;

//...
}


LAnnTextPointer::~LAnnTextPointer

#include "ltwrappr.h"

virtual L_VOID LAnnTextPointer::~LAnnTextPointer(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnTextPointer class.

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:

Class Members

Example

For an example, refer to LAnnTextPointer::LAnnTextPointer.


LAnnTextPointer::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandle, LAnnTextPointer::GetUserHandles, LAnnTextPointer::ChangeUserHandle, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom of a TextPointer object
L_VOID ExampleAnnAddUserHandle(LAnnTextPointer *pLTextPointer)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLTextPointer->GetType();
if (uType == ANNOBJECT_TEXTPOINTER)
{
pLTextPointer->GetRect(&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;
pLTextPointer->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLTextPointer->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a TextPointer object."), TEXT("Error"), MB_OK);
}


LAnnTextPointer::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnTextPointer::AddUserHandle and LAnnTextPointer::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandle, LAnnTextPointer::GetUserHandles, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnTextPointer *LTextPointer)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LTextPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LTextPointer->GetUserHandle(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;
LTextPointer->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnTextPointer::Create

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::Create(L_VOID)

Creates a TextPointer annotation object. 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 use the LAnnTextPointer::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnTextPointer LeadTextPointer(FALSE); //construct an annotation note object

if (LeadTextPointer.Create()==SUCCESS)
{
//... do something here
}
}


LAnnTextPointer::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::DeleteUserHandle(nIndex)

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

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: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandle, LAnnTextPointer::GetUserHandles, LAnnTextPointer::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnTextPointer *LTextPointer)
{
L_UINT uCount;

// Get the total count of user handles
LTextPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LTextPointer->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnTextPointer::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::EnumerateHandles()

Calls the LAnnTextPointer::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnTextPointer::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandle, LAnnTextPointer::GetUserHandles, LAnnTextPointer::ChangeUserHandle, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

class MyAnnTextPointer: public LAnnTextPointer
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnTextPointer::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnTextPointer *LTextPointer)
{
LTextPointer->EnableCallBack(TRUE);
LTextPointer->EnumerateHandles();
}


LAnnTextPointer::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnTextPointer::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnTextPointer::EnumerateHandles 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 LAnnTextPointer::ChangeUserHandle.

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.

To enable the LAnnTextPointer::EnumHandleCallBack
 you must call LBase::EnableCallBack
 before calling LAnnTextPointer::EnumerateHandles
 function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::GetUserHandle, LAnnTextPointer::GetUserHandles, LAnnTextPointer::ChangeUserHandle, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnTextPointer::EnumerateHandles.


LAnnTextPointer::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetFixed(pbFixed)

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

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: | Class Members, LAnnTextPointer::SetFixed, LAnnTextPointer::PushFixedState, LAnnTextPointer::PopFixedState, LAnnTextPointer::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnTextPointer::SetFixed.


LAnnTextPointer::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetRotateAngle(pdAngle)

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

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This examples displays the rotate angle of the annotation TextPointer in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnTextPointer * pLTextPointer)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLTextPointer->GetRotateAngle(&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);
}
}


LAnnTextPointer::GetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetTextAlign(puTextAlign)

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

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: | Class Members, LAnnTextPointer::SetTextAlign
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// Sample for LAnnTextPointer::SetTextAlign, LAnnTextPointer::GetTextAlign
// This example changes the text alignment of a text pointer annotation object
L_VOID SampleAnnSetTextAlign(LAnnTextPointer *pLTextPointer)
{
L_INT nRet;
L_UINT uTextAlign;
L_TCHAR szMsg[100];
L_UINT uType;

pLTextPointer->GetTextAlign(&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= pLTextPointer->SetTextAlign(uTextAlign, 0);
if (nRet != SUCCESS)
{
uType = pLTextPointer->GetType();
wsprintf(szMsg, TEXT("SetTextAlign Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnTextPointer::GetTextPointerFixed

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetTextPointerFixed(pbPointerFixed)

L_BOOL *pbPointerFixed;

/* pointer to a variable to be updated */

Gets a value that indicates whether the pointer of an LAnnTextPointer object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
pbPointerFixed | Pointer to a variable to be updated with a value that specifies whether the pointer of an LAnnTextPointer is fixed. Possible values are:
 | Value | Meaning
 | TRUE | The pointer of the LAnnTextPointer object is fixed.
 | FALSE | The pointer of the LAnnTextPointer moves with the object.

Returns

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

Comments

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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// Sample for LAnnTextPointer::GetTextPointerFixed, LAnnTextPointer::SetTextPointerFixed
// This example toggles the text pointer fixed state of an LAnnTextPointer object.
L_VOID SampleAnnSetTextPointerFixed(LAnnTextPointer *pLTextPointer)
{
L_INT nRet;
L_BOOL bTextPointerFixed;
L_TCHAR szMsg[100];
L_UINT uType;

pLTextPointer->GetTextPointerFixed( &bTextPointerFixed);

bTextPointerFixed = !bTextPointerFixed;

nRet= pLTextPointer->SetTextPointerFixed(bTextPointerFixed, 0);
if (nRet != SUCCESS)
{
uType = pLTextPointer->GetType();
wsprintf(szMsg, TEXT("SetTextPointerFixed Error: %d on object type[%d]\n"), nRet,
uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnTextPointer::GetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetTextRotate(puTextRotate)

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

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: | Class Members, LAnnTextPointer::SetTextRotate
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// Sample for LAnnTextPointer::SetTextRotate, LAnnTextPointer::GetTextRotate
// This example changes the text rotation of a text pointer annotation
L_VOID SampleAnnSetTextRotate(LAnnTextPointer *pLTextPointer)
{
L_INT nRet;
L_UINT uTextRotate;
L_TCHAR szMsg[100];
L_UINT uType;

pLTextPointer->GetTextRotate(&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= pLTextPointer->SetTextRotate(uTextRotate, 0);
if (nRet != SUCCESS)
{
uType = pLTextPointer->GetType();
wsprintf(szMsg, TEXT("SetTextRotate Error: %d on object type[%d]\n"), nRet, uType);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnTextPointer::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandles, LAnnTextPointer::ChangeUserHandle, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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\nuStructSize: %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(LAnnTextPointer *LTextPointer)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LTextPointer->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LTextPointer->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnTextPointer::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::GetUserHandles(pAnnHandle, puCount)

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

See Also

Functions: | Class Members, LAnnTextPointer::AddUserHandle, LAnnTextPointer::EnumerateHandles, LAnnTextPointer::EnumHandleCallBack, LAnnTextPointer::GetUserHandle, LAnnTextPointer::ChangeUserHandle, LAnnTextPointer::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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\nuStructSize: %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(LAnnTextPointer * LTextPointer)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LTextPointer->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LTextPointer->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnTextPointer::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnTextPointer::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY. For more information, refer to FixedAnnotations.

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: | Class Members, LAnnTextPointer::SetFixed, LAnnTextPointer::PushFixedState, LAnnTextPointer::PopFixedState, LAnnTextPointer::GetFixed
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLTextPointer -- Pointer to LAnnTextPointer annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnTextPointer *pLTextPointer)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLTextPointer->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnTextPointer::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnTextPointer::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnTextPointer::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnTextPointer::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnTextPointer::PushFixedState / LAnnTextPointer::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnTextPointer::PushFixedState and LAnnTextPointer::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnTextPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnTextPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnTextPointer::PopFixedState (); | Fixed state is still disabled
LAnnTextPointer::PopFixedState (); | Fixed state is enabled

Note that LAnnTextPointer::PushFixedState and LAnnTextPointer::PopFixedState should always be called in pairs.

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: | Class Members, LAnnTextPointer::SetFixed, LAnnTextPointer::PushFixedState, LAnnTextPointer::GetFixed, LAnnTextPointer::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property of all objects in the container that
// have been temporarily disabled with a call to LAnnTextPointer::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnTextPointer *pLTextPointer)
{
pLTextPointer->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnTextPointer::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnTextPointer::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnTextPointer::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnTextPointer::PushFixedState / LAnnTextPointer::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnTextPointer::PushFixedState and LAnnTextPointer::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnTextPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnTextPointer::PushFixedState (); | Fixed state is temporarily disabled
LAnnTextPointer::PopFixedState (); | Fixed state is still disabled
LAnnTextPointer::PopFixedState (); | Fixed state is enabled

Note that LAnnTextPointer::PushFixedState and LAnnTextPointer::PopFixedState should always be called in pairs.

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: | Class Members, LAnnTextPointer::SetFixed, LAnnTextPointer::PopFixedState, LAnnTextPointer::GetFixed, LAnnTextPointer::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example temporarily disables the "fixed" property of all objects in the container.
// This is useful when fixed objects need to be temporarily painted larger or smaller than
// the fixed size. For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnTextPointer *pLTextPointer)
{
pLTextPointer->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnTextPointer::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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: | Class Members, LAnnTextPointer::PushFixedState, LAnnTextPointer::PopFixedState, LAnnTextPointer::GetFixed, LAnnTextPointer::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnTextPointer *pLTextPointer)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLTextPointer->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLTextPointer->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnTextPointer::SetTextAlign

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::SetTextAlign(uTextAlign, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 a text pointer 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.

See Also

Functions: | Class Members, LAnnTextPointer::GetTextAlign
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnTextPointer::GetTextAlign.


LAnnTextPointer::SetTextPointerFixed

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::SetTextPointerFixed(bPointerFixed, uFlags)

L_BOOL bPointerFixed; | /* value that specifies whether the pointer of an TextPointer is fixed */
L_UINT uFlags; | /* flags that determine which objects to process */

Sets a value that indicates whether the pointer of an TextPointer object is fixed. This function is available in the Document/Medical Toolkits.

Parameter | Description
bPointerFixed | Value that specifies whether the pointer of an LAnnTextPointer is fixed. Possible values are:
 | Value | Meaning
 | TRUE | Fixes the pointer of an LAnnTextPointer object.
 | FALSE | Makes the pointer of an LAnnTextPointer 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 LAnnotation::IsSelected and LAnnotation::SetSelectedfunctions.
 | 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

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.

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: | Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example refer to LAnnTextPointer::GetTextPointerFixed.


LAnnTextPointer::SetTextRotate

#include "ltwrappr.h"

virtual L_INT LAnnTextPointer::SetTextRotate(uTextRotate, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 will be rotated.

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: | Class Members, LAnnTextPointer::GetTextRotate
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example refer to LAnnTextPointer::GetTextRotate.


LAnnToolBar::LAnnToolBar

#include "ltwrappr.h"

L_VOID LAnnToolBar::LAnnToolBar(L_VOID)

Constructs and initializes the member variables of the LAnnToolBar object. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the constructor for the LAnnToolBar class.

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:

LAnnToolBar::~LAnnToolBar, Class Members

Example

L_VOID TestConstructor()
{
// this will call the default constructor and destructor when it is out of scope
LAnnToolBar LeadAToolbar ;

//...
}


LAnnToolBar::~LAnnToolBar

#include "ltwrappr.h"

virtual L_VOID LAnnToolBar::~LAnnToolBar(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnToolBar class.

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:

Class Members

Example

For an example, refer to LAnnToolBar::LAnnToolBar.


LAnnToolBar::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::AddUserHandle(pAnnHandle)

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

See Also

Functions: | Class Members, LAnnToolBar::EnumerateHandles, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandle, LAnnToolBar::GetUserHandles, LAnnToolBar::ChangeUserHandle, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a ToolBar
L_VOID ExampleAnnAddUserHandle(LAnnToolBar *pLToolBar)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLToolBar->GetType();
if (uType == ANNOBJECT_AUTOMATION)
{
pLToolBar->GetRect(&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;
pLToolBar->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLToolBar->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a ToolBar."), TEXT("Error"), MB_OK);
}


LAnnToolBar::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnToolBar::AddUserHandle and LAnnToolBar::EnumerateHandles 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.

See Also

Functions: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumerateHandles, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandle, LAnnToolBar::GetUserHandles, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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(LAnnToolBar *LToolBar)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LToolBar->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LToolBar->GetUserHandle(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;
LToolBar->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnToolBar::Create

#include "ltwrappr.h"

virtual HWND LAnnToolBar::Create(hWndParent, pPoint, uAlign, bVisible)

HWND hWndParent; | /* handle to the parent window */
LPPOINT pPoint; | /* pointer to the POINT structure */
L_UINT uAlign; | /* constant for the toolbar allignment */
L_BOOL bVisible; | /* flag that indicates whether the toolbar will be visible */

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

Returns

>0 | Handle of the created toolbar.
=NULL | 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.

See Also

Functions: | LAnnotation::SetOptions, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5

Example

L_VOID TestFunction(HWND hWndParent)
{
LAnnToolBar LeadAToolbar ;
HWND hWnd ;
POINT Point ;
L_UINT uChecked ;

if (LeadAToolbar.IsCreated()
 == FALSE)
{
Point.x = 10 ;
Point.y = 10 ;

LeadAToolbar.Create(hWndParent,&Point,
 ANNTOOLALIGN_LEFT | ANNTOOLALIGN_TOP, TRUE) ;
}

hWnd = LeadAToolbar.GetWndHandle()
 ;

if (hWnd == NULL)
{
MessageBox(NULL,TEXT("A ToolBar
 was not created ..."),TEXT("Notice"),MB_OK) ;
return ;
}

if (LeadAToolbar.IsButtonVisible(ANNTOOL_LINE)
 == FALSE)
LeadAToolbar.SetButtonVisible(ANNTOOL_LINE,TRUE);

uChecked = LeadAToolbar.GetToolChecked()
 ;
if (uChecked != ANNTOOL_LINE)
LeadAToolbar.SetToolChecked(ANNTOOL_LINE)
 ;

//...
//...

LeadAToolbar.Destroy();
}


LAnnToolBar::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::DeleteUserHandle(nIndex)

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

See Also

Functions: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumerateHandles, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandle, LAnnToolBar::GetUserHandles, LAnnToolBar::ChangeUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnToolBar *LToolBar)
{
L_UINT uCount;

// Get the total count of user handles
LToolBar->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LToolBar->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnToolBar::Destroy

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::Destroy(L_VOID);

Call this function to destroy the created annotation toolbar. This function is available in the Document/Medical Toolkits.

Returns

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

Comments

This does not destroy the class 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.

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::EnumerateHandles()

Calls the LAnnToolBar::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnToolBar::EnumHandleCallBack 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.

See Also

Functions: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandle, LAnnToolBar::GetUserHandles, LAnnToolBar::ChangeUserHandle, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

class MyAnnToolBar: public LAnnToolBar
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnToolBar::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnToolBar *LToolBar , LAnnText *pAnnText))
{
LToolBar->EnableCallBack(TRUE);
pAnnText ->EnumerateHandles();
}


LAnnToolBar::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnToolBar::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

Value | Meaning
SUCCESS_CHANGE | [1] Change the object
SUCCESS_NOCHANGE | [2] Do not change the object

Comments

The LAnnToolBar::EnumerateHandles 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 LAnnToolBar::ChangeUserHandle.

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.

To enable the LAnnToolBar::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnToolBar::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

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: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumerateHandles, LAnnToolBar::GetUserHandle, LAnnToolBar::GetUserHandles, LAnnToolBar::ChangeUserHandle, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

Example

For an example, refer to LAnnToolBar::EnumerateHandles.


LAnnToolBar::FreeToolBarButtons

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::FreeToolBarButtons(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 LAnnToolBar::GetToolBarButtons 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.

See Also

Functions: | LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::GetToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

//This example uses the following member variables:
// LAnnotationWindow m_AnnotationWindow
// m_AnnotationWindow should be created and initialized prior to the example
//
// LAnnToolBar m_annToolBar
// mAnnToolBar should be created and initialized prior to the example
void CVCAnnotationToolbar11Dlg::OnButtonToolbarTest()
{
L_UINT uButtons;
pANNBUTTON pButtons;
L_INT nRet;
HGLOBAL hGlobal;
LBitmap myBitmap;

//Assume declaration: LAnnToolBar m_annToolBar
myBitmap.Load(TEXT("d:\\work\\images\\rgbw.bmp"));
myBitmap.Size(TOOLBARIMAGECX, TOOLBARIMAGECY);

// get the number of buttons in the toolbar
nRet = m_annToolBar.GetToolBarButtons(NULL,sizeof(ANNBUTTON),
 &uButtons);
if (nRet == SUCCESS)
{
// allocate an array big enough to
 hold the number of existing buttons + 1
hGlobal = ::GlobalAlloc(GMEM_MOVEABLE,
 (uButtons+1)*sizeof(ANNBUTTON));
pButtons = (pANNBUTTON)::GlobalLock(hGlobal);
if (pButtons)
{
// get the
 existing buttons
nRet = m_annToolBar.GetToolBarButtons(pButtons,sizeof(ANNBUTTON),
 &uButtons);
if (nRet ==
 SUCCESS)
{
// add a new user defined tool button
pButtons[uButtons].uFlags = 0;
pButtons[uButtons].uTool = ANNTOOL_USER;
pButtons[uButtons].pBitmapUp = myBitmap.GetHandle();
pButtons[uButtons].pBitmapDown = pButtons[uButtons].pBitmapUp;
pButtons[uButtons].nToolTipTextID = -1;
pButtons[uButtons].pToolTipText = TEXT("Tool Tip");

m_annToolBar.SetToolBarButtons(pButtons,
 uButtons+1);

// free uButtons
m_annToolBar.FreeToolBarButtons(pButtons,
 uButtons);

::GlobalUnlock(pButtons);
::GlobalFree(hGlobal);

//Change
 the number of rows and columns
ANNTOOLBARINFO
 annToolBarInfo;
m_annToolBar.GetToolBarInfo(&annToolBarInfo,
 sizeof(annToolBarInfo));
if
 (annToolBarInfo.uRows > 1)
{
m_annToolBar.SetToolBarColumns(annToolBarInfo.uColumns
 + 1);
//
 or do the line below
//m_annToolBar.SetToolBarRows(annToolBarInfo.uRows
 -1);
}
}
else
AfxMessageBox(TEXT("Error
 getting toolbar buttons."));
}
else
AfxMessageBox(TEXT("Not
 enough memory to allocate pButtons."));
}
else
AfxMessageBox(TEXT("Error getting
 uButtons."));
}


LAnnToolBar::GetToolBarButtons

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::GetToolBarButtons(pButtons, uStructSize, puButtons)

pANNBUTTON pButtons; | /* address of a variable to be updated */
L_UINT uStructSize; | /* size of the structure */
L_UINT L_FAR * puButtons; | /* address of a variable to be updated */

Retrieves information about the buttons in the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
pButtons | Pointer to an array of ANNBUTTON structures to be updated with information about the buttons in the annotation toolbar.
uStructSize | Size in bytes, of the structure pointed to by pButtons, for versioning. Use sizeof(ANNBUTTON).
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.

See Also

Functions: | LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::FreeToolBarButtons.


LAnnToolBar::GetToolBarInfo

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::GetToolBarInfo(pInfo, uStructSize)

pANNTOOLBARINFO pInfo; | /* address of the variable to be updated */
L_UINT uStructSize; | /* size of the structure */

Gets information about the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
pInfo | Address of the ANNTOOLBARINFO variable to be updated with the toolbar information.
uStructSize | Size in bytes, of the structure pointed to by pInfo, for versioning. Use sizeof(ANNTOOLBARINFO).

Returns

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

Comments

To change the number of rows, call LAnnToolBar::SetToolBarRows. To change the number of columns, call LAnnToolBar::SetToolBarColumns.

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: | LAnnotation::SetOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::FreeToolBarButtons.


LAnnToolBar::GetToolChecked

#include "ltwrappr.h"

virtual L_UINT LAnnToolBar::GetToolChecked(L_VOID)

Gets the selected tool in the annotation toolbar. This function is available in the Document/Medical Toolkits.

Returns

The constant for the selected tool. For a list of possible values, refer to Annotation Toolbar 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.

See Also

Functions: | LAnnotation::SetOptions, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::GetUserHandle(nIndex, pAnnHandle)

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

See Also

Functions: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumerateHandles, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandles, LAnnToolBar::ChangeUserHandle, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnToolBar *LToolBar)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LToolBar->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LToolBar->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnToolBar::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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.

See Also

Functions: | Class Members, LAnnToolBar::AddUserHandle, LAnnToolBar::EnumerateHandles, LAnnToolBar::EnumHandleCallBack, LAnnToolBar::GetUserHandle, LAnnToolBar::ChangeUserHandle, LAnnToolBar::DeleteUserHandle
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations

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\nuStructSize: %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(LAnnToolBar * LToolBar)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LToolBar->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LToolBar->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnToolBar::GetWndHandle

#include "ltwrappr.h"

virtual HWND LAnnToolBar::GetWndHandle(L_VOID)

Gets the window handle of the annotation toolbar. This function is available in the Document/Medical Toolkits.

Returns

The handle of the annotation toolbar, or NULL if the toolbar is not created.

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:

Class Members

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::IsButtonVisible

#include "ltwrappr.h"

virtual L_BOOL LAnnToolBar::IsButtonVisible(uButton)

L_UINT uButton;

/* constant that specifies the tool */

Determines whether the specified tool on the annotation toolbar is currently visible. This function is available in the Document/Medical Toolkits.

Parameter | Description
uButton | The constant that specifies the tool. For a list of possible values, refer to Annotation Toolbar Buttons.

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.

See Also

Functions: | LAnnotation::SetOptions, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::IsCreated

#include "ltwrappr.h"

virtual L_BOOL LAnnToolBar::IsCreated(L_VOID)

Determines whether the annotation toolbar is created or not. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The annotation toolbar was created.
FALSE | The annotation toolbar was not created.

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:

Class Members

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::SetButtonVisible

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::SetButtonVisible(uButton, bVisible)

L_UINT uButton; | /* constant that specifies the tool */
L_BOOL bVisible; | /* flag that specifies the visibility of the tool */

Shows or hides the specified tool on the annotation toolbar. This function is available in the Document/Medical Toolkits.

Parameter | Description
uButton | The constant that specifies the tool. For a list of possible values, refer to Annotation Toolbar Buttons.
bVisible | 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.

See Also

Functions: | LAnnotation::SetOptions, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::Create.


LAnnToolBar::SetToolBarButtons

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::SetToolBarButtons(pButtons, uButtons)

pANNBUTTON pButtons; | /* ANNBUTTON structure that contains button information to be set */
L_UINT uButtons; | /* 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
pButtons | Array of ANNBUTTON structures that contains information about the toolbar buttons to set.
uButtons | 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.

See Also

Functions: | LAnnotation::GetOptions, LAnnotation::SetOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarButtons, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns, LAnnToolBar::SetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::FreeToolBarButtons.


LAnnToolBar::SetToolBarColumns

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::SetToolBarColumns(uColumns)

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

See Also

Functions: | LAnnotation::SetOptions, LAnnToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarRows
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::FreeToolBarButtons.


LAnnToolBar::SetToolBarRows

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::SetToolBarRows(uRows)

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

See Also

Functions: | LAnnotation::SetOptions, LAnn ToolBar::Create, LAnnToolBar::GetToolChecked, LAnnToolBar::SetToolChecked, LAnnToolBar::IsButtonVisible, LAnnToolBar::SetButtonVisible, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::SetToolBarButtons, LAnnToolBar::FreeToolBarButtons, LAnnToolBar::GetToolBarInfo, LAnnToolBar::SetToolBarColumns
Topics: | Annotation Functions: Working with the Toolbar
 | Implementing Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::FreeToolBarButtons.


LAnnToolBar::SetToolChecked

#include "ltwrappr.h"

virtual L_INT LAnnToolBar::SetToolChecked(uChecked)

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
uChecked | The constant that specifies the selected tool. For a list of possible values, refer to Annotation Toolbar Buttons.

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.

See Also

Functions: | LAnnotation::SetOptions, Class Members
Topics: | Annotation Functions: Implementing Automation
 | Implementing Annotations
 | Automated User Interface for Annotations
 | New Annotation Features of Version 14.5

Example

For an example, refer to LAnnToolBar::Create.


LAnnVideo::LAnnVideo

#include "ltwrappr.h"

L_VOID LAnnVideo::LAnnVideo(bCreate=TRUE)

L_VOID LAnnVideo::LAnnVideo(hVideo)

L_BOOL bCreate; | /* flag that indicates whether to create the associated annotation object */
HANNOBJECT & hVideo; | /* handle of the associated annotation object */

Constructs and initializes the member variables of the LAnnVideo object. This function is available in the Document/Medical Toolkits.

Parameter | Description
hVideo | Handle of the associated annotation object.
bCreate | Flag that indicates whether to create the associated annotation object. Possible values are:
 | Value | Meaning
 | TRUE | Create the associated Annotation object, as well as the class object.
 | FALSE | Create only the class object. Do not create the associated annotation object.

Returns

None

Comments

LAnnVideo::LAnnVideo(bCreate) is a constructor for the LAnnVideo class. If bCreate is TRUE, the annotation object is created, as well as the class object.

LAnnVideo::LAnnVideo(hNote) attaches the passed handle to the created class object. The passed handle must be a LEAD annotation object of type ANNOBJECT_VIDEO. The passed annotation object is invalidated.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions:

LAnnVideo::~LAnnVideo, Class Members

Example

This is an example for LAnnVideo::LAnnVideo(bCreate):

L_VOID TestConstructor()
{
// this will call the constructor and destructor when it is out of scope
LAnnVideo LeadAVideo(TRUE) ;

//...
}

This is an example for LAnnVideo::LAnnVideo(hVideo):

L_VOID TestConstructor (HANNOBJECT& hVideo)
{
// this will call the constructor and destructor when it is out of scope
LAnnVideo LeadAVideo(hVideo) ;

//...
}


LAnnVideo::~LAnnVideo

#include "ltwrappr.h"

virtual L_VOID LAnnVideo::~LAnnVideo(L_VOID)

Destroys the object and frees any resources associated with it. This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LAnnVideo class.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions:

Class Members

Example

For an example, refer to LAnnVideo::LAnnVideo.


LAnnVideo::AddUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnVideo::AddUserHandle(pAnnHandle)

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
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 LAnnVideo 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
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::EnumerateHandles, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandle, LAnnVideo::GetUserHandles, LAnnVideo::ChangeUserHandle, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This example adds user handles to the center of the top and bottom lines of a Video
L_VOID ExampleAnnAddUserHandle(LAnnVideo *pLVideo)
{
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;

uType = pLVideo->GetType();
if (uType == ANNOBJECT_VIDEO)
{
pLVideo->GetRect(&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;
pLVideo->AddUserHandle(&AnnHandle);

AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
pLVideo->AddUserHandle(&AnnHandle);
}
else
MessageBox(NULL, TEXT("Annotation object must be a Video."), TEXT("Error"), MB_OK);
}


LAnnVideo::ChangeUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnVideo::ChangeUserHandle(nIndex, pAnnHandle)

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
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 LAnnVideo::AddUserHandle and LAnnVideo::EnumerateHandles and LAnnVideo::GetUserHandles functions.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumerateHandles, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandle, LAnnVideo::GetUserHandles, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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(LAnnVideo *LVideo)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LVideo->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LVideo->GetUserHandle(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;
LVideo->ChangeUserHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnVideo::Create

#include "ltwrappr.h"

virtual L_INT LAnnVideo::Create(L_VOID)

Creates a Video annotation object. 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 use the LAnnVideo::SetXXX() 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 LAnnContainer::EnumerateCallBack virtual function!

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Creating and Deleting Annotations
 | Implementing Annotations
 | Types of Annotations

Example

L_VOID TestFunction()
{
LBase::LoadLibraries(LT_ALL_LEADLIB); //make sure all libraries are loaded

LAnnVideo LeadVideo(FALSE); //construct an annotation note object

if (LeadVideo.Create()==SUCCESS)
{
//... do something here
}
}


LAnnVideo::DeleteUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnVideo::DeleteUserHandle(nIndex)

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

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumerateHandles, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandle, LAnnVideo::GetUserHandles, LAnnVideo::ChangeUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

// This examples deletes the first user handle of an object
L_VOID ExampleAnnDeleteUserHandle(LAnnVideo *LVideo)
{
L_UINT uCount;

// Get the total count of user handles
LVideo->GetUserHandles(NULL, &uCount);
if (uCount > 0)
LVideo->DeleteUserHandle(0);
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnVideo::EnumerateHandles

#include "ltwrappr.h"

virtual L_INT LAnnVideo::EnumerateHandles()

Calls the LAnnVideo::EnumHandleCallBack function for ALL handles (both default and user-defined) for an annotation object. This function is available in the Document/Medical Toolkits.

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 LAnnVideo::EnumHandleCallBack function.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandle, LAnnVideo::GetUserHandles, LAnnVideo::ChangeUserHandle, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

class MyAnnVideo: public LAnnVideo
{
public:
virtual L_INT EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo);
};

L_INT MyAnnVideo::EnumHandleCallBack(HANNOBJECT hObject, pANNHANDLEINFO pHandleInfo)
{
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(MyAnnVideo *LVideo)
{
LVideo->EnableCallBack(TRUE);
LVideo->EnumerateHandles();
}


LAnnVideo::EnumHandleCallBack

#include "ltwrappr.h"

virtual L_INT LAnnVideo::EnumHandleCallBack(hObject, pHandleInfo)

HANNOBJECT hObject; | /* handle to the annotation object */
pANNHANDLEINFO pHandleInfo; | /* pointer to structure containing information about the annotation object handle */

Processes each annotation object from the LAnnVideo::EnumerateHandles function. This function is available in the Document/Medical Toolkits.

Parameter | Description
hObject | Handle of the annotation object being processed.
pHandleInfo | Pointer to structure that contains information about the annotation object handle.

Returns

SUCCESS_CHANGE | [1] Change the object.
SUCCESS_NOCHANGE | [2] Do not change the object.

Comments

The LAnnVideo::EnumerateHandles 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 LAnnVideo::ChangeUserHandle.

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.

To enable the LAnnVideo::EnumHandleCallBack you must call LBase::EnableCallBack before calling LAnnVideo::EnumerateHandles function.

For more information, refer to the documentation for ANNHANDLEINFO.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumerateHandles, LAnnVideo::GetUserHandle, LAnnVideo::GetUserHandles, LAnnVideo::ChangeUserHandle, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

Example

For an example, refer to LAnnVideo::EnumerateHandles.


LAnnVideo::GetFixed

#include "ltwrappr.h"

virtual L_INT LAnnVideo::GetFixed(pbFixed)

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

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::SetFixed, LAnnVideo::PushFixedState, LAnnVideo::PopFixedState, LAnnVideo::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

For an example, refer to LAnnVideo::SetFixed.


LAnnVideo::GetRotateAngle

#include "ltwrappr.h"

virtual L_INT LAnnVideo::GetRotateAngle(pdAngle)

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

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members,
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations

Example

// This examples displays the rotation angle of the Video annotation object in radians and degrees
L_VOID ExampleAnnGetRotateAngle(LAnnVideo * pLVideo)
{
L_DOUBLE dAngle;
L_INT nRet;
L_TCHAR szMsg[200];

nRet = pLVideo->GetRotateAngle(&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);
}
}


LAnnVideo::GetText

#include "ltwrappr.h"

virtual L_INT LAnnVideo::GetText(pText)

L_TCHAR L_FAR * pText;

/* character string to be updated with the annotation object's character string */

Gets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | 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.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

void CVCAnnotation11Dlg::OnButton5()
{
L_UNLOCKSUPPORT(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
LAnnVideo MyAnnVideo;
L_TCHAR szTemp[100], szFileName[100];

MyAnnVideo.SetText(TEXT("c:\\video.avi"));
L_UINT uFileLen = MyAnnVideo.GetTextLen();
MyAnnVideo.GetText(szFileName);
wsprintf(szTemp,
TEXT("Capture File Name: %s\nCapture File Name Length: %d"),
szFileName,
uFileLen);
AfxMessageBox(szTemp);
}


LAnnVideo::GetTextLen

#include "ltwrappr.h"

virtual L_UINT LAnnVideo::GetTextLen(L_VOID)

Gets the length of the annotation object's text (character string). This function is available in the Document/Medical Toolkits.

Returns

The length of the object's character string.

Comments

Use this value to allocate a buffer to read the text property.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnVideo::GetText.


LAnnVideo::GetUserHandle

#include "ltwrappr.h"

virtual L_INT LAnnVideo::GetUserHandle(nIndex, pAnnHandle)

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
nIndex | Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER.
pAnnHandle | Pointer to a 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 Video 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
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumerateHandles, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandles, LAnnVideo::ChangeUserHandle, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnVideo *LVideo)
{
L_UINT uCount;
ANNHANDLE AnnHandle;

// Get the total count of user handles
LVideo->GetUserHandles(NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
LVideo->GetUserHandle(0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}


LAnnVideo::GetUserHandles

#include "ltwrappr.h"

virtual L_INT LAnnVideo::GetUserHandles(pAnnHandle, puCount)

pANNHANDLE pAnnHandle; | /* array of 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
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
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::AddUserHandle, LAnnVideo::EnumerateHandles, LAnnVideo::EnumHandleCallBack, LAnnVideo::GetUserHandle, LAnnVideo::ChangeUserHandle, LAnnVideo::DeleteUserHandle, LAnnContainer::Convert, LAnnContainer::HitTestExt, LAnnContainer::RestrictCursor, LAnnotation::GetRestrictToContainer, LAnnotation::SetRestrictToContainer, LAnnotation::Define2, LAnnotation::Define
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Annotation Functions: Implementing Custom Annotations
 | Annotation Functions: Creating Custom Annotations

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\nuStructSize: %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(LAnnVideo * LVideo)
{
L_UINT i;
L_UINT uCount;
pANNHANDLE pAnnHandle;

// Get the total count of user handles, and allocate memory
LVideo->GetUserHandles(NULL, &uCount);
pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));

LVideo->GetUserHandles(pAnnHandle, &uCount);
for (i = 0; i<uCount; i++)
DumpAnnHandle(i, pAnnHandle + i);

free(pAnnHandle);
}


LAnnVideo::IsFixedInRect

#include "ltwrappr.h"

virtual L_INT LAnnVideo::IsFixedInRect(prc, uFlags)

LPRECT prc; | /* address of variable representing client area */
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
prc | Address of a RECT variable representing a client area of a window. This can be NULL. For more information, see comments 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 LAnnotation::IsSelected and LAnnotation::SetSelected 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

TRUE | There is a fixed annotation object in the client area.
FALSE | There are no fixed annotation objects in the client area.

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:

LDoubleBuffer::Begin

LDoubleBuffer::CreateHandle

LDoubleBuffer::DestroyHandle

LDoubleBuffer::EnableDoubleBuffer

LDoubleBuffer::End

A successful call to LAnnVideo::IsFixedInRect 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

For more information, refer to Fixed Annotations.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::SetFixed, LAnnVideo::PushFixedState, LAnnVideo::PopFixedState, LAnnVideo::GetFixed
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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
// pLVideo -- Pointer to LAnnVideo annotation object.
L_VOID SampleAnnIsFixedInRect(HWND hWnd, LAnnVideo *pLVideo)
{
RECT rcClient;
L_BOOL bFixedInRect;
L_TCHAR *pszMsg;

GetClientRect(hWnd, &rcClient);
bFixedInRect = pLVideo->IsFixedInRect(&rcClient, ANNFLAG_RECURSE);
pszMsg = bFixedInRect ? TEXT("There are fixed annotations visible") : TEXT("There are NO fixed annotations visible");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}


LAnnVideo::PopFixedState

#include "ltwrappr.h"

virtual L_INT LAnnVideo::PopFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnVideo::PushFixedState.

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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnVideo::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnVideo::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnVideo::PushFixedState / LAnnVideo::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnVideo::PushFixedState and LAnnVideo::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnVideo::PushFixedState (); | Fixed state is temporarily disabled
LAnnVideo::PushFixedState (); | Fixed state is temporarily disabled
LAnnVideo::PopFixedState (); | Fixed state is still disabled
LAnnVideo::PopFixedState (); | Fixed state is enabled

Note that LAnnVideo::PushFixedState and LAnnVideo::PopFixedState should always be called in pairs.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::SetFixed, LAnnVideo::PushFixedState, LAnnVideo::GetFixed, LAnnVideo::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

Example

// This example enables the"fixed" property fo all objects in the container that
// have been temporarily disabled with a call to LAnnVideo::PushFixedState.
// For an example using the magnifying glass, see the source code
// for the main Class Library annotation demo.
L_VOID SampleAnnPopFixedState(LAnnVideo *pLVideo)
{
pLVideo->PopFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnVideo::PushFixedState

#include "ltwrappr.h"

virtual L_INT LAnnVideo::PushFixedState(uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

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 LAnnVideo::PushFixedState on the fixed annotation before the magnifying glass paint. After the paint, call LAnnVideo::PopFixedState to restore the annotation object’s fixed state.

Typically, you would call LAnnVideo::PushFixedState / LAnnVideo::PopFixedState on the root annotation container, passing ANNFLAG_RECURSE to temporarily disable the fixed state of ALL annotation objects.

Calls to LAnnVideo::PushFixedState and LAnnVideo::PopFixedState are maintained internally as a stack. This means that nested calls will behave properly. For example,

LAnnVideo::PushFixedState (); | Fixed state is temporarily disabled
LAnnVideo::PushFixedState (); | Fixed state is temporarily disabled
LAnnVideo::PopFixedState (); | Fixed state is still disabled
LAnnVideo::PopFixedState (); | Fixed state is enabled

Note that LAnnVideo::PushFixedState and LAnnVideo::PopFixedState should always be called in pairs.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::SetFixed, LAnnVideo::PopFixedState, LAnnVideo::GetFixed, LAnnVideo::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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 Class Library annotation demo.
L_VOID SampleAnnPushFixedState(LAnnVideo *pLVideo)
{
pLVideo->PushFixedState(ANNFLAG_RECURSE | ANNFLAG_NOINVALIDATE);
}


LAnnVideo::SetFixed

#include "ltwrappr.h"

virtual L_INT LAnnVideo::SetFixed(bFixed, bAdjust, uFlags)

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
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 LAnnotation::IsSelected and LAnnotation::SetSelected 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 LAnnotation::SetScalarX, LAnnotation::SetScalarY, LAnnotation::SetOffsetX, and LAnnotation::SetOffsetY.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members, LAnnVideo::PushFixedState, LAnnVideo::PopFixedState, LAnnVideo::GetFixed, LAnnVideo::IsFixedInRect
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations
 | Fixed Annotations
 | Minimizing Flicker With Double Buffering

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(LAnnVideo *pLVideo)
{
L_BOOL bFixed;
L_INT nRet;
L_TCHAR *pszMsg;
L_TCHAR szMsg[200];

nRet = pLVideo->GetFixed(&bFixed);
if (nRet == SUCCESS)
{
bFixed = !bFixed;
pLVideo->SetFixed(bFixed, TRUE, 0);
pszMsg = bFixed ? TEXT("Fixed") : TEXT("Not Fixed");
MessageBox(NULL, pszMsg, TEXT(""), MB_OK);
}
else
{
wsprintf(szMsg, TEXT("GetFixed failed: [%d]"), nRet);
MessageBox(NULL, szMsg, TEXT("Error"), MB_OK);
}
}


LAnnVideo::SetText

#include "ltwrappr.h"

virtual L_INT LAnnVideo::SetText(pText, uFlags=0)

L_TCHAR L_FAR * pText; | /* character string to assign */
L_UINT uFlags; | /* flags that indicate the object to process */

Sets the text (character string) of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
pText | The character string to assign to the annotation object.
uFlags | Flags that indicate the object to process. 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 LAnnotation::IsSelected and LAnnotation::SetSelected functions.
 | 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.

Required DLLs and Libraries

LTANN
LTMM

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

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

See Also

Functions: | Class Members
Topics: | Annotation Functions: Object Properties

Example

For an example, refer to LAnnVideo::GetText.


LBase::LBase

#include "ltwrappr.h"

L_VOID LBase::LBase (L_VOID)

Constructs and initializes the member variables of the LBase object.

Returns

None

Comments

This is the constructor for the LBase class.

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

Elements:

LBase::~LBase, Class Members

Example

// this will call the default constructor and destructor when it is out of scope
LBase base;


LBase::~LBase

#include "ltwrappr.h"

L_VOID LBase::~LBase (L_VOID)

Destroys the class object and frees any allocated memory for the internal error list.

Returns

None

Comments

This is the destructor for the LBase class.

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

Elements:

LBase::LBase, Class Members

Example

// this will call the default constructor and destructor when it is out of scope
LBase base;


LBase::ClearErrorList

#include "ltwrappr.h"

static L_VOID LBase::ClearErrorList (L_VOID)

Clears the internal error list and deletes all previously recorded errors.

Returns

None

Comments

Call this function to clear the internal error list and delete all previously recorded errors. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError LBase::GetErrorListDepth, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, Class Members.

Example

LBitmap LeadBitmap ;
// do your processing
…
LeadBitmap.ClearErrorList();


LBase::DecodeABIC

#include "ltwrappr.h"

static L_INT LBase::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

This 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. The length of the output buffer can be calculated as follows:

bBiLevel = TRUE | nLength = ( ( (nWidth + 31) >> 3) & ~3)
bBiLevel = FALSE | nLength = ( ( (nWidth * 4 + 31) >> 3) & ~3)

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: | LBase::EncodeABIC
Topics: | Compressing and Decompressing Buffers
 | Raster Image Functions: Compression Functions

Example

#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( LBitmapBase& Bitmap )
{
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 = LBase::DecodeABIC( pData, nLength, &pOutData, 4, 472 /* width */, 221 /* height */, FALSE );
GlobalFreePtr( pData );
if( SUCCESS == nRet )
{
if(Bitmap.IsAllocated())
Bitmap.Free();

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 = Bitmap.ConvertFromDIB( &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 = Bitmap.PutColors( 0, 16, MyGrayPal );

GlobalFreePtr( pOutData );
return ( SUCCESS == nRet ? 0 : -1 );
}
}
return -1;
}


LBase::DisplayError

#include "ltwrappr.h"

static L_VOID LBase::DisplayError (hWndParent, lpszStr)

static L_VOID LBase::DisplayError (hWndParent, nErrorCode)

HWND hWndParent; | /* handle to the parent window */
L_TCHAR L_FAR * lpszStr; | /* pointer to the error string */
L_INT nErrorCode; | /* a LEADTOOLS error code */

Displays an error string.

Parameter | Description
hWndParent | Window handle to the parent window of the message box.
lpszStr | Pointer to the error string to be displayed in the message box.
nErrorCode | One of the LEADTOOLS error codes. If you specify an invalid error code, the message displayed will be "Not a LEADTOOLS error code".

Returns

None

Comments

Call DisplayError (hWndParent, lpStr ) to display your own error string. This function calls the windows MessageBox() function to display the specified error string. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

Call DisplayError (hWndParent, nErrorCode) to display the error string for the specified LEADTOOLS error code.

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

Elements:

LBase::GetErrorString, LBase::SetErrorString, LBase::IsAutoErrorDisplayEnabled, LBase::SetErrorListDepth, LBase::EnableAutoErrorDisplay, LBase::GetErrorFromList, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

L_VOID TestFunction(HWND hWndParent)
{
LBitmap MyBitmap;

MyBitmap.Load(TEXT("Image1.cmp"));
L_INT nRetCode=MyBitmap.AddNoise();
if(nRetCode!=SUCCESS)
LBase::DisplayError(hWndParent, LBase::GetErrorString(nRetCode));
}

LBase Base;
Base.DisplayError(NULL, WRPERR_BITMAP_NOT_ALLOCATED);


LBase::DisplayErrorFromList

#include "ltwrappr.h"

static L_VOID LBase::DisplayErrorFromList (hWndParent=NULL, uIndex=LEAD_LAST_ERROR)

HWND hWndParent; | /* window handle of the parent window */
L_UINT uIndex; | /* index of the recorded error code */

Displays the error string for the error code indexed by uIndex.

Parameter | Description
hWndParent | Window handle of the parent window of the errors dialog.
uIndex | Index into the list of recorded error codes. Pass the index of the recorded error code to display its string. If an invalid index is specified, the last error recorded will be displayed.

Returns

None

Comments

Call this function to display the error string for the error code indexed by the specified index. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

Note: If the error code in the internal error list is not a valid LEADTOOLS error code, the message that is displayed will be "Not a LEADTOOLS error code".

Note: If the internal error list is empty, the message that is displayed will be "Success".

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, Class Members

Example

For an example, refer to LBase::GetErrorFromList.


LBase::DisplayErrorList

#include "ltwrappr.h"

static L_VOID LBase::DisplayErrorList (hWndParent, bShowLastErrorFirst=TRUE)

HWND hWndParent; | /* window handle of the parent window */
L_BOOL bShowLastErrorFirst; | /* flag that indicates the order of the errors */

Displays all the errors recorded in the error list.

Parameter | Description
hWndParent | Window handle of the parent window of the errors dialog.
bShowLastErrorFirst | Flag that indicates the order to use when displaying the errors. Possible values are:
Value | Meaning
TRUE | Display the last error first.
FALSE | Display the oldest error first.

Returns

None

Comments

Call this function to display all the errors recorded in the error list. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions. This function will display a dialog box with a listbox that contains all the error strings for the currently recorded errors.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorFromList, Class Members

Example

L_VOID MyFunction(HWND hWndParent)
{
LBitmap LeadBitmap;
// do your processing
//…
LeadBitmap.DisplayErrorList(hWndParent);
}


LBase::EnableAutoErrorDisplay

#include "ltwrappr.h"

static L_BOOL LBase::EnableAutoErrorDisplay (bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable or disable auto error display */

Enables or disables automatic error display for the class object.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable auto error display for the class object.

Returns

The previous setting.

Comments

Call this function to enable or disable automatic error display. When automatic error display is enabled, every error recorded to the internal error list will be displayed immediately in a MessageBox. You can use this for debugging purposes or when you do not wish to provide your own error display. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::GetErrorString, LBase::SetErrorString, LBase::DisplayError, LBase::SetErrorListDepth, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

For an example, refer to LBase::IsAutoErrorDisplayEnabled.


LBase::EnableCallBack

#include "ltwrappr.h"

L_BOOL LBase::EnableCallBack (bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable or disable the callback functions */

Enables or disables the callback functions.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the callback functions. Possible values are:
 | Value | Meaning
 | TRUE | Enable the callback functions.
 | FALSE | Disable the callback functions.

Returns

The previous setting.

Comments

Call this function to enable or disable the callback overridable functions for your class object. This will enable or disable the callback functions which exist in the calling object. Other objects will not be affected by this function. All LEADTOOLS Class Library classes use this setting to enable or disable the various callback functions which exist in classes derived from LBase.

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

Elements:

LBase::IsCallBackEnabled, Class Members

Example

LBitmap MyBitmap , Bitmap2;

Bitmap2. Load (TEXT("Image1.cmp"),24); //load the bitmap at 24 bitsperpixel

if(MyBitmap. IsCallBackEnabled ()==FALSE);
MyBitmap.EnableCallBack(TRUE);

//since the callback functions are enabled for MyBitmap object then
//LBitmapBase::ColorResBitmapCallBack() function for this object will be called repeatedly

MyBitmap.ColorRes(Bitmap2, 8);


LBase::EnableOverlayCallBack

#include "ltwrappr.h"

L_BOOL LBase::EnableOverlayCallBack (bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable or disable the Overlay callback function */

Enables or disables the Overlay callback function for the class object.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the Overlay callback function for the specific object.

Returns

The previous setting.

Comments

Call this function to enable or disable the Overlay callback for your class object.

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

Elements:

LBase::IsOverlayCallBackEnabled, LBase::OverlayCallBack, Class Members

Example

For an example, refer to LBase::OverlayCallBack.


LBase::EnableStatusCallBack

#include "ltwrappr.h"

L_BOOL LBase::EnableStatusCallBack (bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable or disable the status callback function */

Enables or disables the status callback function for the class object.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the status callback function for the specific object.

Returns

The previous setting.

Comments

Call this function to enable or disable the status callback for your class object.

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

Elements:

LBase::IsStatusCallBackEnabled, LBase::StatusCallBack, Class Members

Example

For an example, refer to LBase::StatusCallBack.


LBase::EncodeABIC

#include "ltwrappr.h"

static L_INT LBase::EncodeABIC(pInputData, nLength, ppOutputData, nAlign, nWidth, nHeight, 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.

See Also

Functions: | LBase::DecodeABIC
Topics: | Compressing and Decompressing Buffers
 | Raster Image Functions: Compression Functions

Example

L_INT myEncodeABIC( LBitmapBase& Bitmap )
{
L_UCHAR *pData;
L_UCHAR *pOutData;
L_INT nOutLength;
L_INT nRet;
FILE *pFile;

LMemoryFile Memfile;
LBuffer Buffer;

nRet = 0;
if( Bitmap.IsAllocated() )
{
nOutLength = 0;
pOutData = NULL;
Memfile.SetBitmap(&Bitmap);
nRet = Memfile.SaveBitmap( &Buffer, FILE_RAW, Bitmap.GetBitsPerPixel(), 0, NULL );
if( SUCCESS == nRet )
{
pData = (L_UCHAR *)GlobalLock( Buffer.GetHandle() );

nRet = LBase::EncodeABIC( pData, 4, Bitmap.GetWidth(), Bitmap.GetHeight(), &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( Buffer.GetHandle() );
GlobalFree( Buffer.GetHandle() );
}
}
else
{
MessageBox( AfxGetApp()->m_pMainWnd->GetSafeHwnd(), "Do decode first please!", "Information!", MB_OK | MB_ICONINFORMATION);

nRet = 0;
}

return nRet;
}


LBase::GetErrorFromList

#include "ltwrappr.h"

static L_INT LBase::GetErrorFromList (uIndex=LEAD_LAST_ERROR)

L_UINT uIndex;

/* index of the error to get from the list */

Retrieves an error code from the internal error list.

Parameter | Description
uIndex | The index of the error to get from the error list. If an invalid index is specified, the last error recorded will be returned.

Returns

SUCCESS | The internal error list was empty.
< 1 | The error code of the error indexed by uIndex. Refer to Return Codes.

Comments

Call this function to retrieve an error code from the internal error list. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::SetErrorListDepth, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

L_VOID MyFunction(HWND hWndParent)
{
LBitmap MyBitmap;

MyBitmap.Load(TEXT("Image1.cmp"));
MyBitmap.AddNoise();

if(LBase::GetErrorFromList()!=SUCCESS)
LBase::DisplayErrorFromList(hWndParent);
}


LBase::GetErrorListDepth

#include "ltwrappr.h"

static L_UINT LBase::GetErrorListDepth (L_VOID)

Retrieves the current size of the internal error list.

Returns

The current depth of the internal error list.

Comments

Call this function to retrieve the current size of the internal error list. This size represents the maximum number of errors that can be recorded in the list before overwriting the oldest error 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.

See Also

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

LBitmap LeadBitmap;
L_INT nErrorDepth;
// do your processing
…
nErrorDepth = LeadBitmap.GetErrorListDepth();


LBase::GetErrorsNumber

#include "ltwrappr.h"

static L_UINT LBase::GetErrorsNumber (L_VOID)

Retrieves the number of errors currently recorded in the error list.

Returns

>0 | The number of recorded errors.
0 | No errors are recorded.

Comments

Call this function to retrieve the number of errors currently recorded in the error list. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::DisplayErrorList, LBase::DisplayErrorFromList, Class Members

Example

LBitmap LeadBitmap;
// do your processing
…
L_INT nErrorCount = LeadBitmap.GetErrorsNumber();


LBase::GetErrorString

#include "ltwrappr.h"

static L_TCHAR L_FAR *LBase::GetErrorString (nErrorCode)

L_INT nErrorCode;

/* a LEADTOOLS error code */

Retrieves a pointer to the internal LEADTOOLS error string for the specified error code.

Parameter | Description
nErrorCode | One of the LEADTOOLS error codes. If you specify an invalid error code, the string returned will be "Not a LEADTOOLS error code".

Returns

A pointer to the LEADTOOLS error code string.

Comments

Call this function to retrieve a pointer to the internal LEADTOOLS error string for the specified error code. This function will return NULL if an invalid error code is passed. You should not attempt to free the buffer returned by 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.

See Also

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayErrorFromList, LBase::DisplayError, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, Class Members

Example

LBitmap LeadBitmap;
L_TCHAR *pcErr = LeadBitmap.GetErrorString(WRPERR_BITMAP_NOT_ALLOCATED);.


LBase::GetLoadedLibraries

#include "ltwrappr.h"

static L_UINT32 LBase::GetLoadedLibraries (L_VOID)

Determines the loaded LEADTOOLS library DLLs

Returns

An L_UINT32 value representing the LEADTOOLS libraries that were loaded successfully. Possible values are:

Value | Meaning
LT_KRN | ltkrnXXn.dll for Non-Unicode or ltkrnXXnu.dll for Unicode was loaded successfully.
LT_DIS | ltdisXXn.dll for Non-Unicode or ltdisXXnu.dll for Unicode was loaded successfully.
LT_FIL | ltfilXXn.dll for Non-Unicode or ltfilXXnu.dll for Unicode was loaded successfully.
LT_IMG | ltimgXXn.dll for Non-Unicode or ltimgXXnu.dll for Unicode was loaded successfully.
LT_EFX | ltefxXXn.dll for Non-Unicode or ltefxXXnu.dll for Unicode was loaded successfully.
LT_DLG | ltdlgXXn.dll for Non-Unicode or ltdlgXXnu.dll for Unicode was loaded successfully.
LT_ISI | ltisiXXn.dll was loaded successfully.
LT_TWN | lttwnXXn.dll for Non-Unicode or lttwnXXnu.dll for Unicode was loaded successfully.
LT_SCR | ltscrXXn.dll for Non-Unicode or ltscrXXnu.dll for Unicode was loaded successfully.
LT_ANN | ltannXXn.dll for Non-Unicode or ltannXXnu.dll for Unicode was loaded successfully.
LT_NET | ltnetXXn.dll for Non-Unicode or ltnetXXnu.dll for Unicode was loaded successfully.
LV_KRN | lvkrnXXn.dll for Non-Unicode or lvkrnXXnu.dll for Unicode was loaded successfully.
LV_DLG | lvdlgXXn.dll for Non-Unicode or lvdlgXXnu.dll for Unicode was loaded successfully.
LT_TMB | lttmbXXn.dll for Non-Unicode or lttmbXXnu.dll for Unicode was loaded successfully.
LT_LST | ltlstXXn.dll for Non-Unicode or ltlstXXnu.dll for Unicode was loaded successfully.
LT_BAR | ltbarXXn.dll for Non-Unicode or ltbarXXnu.dll for Unicode was loaded successfully.
LT_ZMV | ltzmvXXn.dll for Non-Unicode or ltzmvXXnu.dll for Unicode.
LT_IMGOPT | ltimgoptXXn.dll for Non-Unicode or ltimgoptXXnu.dll for Unicode.
LT_ALL_LEADLIB | all available LEADTOOLS libraries were loaded successfully

These values may be combined using the bitwise OR operator ( | ).

Comments

Call this function to check for loaded LEADTOOLS DLLs at run-time.

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

Elements:

LBase::LoadLibraries, LBase::UnloadLibraries, Class Members

Example

The following code will check whether the TWAIN library is loaded or not:

if(LBase::GetLoadedLibraries()&LT_TWN)
{
// TWAIN library is loaded
}
else
{
// TWAIN library is not loaded
}


LBase::IsAutoErrorDisplayEnabled

#include "ltwrappr.h"

static L_BOOL LBase::IsAutoErrorDisplayEnabled (L_VOID)

Indicates whether automatic error display is enabled or not.

Returns

TRUE | Automatic error display is enabled.
FALSE | Automatic error display is disabled.

Comments

Call this function to check whether automatic error display is enabled or not. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::GetErrorString, LBase::SetErrorString, LBase::DisplayError, LBase::SetErrorListDepth, LBase::EnableAutoErrorDisplay, LBase::GetErrorFromList, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

LBitmap MyBitmap;

MyBitmap.Load(TEXT("Image1.cmp"));
if(LBase::IsAutoErrorDisplayEnabled()==FALSE)
LBase::EnableAutoErrorDisplay(TRUE);

MyBitmap.AddNoise(); //now if an error occurs it will be automatically displayed.


LBase::IsCallBackEnabled

#include "ltwrappr.h"

L_BOOL LBase::IsCallBackEnabled (L_VOID)

Indicates whether the callback functions are enabled or disabled for the class object.

Returns

TRUE | The callback functions are enabled.
FALSE | The callback functions are disabled

Comments

Call this function to check if the callback functions are enabled or disabled for this class object.

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

Elements:

LBase::EnableCallBack, Class Members

Example

For an example, refer to LBase::StatusCallBack.


LBase::IsOverlayCallBackEnabled

#include "ltwrappr.h"

L_BOOL LBase::IsOverlayCallBackEnabled (L_VOID)

Indicates whether the overlay callback is enabled or not.

Returns

TRUE | Status callback is enabled.
FALSE | Status callback is disabled.

Comments

Call this function to check whether the overlay callback is enabled or not.

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

Elements:

LBase::EnableOverlayCallBack, LBase::OverlayCallBack, Class Members

Example

For an example, refer to LBase::OverlayCallBack.


LBase::IsStatusCallBackEnabled

#include "ltwrappr.h"

L_BOOL LBase::IsStatusCallBackEnabled (L_VOID)

Indicates whether the status callback is enabled or not.

Returns

TRUE | Status callback is enabled.
FALSE | Status callback is disabled.

Comments

Call this function to check whether the status callback is enabled or not.

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

Elements:

LBase::EnableStatusCallBack, LBase::StatusCallBack, Class Members

Example

For an example, refer to LBase::StatusCallBack.


LBase::LoadLibraries

#include "ltwrappr.h"

static L_UINT32 LBase::LoadLibraries (uLibraries, uSubLibraries = 0)

L_UINT32 uLibraries; | /* flag that indicates which libraries to load */
L_UINT32 uSubLibraries; | /* flag that indicates which sub libraries to load */

Loads a specific set of the LEADTOOLS library DLLs at run-time.

Parameter | Description
uLibraries | Flag that indicates which LEADTOOLS library DLLs to load. Possible values are given below, and may be combined.
 | Value | Meaning
 | LT_KRN | load the ltkrnXXn.dll for Non-Unicode or ltkrnXXnu.dll for Unicode.
 | LT_DIS | load the ltdisXXn.dll for Non-Unicode or ltdisXXnu.dll for Unicode.
 | LT_FIL | load the ltfilXXn.dll for Non-Unicode or ltfilXXnu.dll for Unicode.
 | LT_IMG | load the ltimgXXn.dll for Non-Unicode or ltimgXXnu.dll for Unicode.
 | LT_EFX | load the ltefxXXn.dll for Non-Unicode or ltefxXXnu.dll for Unicode.
 | LT_DLG | load the ltdlgXXn.dll for Non-Unicode or ltdlgXXnu.dll for Unicode.
 | LT_ISI | load the ltisiXXn.dll.
 | LT_TWN | load the lttwnXXn.dll for Non-Unicode or lttwnXXnu.dll for Unicode.
 | LT_SCR | load the ltscrXXn.dll for Non-Unicode or ltscrXXnu.dll for Unicode.
 | LT_ANN | load the ltannXXn.dll for Non-Unicode or ltannXXnu.dll for Unicode.
 | LT_NET | load the ltnetXXn.dll for Non-Unicode or ltnetXXnu.dll for Unicode.
 | LV_KRN | load the lvkrnXXn.dll for Non-Unicode or lvkrnXXnu.dll for Unicode.
 | LV_DLG | load the lvdlgXXn.dll for Non-Unicode or lvdlgXXnu.dll for Unicode.
 | LT_TMB | load the lttmbXXn.dll for Non-Unicode or lttmbXXnu.dll for Unicode.
 | LT_LST | load the ltlstXXn.dll for Non-Unicode or ltlstXXnu.dll for Unicode.
 | LT_BAR | load the ltbarXXn.dll for Non-Unicode or ltbarXXnu.dll for Unicode.
 | LT_ZMV | load the ltzmvXXn.dll for Non-Unicode or ltzmvXXnu.dll for Unicode.
 | LT_IMGOPT | load the ltimgoptXXn.dll for Non-Unicode or ltimgoptXXnu.dll for Unicode.
 | LT_ALL_LEADLIB | load all available LEADTOOLS libraries
 | These values can be combined using the bitwise OR operator ( | ).
uSubLibraries | Flag that indicates which LEADTOOLS dialog library DLLs to load, this value is only valid if uLibraries contains LT_DLG. Possible values are given below, and may be combined.
 | Value | Meaning
 | LT_DLGIMGEFX | load the ltdlgimgefxXXn.dll for Non-Unicode or ltdlgimgefxXXnu.dll for Unicode.
 | LT_DLGEFX | load the ltdlgefxXXn.dll for Non-Unicode or ltdlgefxXXnu.dll for Unicode.
 | LT_DLGFILE | load the ltdlgfileXXn.dll for Non-Unicode or ltdlgfileXXnu.dll for Unicode.
 | LT_DLGIMG | load the ltdlgimgXXn.dll for Non-Unicode or ltdlgimgXXnu.dll for Unicode.
 | LT_DLGIMGDOC | load the ltdlgimgdocXXn.dll for Non-Unicode or ltdlgimgdocXXnu.dll for Unicode.
 | LT_DLGCLR | load the ltdlgclrXXn.dll for Non-Unicode or ltdlgclrXXnu.dll for Unicode.
 | LT_DLGKRN | load the ltdlgkrnXXn.dll for Non-Unicode or ltdlgkrnXXnu.dll for Unicode.
 | LT_DLGWEB | load the ltdlgwebXXn.dll for Non-Unicode or ltdlgwebXXnu.dll for Unicode.
 | LT_ALL_DLG | load all available LEADTOOLS dialogs libraries
 | These values can be combined using the bitwise OR operator ( | ).

Returns

An L_UINT32 value representing the LEADTOOLS libraries that were loaded successfully. This can be any combination of the constants described above.

Comments

Call this function to load a specific set of the LEADTOOLS library DLLs at run-time. The specified constants will determine which libraries you want to load. If the library is already loaded then this function will not load it again. You can use this function to minimize the memory footprint of your program by loading and unloading the libraries you need when necessary.

Note: if you use LT_DLG in the uLibraries parameter without passing any flag in uSubLibraries, all LEAD dialogs will be loaded by default.

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

Elements:

LBase::UnloadLibraries, LBase::GetLoadedLibraries, Class Members

Example

/*The following code will load the LEADTOOLS library for the TWAIN scanner driver (assuming that ltkrnXXn.dll is already loaded), and scan an image to a bitmap:*/

LTwain MyTWAIN;
LBitmapBase MyBitmap;

if(LBase::LoadLibraries(LT_TWN)& LT_TWN)
{
MyTWAIN.SetBitmap(&MyBitmap);
MyTWAIN.Acquire ((LBitmap*)NULL,0,0,NULL);
LBase::UnloadLibraries(LT_TWN);
}


LBase::OverlayCallBack

#include "ltwrappr.h"

virtual L_INT LBase::OverlayCallBack(pOverlayCallbackData)

pFILEOVERLAYCALLBACKDATA pOverlayCallbackData;

/* pointer to a structure */

Override this function to get the overlay bitmap and other information from the user when loading a file containing an overlay.

Parameter | Description
pOverlayCallbackData | Pointer to a FILEOVERLAYCALLBACKDATA structure that contains information for the callback. Some members of this structure are for input, some are for output. For more information, refer to FILEOVERLAYCALLBACKDATA.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to 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 LBase::EnableOverlayCallBack.

When this function is called, you should fill the appropriate fields in the FILEOVERLAYCALLBACKDATA structure to set up the overlay bitmap and its information. For more information, refer to the FILEOVERLAYCALLBACKDATA 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.

See Also

Elements:

LBase::IsOverlayCallBackEnabled, LBase::EnableOverlayCallBack, LFile::LoadBitmap, Class Members

Example

class LUserBitmap : public LBitmap
{
public:
LUserBitmap();
virtual L_INT OverlayCallBack(pFILEOVERLAYCALLBACKDATA pOverlayCallbackData);
virtual ~LUserBitmap();
LMemoryFile MyBitmap;
};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LUserBitmap::LUserBitmap()
{
}

LUserBitmap::~LUserBitmap()
{

}

L_INT LUserBitmap::OverlayCallBack(pFILEOVERLAYCALLBACKDATA pOverlayCallbackData)
{
L_TCHAR szBuffer[800];
L_TCHAR szOverlayFileName[_MAX_PATH];
FILEINFO FileInfo;
L_INT nRet;
LBitmap MyBitmap;
// 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);
MyBitmap.SetFileName(szOverlayFileName);
if(pOverlayCallbackData->bInfo)
{
// info, we only need to fill in the nInfoXXX members of the structure
ZeroMemory(&FileInfo, sizeof(FILEINFO));
nRet = MyBitmap.File()->GetInfo(&FileInfo, sizeof(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 = MyBitmap.File()->LoadBitmap(0,
ORDER_BGRORGRAY,
NULL,
NULL);
*pOverlayCallbackData->pLoadBitmap = *MyBitmap.GetHandle();
}

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;
LUserBitmap Bitmap;

nRet = SUCCESS;

// load the PTOCA file from memory
Bitmap.EnableOverlayCallBack(TRUE);
nRet = Bitmap.Load(pszPtokaFileName, 0, ORDER_BGRORGRAY, NULL, NULL);
Bitmap.EnableOverlayCallBack (FALSE);

// save the bitmap as TIFF
nRet = Bitmap.Save(pszTiffFileName, FILE_TIF, 1, 0, NULL);

// free the bitmap
if(Bitmap.IsAllocated())
Bitmap.Free();

return nRet;
}


LBase::RecordError

#include "ltwrappr.h"

static L_VOID LBase::RecordError (nErrorCode)

L_INT nErrorCode;

/* a LEADTOOLS error code */

Records one of the LEADTOOLS errors by adding it to the internal error list.

Parameter | Description
nErrorCode | One of the LEADTOOLS error codes. You can also record your own error code number. However, when displaying errors from the internal list, if the error code is not a valid LEADTOOLS error code, the message displayed will be "Not a LEADTOOLS error code".

Returns

None

Comments

Call this function to record one of the LEADTOOLS errors by adding it to the internal error list. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::GetErrorString, LBase::DisplayErrorFromList, LBase::DisplayError, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::SetErrorString, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, Class Members

Example

LBase Base;
Base.RecordError(WRPERR_BITMAP_NOT_ALLOCATED);
Base.DisplayErrorFromList();


LBase::SetErrorListDepth

#include "ltwrappr.h"

static L_UINT LBase::SetErrorListDepth (uListDepth)

L_UINT uListDepth;

/* Depth of the error list */

Sets the depth for the internal error list.

Parameter | Description
uListDepth | The new depth of the error list.

Returns

The previous size of the internal error list.

Comments

Call this function to set the depth for the internal error list. Every error that occurs will be recorded in this list. The default size is 1. Is you shrink the list, the oldest errors in the list are the first to be discarded. The internal error list maintains a running list of the errors that have occurred in the LEADTOOLS Class Library functions.

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

Elements:

LBase::EnableAutoErrorDisplay, LBase::SetErrorString, LBase::DisplayError, LBase::GetErrorFromList, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, LBase::DisplayErrorFromList, LBase::RecordError, Class Members

Example

LBase LeadBase;
LeadBase.SetErrorListDepth(5);


LBase::SetErrorString

#include "ltwrappr.h"

static L_VOID LBase::SetErrorString (nErrorCode, pszNewErrString, pszOldErrString=NULL, uSizeOldErrStrBuff=0)

L_INT nErrorCode; | /* a LEADTOOLS error code */
L_TCHAR L_FAR * pszNewErrString; | /* pointer to the new error string */
L_TCHAR L_FAR * pszOldErrString; | /* pointer to an optional buffer that will be updated with the old error string */
L_UINT uSizeOldErrStrBuff; | /*the size of the old error string buffer */

Changes the error string for one of the LEADTOOLS error codes.

Parameter | Description
nLEADErrorCode | One of the LEADTOOLS error codes.
pszNewErrString | Pointer to a buffer that contains the new error string for the specified error code. The string must not exceed 256 characters, including the terminating NULL. The contents of this buffer will be copied, and you should free this buffer when you are finished with it.
pszOldErrString | Pointer to an optional buffer that will be updated with the old error string for the specified error code. The string must not exceed 256 characters, including the terminating NULL. You must allocate the memory for this buffer and free it when you are finished with it.
uSizeOldErrStrBuff | Size of the pszOldErrString passed buffer. This parameter is ignored if pszOldErrString is NULL.

Returns

None

Comments

Call this function to change the error string for one of the LEADTOOLS error codes. This will change the internal error string for the specified error code. When displaying the string for this error code, the new string will 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.

See Also

Elements:

LBase::EnableAutoErrorDisplay, LBase::GetErrorString, LBase::DisplayErrorFromList, LBase::DisplayError, LBase::IsAutoErrorDisplayEnabled, LBase::GetErrorFromList, LBase::SetErrorListDepth, LBase::RecordError, LBase::GetErrorListDepth, LBase::ClearErrorList, LBase::GetErrorsNumber, LBase::DisplayErrorList, Class Members

Example

LBase Base;
Base.SetErrorString(WRPERR_BITMAP_NOT_ALLOCATED, TEXT("UserMessage - Bitmap not allocated."));
Base. DisplayError (NULL, WRPERR_BITMAP_NOT_ALLOCATED);


LBase::StatusCallBack

#include "ltwrappr.h"

virtual L_INT LBase::StatusCallBack (nPercentComplete)

L_INT nPercentComplete;

/* completion percentage */

Override this function to 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.

Returns

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

Comments

Derived classes can override this function to update a status bar or interrupt the calling function's operation.

This generalized callback function can be called by many different Class Library functions. If this function returns a failure, the calling function will terminate and return the same error that the callback returned. Override this function in your derived class if you want to have control over the function in process. This function will be called only if the status callback is enabled for the class object.

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

Elements:

LBase::IsStatusCallBackEnabled, LBase::EnableStatusCallBack, Class Members

Example

#include <ltwrappr.h>
class LUserBitmap : public LBitmap
{
public:
LUserBitmap();
virtual L_INT StatusCallBack(L_INT nPercentComplete);
virtual ~LUserBitmap();

};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LUserBitmap::LUserBitmap()
{
}

LUserBitmap::~LUserBitmap()
{

}

L_INT LUserBitmap::StatusCallBack(L_INT nPercentComplete)
{
// display a message when 30% of the status is done.
if(nPercentComplete == 30)
{
MessageBox(NULL, TEXT("30 Percent of AddNoise function is completed."), TEXT("StatusCallBack"), MB_OK);
}
return SUCCESS;
}

L_INT MyFunc(HWND hWnd)
{
LUserBitmap LeadBitmap;
HDC hDC;
RECT rcClientRect;
L_INT nRet;

// get DC
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);

//Load an image
LeadBitmap.Load(TEXT("V:\\images\\babe.cmp"), 0,ORDER_BGR);
// Check if StatusCallBack is already enabled
nRet = LeadBitmap. IsStatusCallBackEnabled ();
if(nRet == FALSE)
// Enable Status CallBack
LeadBitmap. EnableStatusCallBack (TRUE);
// Call add noise function
// during the calling of this function
// StatusCallBack will be called
LeadBitmap. AddNoise ();

// Paint the image
LeadBitmap.Paint()-> SetDC (hDC);
LeadBitmap. SetDstRect (&rcClientRect);
LeadBitmap.Paint()-> PaintDC ();
ReleaseDC(hWnd, hDC);
return SUCCESS;
}


LBase::UnloadLibraries

#include "ltwrappr.h"

static L_VOID LBase::UnloadLibraries (uLibraries)

L_UINT32 uLibraries;

/* flag that indicates which libraries to unload */

Unloads specific LEADTOOLS library DLLs at run-time.

Parameter | Description
uLibraries | Flag that indicates which LEADTOOLS library DLLs to unload. Possible values are given below, and may be combined.
 | Value | Meaning
 | LT_KRN | unload the ltkrnXXn.dll for Non-Unicode or ltkrnXXnu.dll for Unicode.
 | LT_DIS | unload the ltdisXXn.dll for Non-Unicode or ltdisXXnu.dll for Unicode.
 | LT_FIL | unload the ltfilXXn.dll for Non-Unicode or ltfilXXnu.dll for Unicode..
 | LT_IMG | unload the ltimgXXn.dll for Non-Unicode or ltimgXXnu.dll for Unicode.
 | LT_EFX | unload the ltefxXXn.dll for Non-Unicode or ltefxXXnu.dll for Unicode.
 | LT_DLG | unload the ltdlgXXn.dll for Non-Unicode or ltdlgXXnu.dll for Unicode.
 | LT_ISI | unload the ltisiXXn.dll.
 | LT_TWN | unload the lttwnXXn.dll for Non-Unicode or lttwnXXnu.dll for Unicode.
 | LT_SCR | unload the ltscrXXn.dll for Non-Unicode or ltscrXXnu.dll for Unicode.
 | LT_ANN | unload the ltannXXn.dll for Non-Unicode or ltannXXnu.dll for Unicode.
 | LT_NET | unload the ltnetXXn.dll for Non-Unicode or ltnetXXnu.dll for Unicode.
 | LV_KRN | unload the lvkrnXXn.dll for Non-Unicode or lvkrnXXnu.dll for Unicode.
 | LV_DLG | unload the lvdlgXXn.dll for Non-Unicode or lvdlgXXnu.dll for Unicode.
 | LT_TMB | unload the lttmbXXn.dll for Non-Unicode or lttmbXXnu.dll for Unicode.
 | LT_LST | unload the ltlstXXn.dll for Non-Unicode or ltlstXXnu.dll for Unicode.
 | LT_BAR | unload the ltbarXXn.dll for Non-Unicode or ltbarXXnu.dll for Unicode.
 | LT_ZMV | unload the ltzmvXXn.dll for Non-Unicode or ltzmvXXnu.dll for Unicode.
 | LT_IMGOPT | unload the ltimgoptXXn.dll for Non-Unicode or ltimgoptXXnu.dll for Unicode.
 | LT_ALL_LEADLIB | unload any loaded LEADTOOLS libraries
 | These values can be combined using the bitwise OR operator ( | ).

Returns

None

Comments

Call this function to unload specific LEADTOOLS library DLLs at run-time. The specified constants will determine which libraries you want to unload. You can use this function to minimize the memory footprint of your program by loading and unloading the libraries you need when 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.

See Also

Elements:

LBase::LoadLibraries, LBase::UnloadLibraries, LBase::GetLoadedLibraries, Class Members

Example

For an example, refer to LBase::LoadLibraries.


LBase::VersionInfo

#include "ltwrappr.h"

static L_INT LBase::VersionInfo (pVersionInfo, uStructSize)

pVERSIONINFO pVersionInfo; | /* pointer to a version info structure */
L_UINT uStructSize; | /* size of the structure pointed to by pVersionInfo */

Retrieves version information about the current LEADTOOLS libraries.

Parameter | Description
pVersionInfo | Pointer to a version information structure.
uStructSize | Size of the VERSIONINFO structure pointed to by pVersionInfo. The size of this structure must be specified.

Returns

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

Comments

Call this function to retrieve version information about the current LEADTOOLS libraries.

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

Elements:

Class Members

Example

VERSIONINFO VersionInfo;
LBase::VersionInfo(&VersionInfo, sizeof(VERSIONINFO));


LBaseFile::LBaseFile

#include "ltwrappr.h"

L_VOID LBaseFile::LBaseFile(L_VOID)

Constructs and initializes the member variables of the LBaseFile object.

Returns

None

Comments

This is the constructor for the LBaseFile class.

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:

LBaseFile::~LBaseFile, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LBaseFile baseFile;
//…
}


LBaseFile::~LBaseFile

#include "ltwrappr.h"

virtual L_VOID LBaseFile::~LBaseFile(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LBaseFile class.

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:

LBaseFile::LBaseFile, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LBaseFile baseFile;

//…
}


LBaseFile::EnableLoadInfoCallBack

#include "ltwrappr.h"

L_BOOL LBaseFile::EnableLoadInfoCallBack(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable or disable the load info callback function */

Enables or disables the load info callback function.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the load info callback function. Possible values are:
 | Value | Meaning
 | TRUE | Enable the load info callback function.
 | FALSE | Disable the load info callback function.

Returns

The previous state.

Comments

The load info callback function is used to handle input data that is in a format (such as raw FAX) that LEADTOOLS cannot recognize.

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::EnableRedirectIO

#include "ltwrappr.h"

L_BOOL LBaseFile::EnableRedirectIO(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable the redirect I/O callback functions */

Enables or disables the redirected I/O callback functions.

Parameter | Description
bEnable | Flag that indicates whether to enable the redirect I/O callback functions.

Returns

The previous state.

Comments

The Redirect input / output
 functions cannot be used in combination with LFile::FeedLoad,
 LFile::StartFeedLoad,
 LFile::StopFeedLoad, LMemoryFile::LoadBitmap,
 LMemoryFile::LoadMemory,
 and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::GetDefaultLoadFileOption

#include "ltwrappr.h.h"

static L_VOID LBaseFile::GetDefaultLoadFileOption(pLoadFileOption, uStructSize)

pLOADFILEOPTION pLoadFileOption; | /* pointer to a LOADFILEOPTION structure */
L_UINT uStructSize; | /* size of the LOADFILEOPTION structure */

Gets the default extended values that are used when loading a file.

Parameter | Description
pLoadOptions | Pointer to the LOADFILEOPTIONstructure to be updated with the current extended values.
uStructSize | Size of the LOADFILEOPTION structure pointed to by pLoadOptions. The size of this structure must be specified.

Returns

None

Comments

Functions that use the LOADFILEOPTION structure:

LAnnContainer::Load

LAnnContainer::LoadOffset

LFile::ReadLoadResolutions

LFile::FileConvert

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::GetInfo

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadLayer

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadFileTransforms

LFile::ReadTag

LFile::ReadStamp

LFile::StartFeedLoad

LFileSettings::GetLoadResolution

LMemoryFile::Decompress

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadComment

LMemoryFile::ReadTag

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:

LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFile::Compact, LBaseFile::GetDefaultSaveFileOption, Class Members

Example

L_VOID Example12(HWND hWnd)
{
LOADFILEOPTION LoadFileOption;
SAVEFILEOPTION SaveFileOption;

//Gets the default load file options
LBaseFile::GetDefaultLoadFileOption(&LoadFileOption,sizeof(LOADFILEOPTION));

   //Gets the default save fileoptions
LBaseFile::GetDefaultSaveFileOption(&SaveFileOption,
 sizeof(SAVEFILEOPTION));
}


LBaseFile::GetDefaultSaveFileOption

#include "ltwrappr.h"

static L_VOID LBaseFile::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.
uStructSize | Size of the SAVEFILEOPTION structure pointed to by pSaveOptions. The size of this structure must be specified.

Returns

None

Comments

Functions that use the SAVEFILEOPTION structure:

LFile::FileConvert

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LMemoryFile::SaveBitmap

LFile::SaveFile

LFile::SaveBitmapWithLayers

LFile::SaveTile

LFile::SaveOffset

LMemoryFile::StartCompressBuffer

LFile::WriteComment

LFile::WriteStamp

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:

LFile::Compact, LBaseFile::GetDefaultLoadFileOption

Example

For an example, refer to LBaseFile::GetDefaultLoadFileOption.


LBaseFile::GetRedirectIOFlags

#include "ltwrappr.h"

L_UINT LBaseFile::GetRedirectIOFlags(L_VOID)

Determines which I/O callback functions for redirected I/O are enabled.

Returns

The current RedirectIO flags. Possible values are:

Value | Meaning
IO_OPEN | Redirect Open
IO_CLOSE | Redirect Close
IO_READ | Redirect Read
IO_WRITE | Redirect Write
IO_SEEK | Redirect Seek
IO_REDIRECT_ALL | Redirect all i/o callbacks

Comments

You can control which I/O callbacks are redirected using LBaseFile::SetRedirectIOFlags.

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad .


LBaseFile::IsLoadInfoCallBackEnabled

#include "ltwrappr.h"

L_BOOL LBaseFile::IsLoadInfoCallBackEnabled(L_VOID)

Determines whether the load info callback is enabled or not.

Returns

TRUE | The load info callback is enabled.
FALSE | The load info callback is disabled.

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::IsRedirectIOEnabled

#include "ltwrappr.h"

L_BOOL LBaseFile::IsRedirectIOEnabled(L_VOID)

Determines whether the I/O callback functions are enabled or disabled.

Returns

TRUE | Redirect I/O is enabled.
FALSE | Redirect I/O is disabled.

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer LFile::StartFeedLoad.


LBaseFile::LoadInfoCallBack

#include "ltwrappr.h"

virtual L_INT LBaseFile::LoadInfoCallBack(fd, pInfo)

L_INT fd; | /* file handle */
pLOADINFO pInfo; | /* pointer to a structure */

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.

Returns

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

Comments

Override this function if you wish to handle unrecognized image data.

This function also loads raw FAX data (CCITT Group 3 or Group 4) or raw uncompressed data.

This function handles input data that is in a format (such as raw FAX) that LEADTOOLS cannot recognize. This function will be called only if the load info callback is enabled. When loading an image from a file, a LEADTOOLS function normally determines the file format from the file header, and if the format is unrecognized, the function returns an error. You can override this function to change that behavior by supplying the information that LEADTOOLS needs when loading an image from a file.

To load raw uncompressed data, you must override LBaseFile::LoadInfoCallBack. 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

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::m_pBitmap

#include "ltwrappr.h"

LBitmapBase L_FAR * m_pBitmap

Comments

Pointer to an LBitmapBase object. This is used by the loading and saving member functions. Also you can access this variable by overriding the Load/Save callback functions.

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

Elements:

Class Members

Example

For an example, refer to LFile::StartFeedLoad .


LBaseFile::RedirectCloseCallBack

#include "ltwrappr.h"

virtual L_INT LBaseFile::RedirectCloseCallBack(FD)

L_INT FD;

/* the file to be closed */

Replaces the normal LEADTOOLS function for closing a file.

Parameter | Description
FD | The file to be closed. The file handle is returned by the RedirectOpenCallBack function.

Returns

0 | The file was closed.
-1 | The function failed.

Comments

Override this function to replace the normal LEADTOOLS function for closing a file.

The Redirect input / output functions cannot be used in combination with LFile::FeedLoad, LFile::StartFeedLoad, LFile::StopFeedLoad, LMemoryFile::LoadBitmap, LMemoryFile::LoadMemory, and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::RedirectOpenCallBack

#include "ltwrappr.h"

virtual L_INT LBaseFile::RedirectOpenCallBack(pFile, nMode, nShare)

L_CHAR L_FAR * pFile; | /* name of the file to load */
L_INT nMode; | /* access mode */
L_INT nShare; | /* share mode */

Replaces the normal LEADTOOLS function for opening a file.

Parameter | Description
pFile | Character string containing the name of the file to load.
nMode | The access mode for the file. Possible values are:
 | Value | 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 | The share mode for the file. Possible values are:
 | 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.

Returns

>0 | File handle to be used with other I/O functions.
-1 | An error occurred.

Comments

Override this function to replace the normal LEADTOOLS function for opening a file.

The Redirect input / output
 functions cannot be used in combination with LFile::FeedLoad,
 LFile::StartFeedLoad,
 LFile::StopFeedLoad, LMemoryFile::LoadBitmap,
 LMemoryFile::LoadMemory,
 and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::RedirectReadCallBack

#include "ltwrappr.h"

virtual L_UINT LBaseFile::RedirectReadCallBack(FD, pBuf, nCount)

L_INT FD; | /* the file to be read */
L_CHAR L_FAR * pBuf; | /* address of buffer for read data*/
L_INT nCount; | /* number of bytes */

Replaces the normal LEADTOOLS function for reading a file.

Parameter | Description
FD | The file to be read. The file handle is returned by the RedirectOpenCallBack function.
pBuf | Address of a buffer that is to receive the data read from the file.
nCount | The number of bytes to be read from the file.

Returns

>0 | The number of bytes that the function read from the file.
-1 | The function failed.

Comments

Override this function to replace the normal LEADTOOLS function for reading a file.

The Redirect input / output functions cannot be used in combination with LFile::FeedLoad, LFile::StartFeedLoad, LFile::StopFeedLoad, LMemoryFile::LoadBitmap, LMemoryFile::LoadMemory, and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::RedirectSeekCallBack

#include "ltwrappr.h"

virtual L_INT32 LBaseFile::RedirectSeekCallBack(FD, lnPos, nOrigin)

L_INT FD; | /* the file to search */
L_INT32 lnPos; | /* starting position and direction */
L_INT nOrigin; | /* number of bytes */

Replaces the normal LEADTOOLS function for repositioning a file pointer.

Parameter | Description
FD | Identifies the file to search. The file handle is returned by the RedirectOpenCallBack function.
lnPos | The starting position and direction of the pointer. Possible values are:
 | Value | Meaning
 | 0 | Move the file pointer nCount bytes from the beginning of the file.
 | 1 | Move the file pointer nCount bytes from its current position.
 | 2 | Move the file pointer nCount bytes from the end of the file.
nOrigin | The number of bytes the pointer is to be moved.

Returns

>0 | The offset, in bytes, of the new position from the beginning of the file.
-1 | The function failed.

Comments

Override this function to replace the normal LEADTOOLS function for repositioning a file pointer.

The Redirect input / output
 functions cannot be used in combination with LFile::FeedLoad,
 LFile::StartFeedLoad,
 LFile::StopFeedLoad, LMemoryFile::LoadBitmap,
 LMemoryFile::LoadMemory,
 and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::RedirectWriteCallBack

#include "ltwrappr.h"

virtual L_UINT LBaseFile::RedirectWriteCallBack(FD, pBuf, nCount)

L_INT FD; | /* the file to be written */
L_CHAR L_FAR * pBuf; | /* address of a buffer that contains the data to be written */
L_INT nCount; | /* number of bytes to be written */

Replaces the normal LEADTOOLS function for writing a file.

Parameter | Description
FD | The file to be written. The file handle is returned by the RedirectOpenCallBack function.
pBuf | Address of a buffer that contains data to be written to the file.
nCount | The number of bytes to be written to the file.

Returns

>0 | The number of bytes that the function wrote to the file.
-1 | The function failed.

Comments

Override this function to replace the normal LEADTOOLS function for writing a file.

The Redirect input / output
 functions cannot be used in combination with LFile::FeedLoad,
 LFile::StartFeedLoad,
 LFile::StopFeedLoad, LMemoryFile::LoadBitmap,
 LMemoryFile::LoadMemory,
 and LMemoryFile::SaveBitmap.

Note:

The Redirect input / output functions do 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedLoad.


LBaseFile::SetBitmap

#include "ltwrappr.h"

L_VOID LBaseFile::SetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to a bitmap object */

Sets the bitmap object that will be used by I/O functions.

Parameter | Description
pBitmap | Pointer to a LEAD bitmap object to be used for I/O functons.

Returns

None

Comments

If the filename of the LBitmapBase object is enabled, then the bitmap filename will be transferred to the class object.

Before you can use any of the file functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LFileBase object, the object is considered invalid.

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:

Class Members

Example

L_VOID MyFunction(LBitmapBase L_FAR *pLBitmap)
{
LBaseFile baseFile;

baseFile.SetBitmap(pLBitmap) ;
}


LBaseFile::SetRedirectIOFlags

#include "ltwrappr.h"

L_VOID LBaseFile::SetRedirectIOFlags(uEnableFlags=IO_REDIRECT_ALL)

L_UINT uEnableFlags;

/* flag that controls which I/O callbacks will be called */

Specifies which I/O functions should be redirected to the redirect I/O callback functions.

Parameter | Description
uEnableFlags | Flag that controls which I/O callbacks will be called. Possible values are given below, and may be combined using the bitwise OR ( | ) operator.
 | Value | Meaning
 | IO_OPEN | Redirect Open
 | IO_CLOSE | Redirect Close
 | IO_READ | Redirect Read
 | IO_WRITE | Redirect Write
 | IO_SEEK | Redirect Seek
 | IO_REDIRECT_ALL | Redirect all i/o callbacks

Returns

None

Comments

If you set the flags to 0, then redirecting I/O will be disabled, even though redirection may be enabled through calling LBaseFile::EnableRedirectIO.

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: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Annotation Functions: Input and Output

Example

For an example, refer to LFile::StartFeedwLoad .


LBitmap::LBitmap

#include "ltwrappr.h"

L_VOID LBitmap::LBitmap(void)

L_VOID LBitmap::LBitmap(pInfo, pBits)

L_VOID LBitmap::LBitmap(hDC, hBitmap, hPalette)

L_VOID LBitmap::LBitmap(uWidth, uHeight, uBitsPerPixel=24, uOrder=ORDER_BGRORGRAY, pPalette=NULL, uViewPerspective=TOP_LEFT, crFill=0, uMemory=TYPE_CONV)

L_VOID LBitmap::LBitmap(pBitmapHandle)

BITMAPINFO L_FAR * pInfo; | /* pointer to a BITMAPINFO structure */
L_UCHAR L_FAR * pBits; | /* pointer to bitmap data */
HDC hDC; | /* handle to a device context */
HBITMAP hBitmap; | /* handle to a DDB */
HPALETTE hPalette; | /* handle of the palette */
L_UINT uWidth; | /* the desired initial bitmap width */
L_UINT uHeight; | /* the desired initial bitmap height */
L_UINT uBitsPerPixel; | /* the number of bits per pixel */
L_UINT uOrder; | /* color order */
LPRGBQUAD pPalette; | /* pointer to the palette */
L_UINT uViewPerspective; | /* the desired view perspective */
COLORREF crFill; | /* fill color for the bitmap */
L_UINT uMemory; | /* flag that indicates the type of memory */
pBITMAPHANDLE pBitmapHandle; | /* pointer to a LEAD bitmap handle */

Constructs and initializes the member variables of the LBitmap object.

Parameter | Description
pInfo | Pointer to a BITMAPINFO structure that describes the bitmap data.
pBits | Pointer to the bitmap data to be used in initializing the bitmap.
hDC | Handle to a Windows DC.
hBitmap | Handle to a device dependent bitmap (DDB) of type HBITMAP.
hPalette | Handle of the palette to be used for the bitmap or NULL if the bitmap does not have a palette.
uWidth | The desired initial bitmap width.
uHeight | The desired initial bitmap height.
uBitsPerPixel | The number of bits per pixel. Valid values are 0, 1, 4, 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-, and 32-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
pPalette | Pointer to the palette that the bitmap will use. You can specify your own palette, or use NULL to use LEAD's fixed palette.
uViewPerspective | The desired view perspective for the bitmap. Possible values are:
 | Value | 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.
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 toolkits, 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 LBitmapBase::GetPixelColor.

uMemory | Flag that indicatres the type of memory to allocate. Possible values are:
 | Value | Meaning
 | TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk.
 | TYPE_COMPRESSED | [0x0200] (Document/Medical only) Allocate an RLE-compressed bitmap. You can use this flag with TYPE_CONV. 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 only for 1-bit, 8-bit grayscale and 24-bit images.
pBitmapHandle | Pointer to a LEAD bitmap handle that describes an allocated bitmap.

Returns

None

Comments

LBitmap::LBitmap(uWidth, uHeight, uBitsPerPixel, uOrder, pPalette, uViewPerspective, crFill, uMemory) constructs an LBitmap object and allocates a bitmap with the desired width, height, bits per pixel, color order, view perspective and memory type. You can check for successful allocation by calling the LBitmapBase::IsAllocated member function. Even if the allocation fails, the class object is still constructed.

LBitmap::LBitmap(pInfo, pBits) constructs an LBitmap object and allocates a bitmap using the passed bitmap info and data (DIB). You can check for successful allocation by calling the LBitmapBase::IsAllocated member function. Even if the allocation fails, the class object is still constructed.

LBitmap::LBitmap(hDC, hBitmap, hPalette) constructs an LBitmap object and allocates a bitmap using the passed hBitmap (DDB). You can check for successful allocation by calling the LBitmapBase::IsAllocated member function. Even if the allocation fails, the class object is still constructed.

LBitmap::LBitmap(pBitmapHandle) constructs an LBitmap object and allocates a bitmap from another LEAD bitmap handle. You can check for successful allocation by calling the LBitmapBase::IsAllocated member function. Even if the allocation fails, the class object is still constructed.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LBitmap::~LBitmap, LBitmapBase::IsAllocated, Class Members
Topics: | Using Color Values in LEADTOOLS

Example

This is an example for LBitmap::LBitmap(void).

LBitmap LeadBitmap;
//Load an image
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);

This is an example for LBitmap::LBitmap(pInfo, pBits):

BITMAPINFO bmpInfo;
L_UCHAR bits[256];
// fill bmpInfo & bits with a valid image
…
LBitmap Bitmap(&bmpInfo, bits);

This is an example for LBitmap::LBitmap(hDC, hBitmap, hPalette):

L_VOID MyFunction(HWND hWnd)
{
 HDC hDC;
LBitmap LeadBitmap ;
HBITMAP hBitmap;

LeadBitmap.Load (TEXT("image1.cmp"));

hDC = GetDC(hWnd) ;
hBitmap = LeadBitmap.ConvertToDDB( hDC) ;
LBitmap MyBitmap(hDC, hBitmap, 0);

// .....
// .....

ReleaseDC(hWnd,hDC) ;
}

This is an example for LBitmap::LBitmap(uWidth, uHeight, uBitsPerPixel, uOrder, pPalette, uViewPerspective, crFill, uMemory)

LBitmap m_Bitmap(100, 50, 24, ORDER_BGR, NULL, TOP_LEFT, RGB(255, 0, 0), TYPE_CONV)

This is an example for LBitmap::LBitmap(pBitmapHandle):

BITMAPHANDLE bmp;
L_CreateBitmap(&bmp, TYPE_CONV, 50, 50, 24, ORDER_BGR, NULL, TOP_LEFT);
LBitmap m_Bitmap(&bmp);


LBitmap::~LBitmap

#include "ltwrappr.h"

virtual L_VOID LBitmap::~LBitmap(void)

Destroys the class object and frees any allocated variables and memory associated with the object.

Returns

None

Comments

This is the destructor for the LBitmap class.

Required DLLs and Libraries

LTDIS
LTFIL
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:

LBitmap::LBitmap, Class Members

Example

// destructor will be called when the variable is out of scope
LBitmap LeadBitmap;


LBitmap::AdaptiveContrast

#include "ltwrappr.h"

virtual L_INT LBitmap::AdaptiveContrast (uDim, uAmount, uFlag)

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
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 LBitmap::LocalHistoEqualize to perform a local histogram equalization.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::HistoEqualize, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmap::LocalHistoEqualize, LBitmap::ChangeHueSatIntBitmap
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies Adaptive Contrast Enhancement */
/* Apply Adaptive Contrast Enhancement */
pLeadBitmap->AdaptiveContrast(9, 200, ACE_LIN);
}


LBitmap::Add

#include "ltwrappr.h"

virtual L_INT LBitmap::Add (pBitmapList, uFlag=BC_ADD)

LBitmapList pBitmapList; | /* pointer to an LBitmapList object */
L_UINT uFlag; | /* operation flag */

Adds or averages the bitmaps in a list and the class object's bitmap. The class object's bitmap is updated with the resulting bitmap.

Parameter | Description
pBitmapList | Pointer to an LBitmapList object that contains a 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.

Bitmap object is assumed to be empty. If Bitmap contains a bitmap, you should free it prior to calling this function. LBitmap::Add will allocate and store the resulting bitmap in Bitmap object. 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.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::AddWeighted
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Removing Noise
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
LBitmapList BitmapList;
LBitmap TempBitmap;

Bitmap.Load(szFile);
BitmapList.Create();

for (L_INT i = 1; i < 4; i++)
{
TempBitmap.Copy(Bitmap);
TempBitmap.Rotate(7500 * i, ROTATE_RESAMPLE, RGB(255, 0, 0));
BitmapList.InsertItem(&TempBitmap);
}

Bitmap.Add(&BitmapList, BC_AVG);
BitmapList.Destroy();
}


LBitmap::AddBorder

#include "ltwrappr.h"

virtual L_INT LBitmap::AddBorder(pAddBorderInfo)

LPADDBORDERINFO pAddBorderInfo;

/* pointer to a structure */

Adds a border to the class object's bitmap. The border is specified by the pAddBorderInfo parameter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
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 LBase::EnableStatusCallback.

This function supports 12 and grayscale 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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::AddFrame, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
ADDBORDERINFO AddBorderInfo;
AddBorderInfo.uStructSize = sizeof(ADDBORDERINFO);
Bitmap.Load(pszFile);

AddBorderInfo.nTopThickness = 20;
AddBorderInfo.nBottomThickness = 20;
AddBorderInfo.nLeftThickness = 20;
AddBorderInfo.nRightThickness = 20;
AddBorderInfo.crGradientStart = RGB(200, 150, 150);
AddBorderInfo.nLocation = BORDER_OUTSIDE;
AddBorderInfo.nStyle = BORDER_STYLE_OPAQUE;

Bitmap.AddBorder(&AddBorderInfo);
}


LBitmap::AddFrame

#include "ltwrappr.h"

virtual L_INT LBitmap::AddFrame(pAddFrameInfo)

LPADDFRAMEINFO pAddFrameInfo;

/* pointer to a structure */

Adds a frame to the class object's bitmap. The frame is specified by the pAddFrameInfo parameter. This function is available in the Raster Pro and above toolkits.

Parameter | Description
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::AddBorder, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile,
L_TCHAR * pszFrameFile)
{
LBitmapBase BitmapFrame;
ADDFRAMEINFO AddFrameInfo;
AddFrameInfo.uStructSize = sizeof(ADDFRAMEINFO);
Bitmap.Load(pszFile);
BitmapFrame.Load(pszFrameFile);

AddFrameInfo.pBitmapFrame = BitmapFrame.GetHandle ();
AddFrameInfo.SmoothEdge = 40;

Bitmap.AddFrame(&AddFrameInfo);
}


LBitmap::AddMessage

#include "ltwrappr.h"

virtual L_INT LBitmap::AddMessage (pAddMesgInfo)

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
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 messages to any type of lossless image format such as bmp, tiff, lossless jpeg, and so forth. If used with lossy format types the message may be corrupted or lost.

This function supports 24- and 48-bit images, and 8- and 16-bit grayscale images.

To extract the embedded message use the LBitmap::ExtractMessage function.

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.

See Also

Functions: | LBitmap::ExtractMessage
Topics: | Raster Image Functions: Getting and Setting File Information
 | Non-Image Data

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LPADDMESGINFO pAddMesgInfo;
pAddMesgInfo = new ADDMESGINFO;
if(!pAddMesgInfo)
return;
memset(pAddMesgInfo, 0, sizeof(ADDMESGINFO));
pAddMesgInfo->uStructSize = sizeof(ADDMESGINFO);
pAddMesgInfo->pStrMsg = new L_TCHAR[200];
if(!pAddMesgInfo->pStrMsg)
return;

lstrcpy(pAddMesgInfo->pStrMsg, TEXT("LEAD Technologies, Inc."));

LAniWnd->AddMessage(pAddMesgInfo);
}


LBitmap::AddNoise

#include "ltwrappr.h"

virtual L_INT LBitmap::AddNoise(uRange=500, uChannel=CHANNEL_MASTER)

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
uRange | Percentage of coverage, expressed in tenths of a percent. Valid values are 0 to 1000.
uChannel | Color plane constant. This plane will be affected by the noise. 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

Use this function in order to add random noise to a bitmap.

Use the LBitmap::Perlin 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 LBitmap::Perlin Function.

Use the LBitmap::Clouds function in order to use Perlin equations to generate pseudo-random noise, and then procedurally transform that noise into a cloud-like texture. The LBitmap::Clouds function applies equations to the Perlin noise that are different than those used by the LBitmap::Perlin function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("Image1.cmp"), 0,ORDER_BGR);
m_Bitmap.AddNoise();


LBitmap::AddShadow

#include "ltwrappr.h"

virtual L_INT LBitmap::AddShadow (uAngle, uThreshold, uFlags)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::EdgeDetector, LBitmap::LensFlare, LBitmap::Light, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* Apply shadow effect to the image*/
pLeadBitmap->AddShadow (SHADOW_SE, 0, SHADOW_CLR_GRAY);
}


LBitmap::AddWeighted

#include "ltwrappr.h"

virtual L_INT LBitmap::AddWeighted (hList, puFactor, uFlag)

virtual L_INT LBitmap::AddWeighted (pList, puFactor, uFlag)

HBITMAPLIST hList; | /* handle to the list of bitmaps */
L_UINT L_FAR * puFactor; | /* array of weight factors */
L_UINT uFlag; | /* operation flag */
LBitmapList *pList; | /* pointer to the BitmapList object */

Adds or averages the bitmaps in a list according to their weight factors.

Parameter | Description
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.
pList | Pointer to the bitmap list object.

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

If uFlag is BC_AVG, the function can be used to average several images. In this case, puFactor is ignored.

If uFlag is 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.

If uFlag is 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.

The result of the operation will be stored in this class.

This function performs operations between data byte-by-byte. An image can be any color resolution. 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.

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: | LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmapBase::Underlay, LBitmap::Add
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Removing Noise
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Changing Brightness and Contrast

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap, PaintBitmap;
BitmapList.Create();
Bitmap.Load(TEXT("f:\\1.jpg"), 0,ORDER_BGR);
BitmapList.InsertItem(&Bitmap);
Bitmap.Load(TEXT("f:\\2.jpg"), 0,ORDER_BGR);
BitmapList.InsertItem(&Bitmap);
Bitmap.Load(TEXT("f:\\3.jpg"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("f:\\4.jpg"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

LAniWnd->AddWeighted(&BitmapList,NULL, BC_AVG);
}


LBitmap::AdjustTint

#include "ltwrappr.h"

L_INT LBitmap::AdjustTint(nAngleA, nAngleB)

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
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 LBitmap::ChangeHue 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 LBase::EnableStatusCallback.

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: | LBitmap::ChangeHue, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::ChannelMix, LBitmap::LightControl, LBitmap::SmoothEdges, LBitmap::LocalHistoEqualize, LBitmap::AddWeighted, LBitmap::ColorMerge, LBitmap::ColorSeparate, LBuffer::ConvertColorSpace, LBitmap::Multiply, LBitmap::AutoColorLevel, LBitmap::ColorLevel, LBitmap::SelectiveColor, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::MathFunction, LBitmap::AdaptiveContrast, LBitmap::ApplyMathLogic, LBitmap::ColorIntensityBalance, LBitmap::ContBrightInt, LBitmap::FunctionalLight, LBitmap::MultiScaleEnhancementBitmap, LBitmap::SelectData, LBitmap::ShiftData, LBitmap::SampleTarget
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.AdjustTint(-6500,2000);


LBitmap::Aging

#include "ltwrappr.h"

virtual L_INT LBitmap::Aging (uHScratchCount, uVScratchCount,uMaxScratchLen, uDustDensity, uPitsDensity, uMaxPitSize, crScratch, crDust,crPits, uFlags)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::Mosaic.
Topics: | Applying Artistic Effects
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies aging effect */
/* apply aging effect */
pLeadBitmap->Aging (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);
}


LBitmap::AllocFTArray

#include "ltwrappr.h"

virtual L_INT LBitmap::AllocFTArray (ppFTArray, uStructSize)

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’suWidth 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
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 LBitmap::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 LBitmap::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.

See Also

Functions: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

For an example, refer to LBitmap::DFT.


LBitmap::AntiAlias

#include "ltwrappr.h"

virtual L_INT LBitmap::AntiAlias (uThreshold, uDim, uFilter)

L_UINT uThreshold; | /* threshold value */
L_UINT uDim; | /* mask size */
L_UINT uFilter; | /* anti-aliasing filter */

Applies an anti-aliasing filter to the class object's bitmap.

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

Returns

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

Comments

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.

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

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, Class Members
Topics: | Correcting Colors
 | Raster Image Function: Filtering Images
 | Raster Image Functions: Correcting Colors

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
Bitmap.Load(szFile);
Bitmap.AntiAlias(128, 3, ANTIALIAS_1);
}


LBitmap::ApplyLinearModalityLUT

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyLinearModalityLUT(fIntercept, fSlope, uFlags)

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 rescale slope and intercept. This function is available in the Medical Toolkits only.

Parameter | Description
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. Use one value or use a bitwise OR ( | ) to combine values.Possible values are:
 | Value | Meaning
 | M_LUT_UPDATE_MIN_MAX | [0x0002] 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] 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

where:

m represents the slope of a straight line. This is referred to as "Rescale Slope" in the DICOM world.

b represents the y-intercept of a straight line. This is referred to as "Rescale Intercept" in the DICOM world.

Y represents the resulting pixel value.

X represents 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 (for example, 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.

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.

This function supports signed data images.

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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::RemapIntensity, LBitmap::ApplyLinearModalityLUT, LBitmap::ApplyVOILUT, LBitmap::ApplyLinearVOILUT, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to LBitmap::ApplyModalityLUT.


LBitmap::ApplyLinearVOILUT

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyLinearVOILUT(fCenter, fWidth, uFlags)

L_DOUBLE fCenter; | /* window center*/
L_DOUBLE fWidth; | /* window width*/
L_UINT uFlags; | /* flags*/

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. This function is available in the Document/Medical Toolkits only.

Parameter | Description
fCenter | Window Center for display.
fWidth | Window Width for display.
uFlags | Flags which determine the behavior of this function. Use one value or use a bitwise OR ( | ) to combine values.Possible values are:
 | Value | Meaning
 | VOI_LUT_UPDATE_MIN_MAX | [0x0001] 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] 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 function’s 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

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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::RemapIntensity, LBitmap::ApplyLinearModalityLUT, LBitmap::ApplyVOILUT, LBitmap::ApplyModalityLUT, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

For an example, refer to LBitmap::ApplyVOILUT.


LBitmap::ApplyMathLogic

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyMathLogic(nFactor, uFlags)

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
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 LBitmap::ApplyMathLogic 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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmapBase::Combine, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example multiplies the colors using a factor of 1.51 */
/* Multiply the colors of the bitmap using a factor of 1.51 */
pLeadBitmap->ApplyMathLogic(151, AML_OP_MUL| CHANNEL_MASTER| AML_VALUE_NOP| AML_RES_NOP);
}


LBitmap::ApplyModalityLUT

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyModalityLUT(pLUT, pLUTDescriptor, uFlags)

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

Parameter | Description
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 | 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. Use one value or use a bitwise OR ( | ) to combine values.Possible values are:
 | 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] 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 LBitmap::RemapIntensity because it remaps the bitmap pixel values through a LUT. The function differs from LBitmap::RemapIntensity as follows:

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

LBitmap::ApplyModalityLUT only works on grayscale bitmaps. Calling this function for non-grayscale bitmaps will return an error (ERROR_INV_PARAMETER).

LBitmap::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, LBitmap::ApplyModalityLUT will do the following:

1. | Take the pixel value, shift it to the right by 4 and mask out the high bits, producing a value (val = 0..127).
2. | Remap values according to the LUT (values smaller than nFirstStoredPixelValueMapped are mapped to the first LUT entry, while values greater than nFirstStoredPixelValueMapped + uNumberOfEntries are mapped to the last LUT entry)
3. | 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 to be between –32768 and +32767.

If the bitmap is unsigned, the indices are unsigned. The indices 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 (for example, Hounsfield units for CT, Optical Density for film digitizers, etc.).

This function supports signed data images.

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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::RemapIntensity, LBitmap::ApplyLinearModalityLUT, LBitmap::ApplyVOILUT, LBitmap::ApplyLinearVOILUT, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_INT TestModalityLUT(LBitmap *plBitmap, L_BOOL bLinear)
{
L_INT nRet;
if(bLinear)
{
nRet = plBitmap->ApplyLinearModalityLUT(0.0, 0.5, 0);
}
else
{
L_UINT16 L_FAR* pLUT;
L_INT i;
DICOMLUTDESCRIPTOR LUTDescriptor;

// allocate and initialize the LUT
pLUT = (L_UINT16 *)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 = plBitmap->ApplyModalityLUT(pLUT, &LUTDescriptor, 0);

// free the LUT
free(pLUT);
}
return nRet;
}


LBitmap::ApplyTransformationParameters

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyTransformationParameters (nXTranslation, nYTranslation, nAngle, uXScale, uYScale, uFlags)

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
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 LBitmap::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 LBitmap::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 is rotated in a counter-clockwise rotation. This value must be equal to the one returned from LBitmap::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 LBitmap::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 LBitmap::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 LBitmap::GetTransformationParameters.

You can get the translation, rotation, and scaling parameters by using LBitmap::GetTransformationParameters function; the returned values must be passed as they are to LBitmap::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 LBitmap::Deskew function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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: | LBitmapBase::Combine, LBitmapBase::Rotate, LBitmapBase::Size, LBitmapBase::Resize, LBitmap::Deskew, LBitmap::GetTransformationParameters, LBitmap::IsRegMarkBitmap, LBitmap::SearchRegMarks, LBitmap::GetMarksCenterMass
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to LBitmap::GetTransformationParameters.


LBitmap::ApplyVOILUT

#include "ltwrappr.h"

virtual L_INT LBitmap::ApplyVOILUT(pLUT, pLUTDescriptor, uFlags)

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 & image processing functions' window leveling options for a specific bitmap through a lookup-table (LUT). This function is available in the Document/Medical Toolkits only.

Parameter | Description
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 | 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. Use one value or use a bitwise OR ( | ) to combine values.Possible values are:
 | Value | Meaning
 | VOI_LUT_UPDATE_MIN_MAX | [0x0001] 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] 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 function’s 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

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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::RemapIntensity, LBitmap::ApplyLinearModalityLUT, LBitmap::ApplyModalityLUT, LBitmap::ApplyLinearVOILUT, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_INT TestVOILUT(LBitmap *plBitmap, 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 = plBitmap->ApplyLinearVOILUT( 330.0, 600.0, 0);
}
else
{
L_UINT16 L_FAR* pLUT;
L_INT i;
DICOMLUTDESCRIPTOR LUTDescriptor;

// allocate and initialize the LUT
pLUT = (L_UINT16 *)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 = plBitmap->ApplyVOILUT(pLUT, &LUTDescriptor, 0);

// free the LUT
free(pLUT);
}
return nRet;
}


LBitmap::AutoBinary

#include "ltwrappr.h"

virtual L_INT LBitmap::AutoBinary ()

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.

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.

See Also

Functions: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::BinaryFilter, LBitmap::AutoColorLevel, LBitmap::ColorLevel
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void TestFunction(LAnimationWindow *pBitmapWindow)
{
pBitmapWindow->AutoBinary();
}


LBitmap::AutoColorLevel

#include "ltwrappr.h"

virtual L_INT LBitmap::AutoColorLevel (pLvlClr, uBlackClip, uWhiteClip, uFlags);

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
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 LBitmap::AutoColorLevel, 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 LBitmap::AutoColorLevel function. If you then pass the updated pLvlClr structure to the LBitmap::ColorLevel function, you will obtain the same result that you would have obtained if you had called the LBitmap::AutoColorLevel 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.

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 LBitmap::AutoColorLevel function using the AUTO_LEVEL flag.

The following figure shows what would happen if you start with the original image and apply the LBitmap::AutoColorLevel function using the AUTO_INTENSITY flag.

The following figure shows what would happen if you start with the original image and apply the LBitmap::AutoColorLevel 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.

See Also

Functions: | LBitmap::ColorHalfTone, LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::ColorLevel, LBitmap::SelectiveColor
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Correcting Colors
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

/* This example applies auto image leveling. */
void MyTestFunction(LAnimationWindow * LAniWnd)
{
LVLCLR lc; /* Structure to hold the level values, used for display only */
L_TCHAR buffer[100];

/* Apply "Auto Leveling" to the bitmap */
lc.uStructSize = sizeof(LVLCLR);
LAniWnd->AutoColorLevel (&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);
}


LBitmap::AutoTrim

#include "ltwrappr.h"

virtual L_INT LBitmap::AutoTrim(uThreshold=0)

L_INT uThreshold;

/* delta value for detecting blank space */

Trims the class object's bitmap, removing blank space around the edges.

Parameter | Description
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

LTDIS
LTFIL
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: | LBitmap::GetAutoTrimRect, LBitmap::WindowLevel, LBitmapBase::Trim, LBitmapBase::CopyRect, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("Image1.cmp"), 0,ORDER_BGR);
m_Bitmap.AutoTrim();


LBitmap::AverageFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::AverageFilter(uDim=3)

L_UINT uDim;

/* size of the averaging neighborhood */

Changes the color of each pixel in the class object's bitmap to the average color of pixels in its neighborhood. This results in a blur effect.

Parameter | Description
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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
m_Bitmap.AverageFilter(10);


LBitmap::BalanceColors

#include "ltwrappr.h"

virtual L_INT LBitmap::BalanceColors(pRedFact, pGreenFact, pBlueFact)

BALANCING * pRedFact; | /* pointer to a structure */
BALANCING * pGreenFact; | /* pointer to a structure */
BALANCING * pBlueFact; | /* pointer to a structure */

Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.

Parameter | Description
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 class object's 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 class object's 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 class object's 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 members of type L_DOUBLE: toRed, toGreen and toBlue. The value of each member must be within the range 0.0 to 1.0.

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

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::SwapColors, LBitmap::ConvertToColoredGray, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

L_INT BalanceColors(LBitmap & Bitmap, L_TCHAR * szFileName)
{
BALANCING RedFactor, GreenFactor, BlueFactor;

RedFactor.toRed = 0.25;
RedFactor.toGreen = 0.25;
RedFactor.toBlue = 0.5;

GreenFactor.toRed = 0.3;
GreenFactor.toGreen = 0.3;
GreenFactor.toBlue = 0.4;

BlueFactor.toRed = 0.1;
BlueFactor.toGreen = 0.3;
BlueFactor.toBlue = 0.6;

Bitmap.Load(szFileName);

return Bitmap.BalanceColors(&RedFactor, &GreenFactor, &BlueFactor);
}


LBitmap::Bending

#include "ltwrappr.h"

virtual L_INT LBitmap::Bending (nValue, CenterPt, crFill, uFlags)

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
nValue | Amount of stretching, where positive values stretch the pixels toward edges, and negative values stretch the pixels toward the center. Possible values range from –500 to 500.
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.

Support for 12 and 16-bit grayscale images are 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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LDialogImageEffect::DoModalBending, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT pt;
pt.x = 100;
pt.y = 100;

LAniWnd->Bending(20, pt, RGB(200,120,30), FILL_CLR);
}


LBitmap::BinaryFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::BinaryFilter(pFilter)

LPBINARYFLT pFilter;

/* pointer to the binary filter to use */

Imposes a binary filter on the class object's bitmap. This function is available in Document/Medical toolkits only.

Parameter | Description
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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
m_Bitmap.BinaryFilter(BFLT_DILATION_OMNI);


LBitmap::BorderRemove

#include "ltwrappr.h"

virtual L_INT LBitmap::BorderRemove(pBorderRemove)

LPBORDERREMOVE pBorderRemove;

/* pointer to a structure */

Removes the black borders in a 1-bit black and white image. This function is available in the Document/Medical Toolkits.

Parameter | Description
pBorderRemove | Pointer to the BORDERREMOVE structure that LEADTOOLS uses to remove borders.

Returns

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

Comments

This function removes borders that commonly appear in scanned text documents. Any or all of the four borders can be detected and removed.

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.

The behavior of this function can be modified by overriding LBitmap::BorderRemoveCallback.

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: | LBitmap::BorderRemoveCallback, LBitmap::Smooth, LBitmap::LineRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

//This example updates a Windows region with the removed borders of a bitmap
//The derived class LMyBitmap is used to override the BorderRemoveCallBack function
//myBitmap is an object of class LMyBitmap.
//For the example, Windows regions are received by the BorderRemoveCallBack function and combined.
//In practice it would be easier and faster to just update a LEAD region with the changes
//The borders are removed from the image.

void CCleanv12Dlg::OnButtonBorder()
{
L_INT32 nRet;
BORDERREMOVE br;
br.uStructSize = sizeof(BORDERREMOVE);
//Create a NULL region
RECT rect ={0, 0, 0, 0};

m_Bitmap.Region()->SetRgnRect(&rect);

br.uStructSize = sizeof(DOTREMOVE);

br.uBitmapStructSize = sizeof(BITMAPHANDLE);

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 = m_Bitmap.BorderRemove(&br);

if (nRet == SUCCESS)
{
//Delete the existing region
LBitmapRgn Region(&m_Bitmap);
if(Region.BitmapHasRgn())
{
Region.Free();
}

Region.SetRgnCombineMode(L_RGN_SET) ;
Region.SetRgnHandle(Bitmap.Region()->GetRgnHandle());
}
}

L_INT LMyBitmap::BorderRemoveCallBack(
HRGN hRgn,
L_UINT32 uBorderToRemove,
PRECT pBoundingRect
)
{
CString strMsg;
CString strBorder;

::CombineRgn( hRgnAll, hRgnAll, hRgn, RGN_OR);
DeleteObject(hRgn);

switch (uBorderToRemove)
{
case BORDER_TOP:
strBorder = TEXT("Top");
break;

case BORDER_LEFT:
strBorder = TEXT("Left");
break;

case BORDER_RIGHT:
strBorder = TEXT("Right");
break;

case BORDER_BOTTOM:
strBorder = TEXT("Bottom");
break;
}
strMsg.Format(
TEXT("Border[%s]\tBounds[%d,%d][%d,%d]\n"),
strBorder,
pBoundingRect->left,
pBoundingRect->top,
pBoundingRect->right,
pBoundingRect->bottom
);
OutputDebugString(strMsg);

return SUCCESS_REMOVE;
}


LBitmap::BorderRemoveCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::BorderRemoveCallBack(hRgn, uBorderToRemove, pBoundingRect)

HRGN hRgn; | /* windows region */
L_UINT32 uBorderToRemove; | /* border flag */
PRECT pBoundingRect; | /* pointer to a RECT structure */

Called for each border found by LBitmap::BorderRemove. This function is available in the Document/Medical Toolkits.

Parameter | Description
hRgn | Windows region representing the border to be removed. It is the programmer's 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.

Returns

SUCCESS_REMOVE | Remove the border.
SUCCESS_NOREMOVE | Do not remove the border.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This function is called once for each border found by LBitmap::BorderRemove. It is called a maximum of four times for each call to the LBitmap::BorderRemove. 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 LBitmap::BorderRemove(). If flags BORDER_IMAGE_UNCHANGED and BORDER_SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::BorderRemove
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::BorderRemove.


LBitmap::BricksTexture

#include "ltwrappr.h"

L_INT LBitmap::BricksTexture(uBricksWidth, uBricksHeight, uOffsetX, uOffsetY, uEdgeWidth, uMortarWidth, uShadeAngle, uRowDifference, uMortarRoughness, uMortarRoughnessEvenness, uBricksRoughness, uBricksRoughnessEvenness, crMortarColor, uFlags)

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
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. 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 BricksTexture 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 LBase::EnableStatusCallback.

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: | LBitmap::Emboss, LBitmap::AddShadow, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::SubtractBackground, LBitmap::UserFilter, LBitmap::BumpMap
Topics: | Applying Artistic Effects
 | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Raster Image Functions: Processing an Image

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.BricksTexture(60, 20, 0, 0, 3, 4, 315, 33,
20, 0, 10, 0, 0, BRICKS_SMOOTHEDOUT);


LBitmap::BumpMap

#include "ltwrappr.h"

virtual L_INT LBitmap::BumpMap(pBumpBitmap, pBumpData)

virtual L_INT LBitmap::BumpMap(pLBumpBitmap, pBumpData)

pBITMAPHANDLE pBumpBitmap; | /* pointer to the bitmap handle */
LPBUMPDATA pBumpData; | /* pointer to a structure */
LBitmap * pLBumpBitmap; | /* pointer to the bitmap object */

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
pBumpBitmap | Pointer to the bitmap handle referencing the Bump bitmap.
pBumpData | Pointer to a BUMPDATA structure that contains information about the bump parameter.
pLBumpBitmap | Pointer to the bitmap object referencing the Bump bitmap.

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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Correcting Colors
 | Raster Image Functions: Processing an Image

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BUMPDATA BumpData;
LBitmap Bitmap, PaintBitmap;
Bitmap.Load(TEXT("f:\\1.jpg"), 0,ORDER_BGR);
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;

BitmapWindow->BumpMap(&Bitmap,&BumpData);

}


LBitmap::Canvas

#include "ltwrappr.h"

L_INT LBitmap::Canvas(phCanvasBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

L_INT LBitmap::Canvas(plCanvasBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

pBITMAPHANDLE phCanvasBitmap; | /* pointer to the bitmap handle */
LBitmapBase * plCanvasBitmap; | /* pointer to LBitmapBase class object*/
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
phCanvasBitmap | Pointer to the bitmap handle that references the canvas bitmap.
plCanvasBitmap | Pointer to LBitmapBase class object 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 identify how to distribute the canvas image with respect to the image and how to handle resizing. The following flags identify how the distribute the canvas image with respect to the image:
 | Value | Meaning
 | CANVAS_FIT | [0x0000] Fit the canvas image so it has the same dimensions as the bitmap that is being applied to the canvas, without tiling.
 | CANVAS_SHIFT | [0x0010] Shift the canvas image by the amount specified in 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 Canvas 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 Canvas 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:

LBitmap::BumpMap

LBitmapBase::Combine

LBitmapBase::CombineBitmapWarp

LBitmap::TextureAlphaBlend

LBitmapBase::Underlay

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 LBase::EnableStatusCallback.

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: | LBitmap::Emboss, LBitmap::AddShadow, LBitmap::BumpMap, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmapBase::Combine, LBitmapBase::CombineBitmapWarp, LBitmap::SubtractBackground, LBitmap::TextureAlphaBlend, LBitmapBase::Underlay, LBitmap::UserFilter
Topics: | Raster Image Functions: Combining Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

This example is for LBitmap::Canvas(plCanvasBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

LBitmap LeadBitmap, CanvasBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
CanvasBitmap.Load(TEXT("C:\\IMAGE4.BMP"), 0,ORDER_BGR);
LeadBitmap.Canvas(&CanvasBitmap, 100, 100, 0, 0, 10, CANVAS_SHIFT);

This example is for LBitmap::Canvas(phCanvasBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

LBitmap LeadBitmap, CanvasBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
CanvasBitmap.Load(TEXT("C:\\IMAGE4.BMP"), 0,ORDER_BGR);
LeadBitmap.Canvas(CanvasBitmap.GetHandle(), 100, 100, 0, 0, 10, CANVAS_SHIFT);


LBitmap::ChangeContrast

#include "ltwrappr.h"

virtual L_INT LBitmap::ChangeContrast(nChange)

L_INT nChange;

/* amount of contrast change */

Increases or decreases the contrast of the image in a bitmap.

Parameter | Description
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 LBase::EnableStatusCallback.

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.

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
LTFIL
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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
m_Bitmap.ChangeContrast(500);


LBitmap::ChangeHue

#include "ltwrappr.h"

virtual L_INT LBitmap::ChangeHue(nAngle)

L_INT nAngle;

/* angular amount to change the hue, in degrees.*/

Changes the hue of colors in the class object's bitmap by rotating the color wheel.

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

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
// change each color to complement
m_Bitmap.ChangeHue(180);


LBitmap::ChangeHueSatIntBitmap

#include "ltwrappr.h"

virtual L_INT LBitmap::ChangeHueSatIntBitmap (nHue, nSaturation, nIntensity, pHsiData, uHsiDataCount)

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
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 LBitmap::ChangeHue, LBitmap::ChangeSaturation, and LBitmap::ChangeIntensity 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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmap::ChangeHue, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap)
{
HSIDATA HsiData; /*Color Range Information structure*/

/*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 */
pLeadBitmap->ChangeHueSatIntBitmap( 0, 0, 0, &HsiData, 1);
}


LBitmap::ChangeIntensity

#include "ltwrappr.h"

virtual L_INT LBitmap::ChangeIntensity(nChange)

L_INT nChange;

/* amount to change the intensity */

Changes the intensity (brightness) of the image in the class object's bitmap.

Parameter | Description
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 LBase::EnableStatusCallback.

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.

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
LTFIL
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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::ChangeHue, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
// Increase the intensity
m_Bitmap.ChangeIntensity(500);


LBitmap::ChangeSaturation

#include "ltwrappr.h"

virtual L_INT LBitmap::ChangeSaturation(nChange)

L_INT nChange;

/* amount to change saturation */

Increases or decreases the saturation of colors in the class object's bitmap.

Parameter | Description
nChange | Amount to change saturation. Values are percentages between -100 and +100.

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.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ChangeHue, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

//ChangeSaturation
LBitmap m_Bitmap;
m_Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
// Increase the Saturation
m_Bitmap.ChangeSaturation(20);


LBitmap::ChannelMix

#include "ltwrappr.h"

virtual L_INT LBitmap::ChannelMix (pRedFactor, pGreenFactor, pBlueFactor)

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

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ConvertToColoredGray, LBitmap::BalanceColors, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

/* The following example applies the LBitmap::ChannelMix function to it: */
void TestFunction(LAnimationWindow *BitmapWindow)
{
COLORDATA RedFact, GreenFact, BlueFact;
RedFact.uStructSize = sizeof(COLORDATA);
GreenFact.uStructSize = sizeof(COLORDATA);
BlueFact.uStructSize = sizeof(COLORDATA);
RedFact.nRedFactor = 250;
RedFact.nGreenFactor = 255;
RedFact.nBlueFactor = 222;
RedFact.nConstant = 0;
GreenFact.nRedFactor = 100;
GreenFact.nGreenFactor = 0;
GreenFact.nBlueFactor = 250;
GreenFact.nConstant = 0;
BlueFact.nRedFactor = 5;
BlueFact.nGreenFactor = 0;
BlueFact.nBlueFactor = 0;
BlueFact.nConstant = 0;

BitmapWindow->ChannelMix( &RedFact, &GreenFact, &BlueFact);
}


LBitmap::Clouds

#include "ltwrappr.h"

L_INT LBitmap::Clouds(uSeed, uFrequency, uDensity, uOpacity, crBackColor, crCloudsColor, uFlag)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.Clouds( 1000, 4, 10, 10, RGB(255,255,255), RGB(0,0,0), CLD_DIFFERENCE);


LBitmap::ColoredBalls

#include "ltwrappr.h"

L_INT LBitmap::ColoredBalls(uNumBalls, uSize, uSizeVariation, nHighLightAng, crHighLight, crBkgColor, crShadingColor, pBallColors, uNumOfBallColors, uAvrBallClrOpacity, uBallClrOpacityVariation, uRipple, uFlags)

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
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 how to use the balls:
 | 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 LBitmap::ColoredBalls function using the following values:

Parameter | Value
uNumBalls | 500
uSize | 10
uSizeVariation | 90
uHighLightAng | 315
urHighLight | White
urBkgColor | Blue
urShadingColor | 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
uUBallClrOpacityVariation | 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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::DrawStar
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Modifying Intensity Values

Example

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);

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.ColoredBalls(1000, 25, 15, 4500, 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);


LBitmap::ColoredPencil

#include "ltwrappr.h"

L_INT LBitmap::ColoredPencil (uRatio, uDim)

L_UINT uRatio; | /* color adjustment percentage */
L_UINT uDim; | /* size of the pencil coloring neighborhood */

Applies an effect to the 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
uRatio | Value that represents how much the bitmap colors should be adjusted so they appear to be colored pencil colors. Possible 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:

and you call the LBitmap::ColoredPencil 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 LBase::EnableStatusCallback.

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: | LBitmap::Impressionist, LBitmap::Dry
Topics: | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Filtering Images
 | Applying Artistic Effects
 | Detecting and Enhancing Edges and Lines

Example

/* The following example loads a bitmap and applies the colored pencil effect: */
/* Load the bitmap, keeping the bits per pixel of the file */
LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
/* pencil color the bitmap with Ratio value of 50 and with a neighborhood of 3x3 pixels*/
LeadBitmap.ColoredPencil(50, 3);


LBitmap::ColorHalfTone

#include "ltwrappr.h"

L_INT LBitmap::ColorHalfTone(uMaxRad, nCyanAngle, nMagentaAngle, nYellowAngle, nBlackAngle)

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
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 LBitmap::ColorHalfTone 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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmapSettings::DefaultDithering, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmap::AutoColorLevel, LBitmap::ColorLevel, LBitmap::Correlation, LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmap::SelectiveColor, LBitmap::Skeleton, LBitmap::HalfTone, LBitmap::ColorSeparate; LBitmap::ColorMerge; LBitmap::Desaturate; LBitmap::HalfTonePattern; LBitmap::ConvertToColoredGray; LBitmap::ColorizeGray; LBitmap::ShiftData; LBitmap::SelectData, LBitmap::GetMinMaxBits; LBitmap::GetMinMaxVal; LBitmap::GetHistogramGray; LBitmapBase::IsGrayScale; LBitmap::WindowLevel; LBitmap::WindowLevelFillLUT
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Correcting Colors Color Halftones and Halftone Images
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.ColorHalfTone(15, 10800, 16200, 9000,4500);


LBitmap::ColorIntensityBalance

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorIntensityBalance(pShadows, pMidTone, pHighLight, bLuminance)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ConvertToColoredGray, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::AutoColorLevel, LBitmap::ColorLevel, LBitmap::SelectiveColor
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap)
{
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;

/* Balance the colors by increasing the red channel values */
pLeadBitmap->ColorIntensityBalance(&Shadows, &MidTone, &HighLight, FALSE);
}


LBitmap::ColorizeGray

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorizeGray (pSrcBitmap, pGrayColors, uCount)

virtual L_INT LBitmap::ColorizeGray (plSrcBitmap, pGrayColors, uCount)

pBITMAPHANDLE pSrcBitmap; | /* pointer to the source bitmap handle */
pGRAYCOLOR pGrayColors; | /* pointer to an array of GRAYCOLOR structures */
L_UINT uCount; | /* number of elements in the pGrayColors array */
LBitmapBase * plSrcBitmap; | /* pointer to the source bitmap object */

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
pSrcBitmap | Pointer to the source bitmap that will contain the result of the function. The user should free the bitmap before passing it to the function.
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.
plSrcBitmap | Pointer to the source bitmap object that will contain the result of the function. The user should free the bitmap before passing it to the function.

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::WindowLevel, LBitmap::WindowLevelBitmap, LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmap::ShiftData, LBitmap::SelectData, GRAYCOLOR.
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pGrayBitmap, LBitmap *pColorBitmap)
{
/* This example loads a 16-bit grayscale bitmap and then colors it. */
pGRAYCOLOR pGrayColors;

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
pColorBitmap->ColorizeGray (pGrayBitmap, pGrayColors, 6);

free (pGrayColors);

pGrayBitmap->Free();

// Now we have the resulting image in pColorBitmap
}


LBitmap::ColorLevel

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorLevel (pLvlClr, uFlags)

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
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 LBitmap::ColorLevel function, you need to initialize the size and all remaining fields of the LVLCLRINF structures within the LVLCLR structure. These fields tell LBitmap::ColorLevel 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.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::AutoColorLevel, LBitmap::SelectiveColor
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Correcting Colors
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Correcting Colors

Example

/* This example applies image leveling to an image. */
void MyTestFunction(LAnimationWindow * LAniWnd)
{
LVLCLR lvlClr;
lvlClr.uStructSize = sizeof(LVLCLR);
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 */
LAniWnd->ColorLevel (&lvlClr, LEVEL_BLUE | LEVEL_MASTER);
}


LBitmap::ColorMerge

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorMerge(pLBitmaps, uStructSize, uFlags)

LBitmap L_FAR * pLBitmaps; | /* an array of LBitmap objects referencing the bitmaps to be merged. */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pLBitmaps */
L_UINT32 uFlags; | /* flag that indicates the 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 LBitmap::ColorSeparate function creates.

Parameter | Description
pLBitmaps | An array of LBitmap objects referencing the bitmaps to be merged.
 | The objects 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 object 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.
uStructSize | Size in bytes, of the structure pointed to by pLBitmaps. Use sizeof(BITMAPHANDLE).
uFlags | Flag that indicates the type of separation that was used to create the grayscale images. Possible values are:
 | Value | Meaning
 | COLORSEP_RGB | [0x00] Merge images from three RGB planes.
 | COLORSEP_CMYK | [0x01] Merge images from four CMYK planes.
 | COLORSEP_HSV | [0x02] Merge images from three HSV planes.
 | COLORSEP_HLS | [0x03] Merge images from three HLS planes.
 | COLORSEP_CMY | [0x04] Merge images from three CMY planes.
 | COLORSEP_YUV | [0x05] Merge images from three YUV planes.
 | COLORSEP_XYZ | [0x06] Merge images from three XYZ planes.
 | COLORSEP_LAB | [0x07] Merge images from three LAB planes.
 | COLORSEP_YCrCb | [0x08] Merge images form three YCrCb planes.
 | COLORSEP_SCT | [0x09] 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 in the pLBitmaps array are 16-bit grayscale 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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmap::ColorSeparate, LBitmap::WindowLevel, Class Members
Topics: | Processing an Image
 | Changing Brightness and Contrast
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Processing an Image

Example

For an example, refer to LBitmap::ColorSeparate.


LBitmap::ColorReplace

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorReplace (pColorReplace, uColorCount, nHue, nSaturation, nBrightness)

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

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmap::ChangeHue, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap)
{
COLORREPLACE ColorReplace; /*replaced color structure information*/
/* Change the red color by rotating its hue 90 degree*/
ColorReplace.crColor = RGB(200, 0, 35);
ColorReplace. uFuzziness = 100;
pLeadBitmap->ColorReplace(&ColorReplace, 1, 9000, 0, 0);
}


LBitmap::ColorSeparate

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorSeparate(pLBitmaps, uStructSize, uFlags)

LBitmap L_FAR * pLBitmaps; | /* an array of LBitmap objects that will reference the grayscale bitmaps when they are created */
L_UINT uStructSize; | /* size in bytes, of the structures pointed to by pLBitmaps. */
L_UINT32 uFlags; | /* flag that indicates the type of separation */

Separates the class object's bitmap by color plane to produce one grayscale image per plane. You can specify any of several color-space models, including CMYK.

Parameter | Description
pLBitmaps | An array of LBitmap objects that will reference the grayscale bitmaps when they are created.
 | The objects 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 object 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.
uStructSize | Size in bytes, of the structures pointed to by pLBitmaps. Use sizeof(BITMAPHANDLE).
uFlags | Flag that indicates the type of separation. Possible values are:
 | Value | Meaning
 | COLORSEP_RGB | [0x00] Create images for three RGB planes.
 | COLORSEP_CMYK | [0x01] Create images for four CMYK planes.
 | COLORSEP_HSV | [0x02] Create images for three HSV planes.
 | COLORSEP_HLS | [0x03] Create images for three HLS planes.
 | COLORSEP_CMY | [0x04] Create images for three CMY planes.
 | COLORSEP_YUV | [0x05] Create images for three YUV planes.
 | COLORSEP_XYZ | [0x06] Create images for three XYZ planes.
 | COLORSEP_LAB | [0x07] Create images for three LAB planes.
 | COLORSEP_YCrCb | [0x08] Create images for three YCrCb planes.
 | COLORSEP_SCT | [0x09] 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 source bitmap is 48 or 64-bit 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmap::ColorMerge, LBuffer::ConvertColorSpace, LDialogColor::DoModalColorRes, LBitmap::WindowLevel, Class Members
Topics: | Processing an Image
 | Changing Brightness and Contrast
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast
 | Raster Image Functions: Processing an Image

Example

/* This example creates color separations and merges them */
LBitmap LeadBitmap; /* Bitmap handle to hold the loaded image */
LBitmap ColorPlanes[4]; /* Array of bitmap handles */
/* load an image */
LeadBitmap.Load(TEXT("image1.cmp"));
/* Separate the color planes */
LeadBitmap.ColorSeparate(ColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmap */
LeadBitmap.Free();
/* Merge the color planes */
LeadBitmap.ColorMerge(ColorPlanes, sizeof(BITMAPHANDLE), COLORSEP_CMYK);
/* Free the bitmaps used for color planes */
ColorPlanes[0].Free();
ColorPlanes[1].Free();
ColorPlanes[2].Free();
ColorPlanes[3].Free();


LBitmap::ColorThreshold

#include "ltwrappr.h"

virtual L_INT LBitmap::ColorThreshold (uColorSpace, pCompData)

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
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 LBuffer::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:

The bitmap is converted to the required color space.

For every pixel, the following operations are performed: Each component is compared with the nMinRange and nMaxRange ranges of the appropriate COMPDATA structure.

If it is inside the range, the component is considered to have "passed" the test.

If it is outside the range, the component has been rejected". The CLTH_TYP_BANDREJECT flag inverts this by making "rejected" components "passed" and viceversa.

If CLTH_MOD_CHANNEL is set, the components are modified independently. If CLTH_MOD_ALL has been passed, the pixel is rejected by the test if any component is rejected. If the pixel/component is rejected, then:

If CLTH_VALUE_MIN is passed, the rejected pixel/component is set to 0.

If CLTH_VALUE_MAX is passed, the rejected pixel/component is set to 255.

If CLTH_VALUE_CLAMP is passed, components less that 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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BinaryFilter, LBuffer::ConvertColorSpace, LBitmap::ColorSeparate, LBitmap::ColorMerge, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Getting and Setting Pixel Values
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap)
{
COMPDATA pCompData[3];
L_INT nI;

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*/
pLeadBitmap->ColorThreshold(CLTH_RGB_SPACE, pCompData);

}


LBitmap::ContBrightInt

#include "ltwrappr.h"

virtual L_INT LBitmap::ContBrightInt (nContrast, nBrightness, nIntensity);

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::ChangeSaturation, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::ColorLevel, LBitmap::AutoColorLevel, LBitmap::SelectData, LBitmap::ColorizeGray
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example performs the adjustments. */
pLeadBitmap->ContBrightInt (-146, 385, 240);
}


LBitmap::ContourFilter

#include "l_bitmap.h"

virtual L_INT LBitmap::ContourFilter (nThreshold, nDeltaDirection, nMaximumError, nOption)

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

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.

See Also

Functions:

LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LDialogImageEffect::DoModalContourFilter


LBitmap::ConvertSignedToUnsigned

#include "ltwrappr.h"

virtual L_INT LBitmap::ConvertSignedToUnsigned(uShift)

L_UINT uShift; /* shifting option */

Converts a signed bitmap to unsigned.

Parameter | Description
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 LBitmapBase::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 LBitmapBase::IsPixelsSigned() is TRUE).

If the LBitmapBase::IsPixelsSigned() is 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 Bitmap object.

This function supersedes LBitmapBase::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.

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: | LBitmapBase::ClearNegativePixels, LBitmap::ConvertUnsignedToSigned
Topics: | Processing an Image
 | Raster Image Functions: Getting and Setting Pixel Values

Example

L_VOID MyConvertSignedToUnsigned(LBitmap * plBitmap)
{
/* clear negative pixels if signed */
if(plBitmap.IsPixelsSigned() )
plBitmap->ConvertSignedToUnsigned(SHIFT_NEG_TO_ZERO);
}


LBitmap::ConvertToColoredGray

#include "ltwrappr.h"

virtual L_INT LBitmap::ConvertToColoredGray(RedFact, GreenFact, BlueFact, RedGrayFact, GreenGrayFact, BlueGrayFact)

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 the class object's bitmap to a grayscale bitmap, then enhances the color components based on the specified parameters.

Parameter | Description
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 LBitmap::GrayScaleExt function. LBitmap::ConvertToColoredGray can be used to give images an "sepia" look by adding a blue or brown color.

The summation (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 LBitmap::GrayScaleExt 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

LTDIS
LTFIL
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: | LBitmap::BalanceColors, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

L_INT ConverToColoredGray(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.ConvertToColoredGray(100, 300, 600, 200, 300, 500);
}


LBitmap::ConvertUnsignedToSigned

#include "ltwrappr.h"

virtual L_INT LBitmap::ConvertUnsignedToSigned(uFlag)

L_UINT uFlag;

/* flag */

Converts an unsigned bitmap to signed.

Parameter | Description
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 MaxVal and MinVal different values with new values that consider bitmap new sign. Also LBitmapBase::IsPixelsSigned() 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

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: | LBitmapBase::ClearNegativePixels, LBitmap::ConvertSignedToUnsigned
Topics: | Processing an Image
 | Raster Image Functions: Getting and Setting Pixel Values

Example

L_VOID MyConvertUnsignedToSigned(LBitmap * plBitmap)
{
/* convert bitmap to signed */
if(!plBitmap->IsPixelsSigned() )
plBitmap->ConvertUnsignedToSigned(PROCESS_RANGE_ONLY);
}


LBitmap::Correlation

#include "ltwrappr.h"

virtual L_INT LBitmap::Correlation (phCorBitmap, pPoints, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold)

virtual L_INT LBitmap::Correlation (plCorBitmap, pPoints, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold)

pBITMAPHANDLE phCorBitmap; | /* pointer to the correlation bitmap handle */
LBitmapBase plCorBitmap; | /* pointer to the correlation bitmap object */
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
phCorBitmap | Pointer to the bitmap handle that references the bitmap for which to search.
plCorBitmap | Pointer to the bitmap object 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 phCorBitmap (or a part of phCorBitmap) with all the areas of the same dimensions in Bitmap object 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 Bitmap object where the resemblance with phCorBitmap (or part of phCorBitmap) is greater than the value of uThreshold. The pCorBitmap dimensions must be less than or equal to the Bitmap object dimensions.

For example:

Select a bitmap of the object for which you want to look. Put it in phCorBitmap

For example:

Select a bitmap that contains the object for which you are searching and put it in Bitmap object.

For example:

Call LBitmap::Correlation from your bitmap object.

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 phCorBitmap is greater than the correlation threshold. The height and width of the rectangles are the same as for phCorBitmap.

The result is:

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: | LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter.
Topics: | Processing an Image
 | Raster Image Functions: Comparing Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Processing an Image

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LBitmap CorBitmap;
POINT pPoints[10] = {0};
L_UINT uNumOfPoints;
/* Load the bitmap, keeping the bits per pixel of the file */
CorBitmap.Load(TEXT("c:\\T.BMP"));

/*Apply the correlation filter*/
LAniWnd->Correlation(&CorBitmap, pPoints, 90 , &uNumOfPoints, 1, 2, 10);
CorBitmap.Free();
}


LBitmap::CorrelationList

#include "ltwrappr.h"

L_INT LBitmap::CorrelationList(hCorList, pPoints, puListIndex, uMaxPoints, puNumOfPoints, uXStep, uYStep, uThreshold)

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
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 the bitmap image 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 the bitmap image 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 bitmap image 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 as your bitmap image.

For example:

3. | Call the LBitmap::CorrelationList function.
4. | The function will update the pPoints array parameter with the point of origin (top-left) for each area of the bitmap image 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 LBitmap::Correlation function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Correlation
Topics: | Processing an Image
 | Raster Image Functions: Comparing Images
 | Raster Image Functions: Processing an Image
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

L_INT nRet = 0;
POINT pPoints[10] = {0};
L_UINT puListIndex [10] = {0};
L_UINT uNumOfPoints = 0 ;
LBitmap LeadBitmap, Bitmap1, Bitmap2;
LBitmapList BitmapList;

BitmapList.Create() ;
nRet = LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
nRet = Bitmap1.Load(TEXT("C:\\letterA.bmp"),0,ORDER_BGR);
nRet = Bitmap2.Load(TEXT("C:\\letterD.bmp"),0,ORDER_BGR);

nRet = BitmapList.InsertItem(&Bitmap1);
nRet = BitmapList.InsertItem(&Bitmap2);
nRet = LeadBitmap.CorrelationList(BitmapList.GetHandle(), pPoints, puListIndex, 90 , &uNumOfPoints, 1, 2, 10);
BitmapList.Destroy() ;


LBitmap::CountLUTColors

#include "ltwrappr.h"

static L_INT LBitmap::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 whether the LUT belongs to a signed or unsigned image. Possible values are:
 | Value | Meaning
 | COUNT_LUT_UNSIGNED | [0x0001] LUT belongs to a signed image.
 | COUNT_LUT_SIGNED | [0x0002] LUT belongs to an 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.

See Also

Functions: | LBitmap::WindowLevel, LBitmap::WindowLevelFillLUT, LBitmap::GetUserLookupTable, LBitmap::RemapIntensity, LBitmap::ApplyLinearVOILUT, Class Members
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(LBitmap * pBitmap, L_UINT * pNumberOfEntries, L_INT *pFirstIndex)
{
return LBitmap::CountLUTColors (pBitmap->GetHandle()->pLUT, pBitmap->GetHandle()->LUTLength,
pNumberOfEntries,pFirstIndex, pBitmap->GetHandle()->Flags.Signed? COUNT_LUT_SIGNED:COUNT_LUT_UNSIGNED );
}


LBitmap::Cubism

#include "ltwrappr.h"

virtual L_INT LBitmap::Cubism(uSpace, uLength, nBrightness, nAngle, crColor,uFlags)

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
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 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 LBase::EnableStatusCallback.

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:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::Mosaic, LBitmap::Pixelate, LBitmap::MotionBlur, LBitmap::RemoveRedeye, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

/* The following example applies the cubism function to it: */
void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->Cubism(5,15,200,4500,RGB(255,0,0), CUB_COLOR | CUB_RECT | CUB_RAND);
}


LBitmap::Cylindrical

#include "ltwrappr.h"

virtual L_INT LBitmap::Cylindrical (nValue, uType)

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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalCylindrical, LBitmap::Bending, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LAniWnd->Cylindrical(80,CYL_VERT);
}


LBitmap::Deinterlace

#include "ltwrappr.h"

virtual L_INT LBitmap::Deinterlace(uFlags)

L_UINT uFlags;

/*flags */

Deinterlaces a video source image.

Parameter | Description
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 on 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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::BinaryFilter, LBitmap::Pixelate, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel
Topics: | Raster Image Functions: Modifying Intensity Values
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

/* The following applies the deinterlace function to it: */
void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->Deinterlace(DEINTERLACE_SMOOTH | DEINTERLACE_ODD);
}


LBitmap::Desaturate

#include "ltwrappr.h"

virtual L_INT LBitmap::Desaturate()

Converts the image to a grayscale level by reducing the saturation of each color to zero. The conversion will not change the color resolution.

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 LBase::EnableStatusCallback.

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: | LBitmap::BalanceColors, LBitmap::GrayScaleExt, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->Desaturate();
}


LBitmap::Deskew

#include "ltwrappr.h"

virtual L_INT LBitmap::Deskew(pnAngle=NULL, crFill, uFlags)

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 Document/Medical toolkits only.

Parameter | Description
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 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 the flags use DSKW_NOPROCESS, the function will return the deskew angle in the pnAngle variable, without image rotation .

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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::Despeckle, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Processing an Image
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Processing an Image

Example

LBitmap LeadBitmap;
L_INT32 lRotatedAngle;
L_TCHAR szDummyBuffer[50];

LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
// Deskew the image, and get the angle with which the image was rotated
LeadBitmap.Deskew(&lRotatedAngle, RGB(0,0,0), DSKW_PROCESS | DSKW_NOFILL| DSKW_DOCUMENTIMAGE);
wsprintf(szDummyBuffer, TEXT("The image was rotated with %d degrees"), lRotatedAngle/100);
MessageBox(0, szDummyBuffer, TEXT("Deskew"), MB_OK);


LBitmap::DeskewExt

#include "ltwrappr.h"

L_INT LBitmap::DeskewExt(pnAngle, uAngleRange, uAngleResolution, crBack, uFlags)

L_INT32 L_FAR * pnAngle; | /* rotation angle */
L_UINT uAngleRange; | /* angle range */
L_UINT uAngleResolution; | /* angle resolution */
COLORREF crBack; | /* backgtound 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
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.
crBack | 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 crBack 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 crBack 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 LBitmap::Deskew, you can use this function to automatically straighten scanned documents. With this function, deskewing 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 LBase::EnableStatusCallback.

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: | LBitmap::Despeckle, LBitmap::WindowLevel, LBitmap::ApplyTransformationParameters, LBitmap::GetMarksCenterMass, LBitmap::GetTransformationParameters, LBitmap::IsRegMarkBitmap, LBitmap::SearchRegMarks, LBitmap::Deskew
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.DeskewExt(NULL, 1000, 2, 0,
DSKW_PROCESS | DSKW_NOFILL| DSKW_LINEAR| DSKW_DOCUMENTIMAGE);


LBitmap::Despeckle

#include "ltwrappr.h"

virtual L_INT LBitmap::Despeckle(void);

Removes speckles from the class object's bitmap. Typically, this function is used to clean up scanned images (such as FAX images). This function is available in Document/Medical toolkits only.

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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Deskew, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Despeckle ();


LBitmap::DFT

#include "ltwrappr.h"

virtual L_INT LBitmap::DFT (pFTArray, prcRange, uFlags)

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
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 LBitmap::FFT 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, LBitmap::FFT, imposes upon bitmaps.

Before using this function, you need to use the LBitmap::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 LBitmap::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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example loads a bitmap and applies DFT function. */
L_INT y;
RECT rcRange;
pFTARRAY pFTArray;
/*Allocate FT buffer*/
pLeadBitmap->AllocFTArray (&pFTArray, sizeof(FTARRAY));
rcRange.left = 0;
rcRange.right = pLeadBitmap->GetWidth () / 4;
rcRange.top = 0;
rcRange.bottom = pLeadBitmap->GetHeight () / 2;
/* Apply DFT*/
pLeadBitmap->DFT(pFTArray, &rcRange, DFT_DFT | DFT_GRAY |
DFT_RANGE| DFT_INSIDE_X| DFT_OUTSIDE_Y);
/*
:
:
Free FT buffer */
LBitmap::FreeFTArray (pFTArray);
}


LBitmap::DiceEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::DiceEffect (uXBlock, uYBlock, uRandomize, uFlags, crColor);

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
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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::PuzzleEffect, LBitmap::RingEffect
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies a Dice Effect over the loaded image. */
/* Apply Dice Effect for this bitmap */
pLeadBitmap->DiceEffect (16, 16,0, BITMAP_RESIZE | DICE_SIZE | DICE_BORDER, RGB(0,0,0));
}


LBitmap::DiffuseGlow

#include "ltwrappr.h"

L_INT LBitmap::DiffuseGlow(nGlowAmount, uClearAmount, uSpreadAmount, uWhiteNoise, crGlowColor)

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
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 LBitmap::DiffuseGlow 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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::Dry, LBitmap::GlowFilter, LBitmap::Ocean, LBitmap::GlassEffect, LBitmap::LensFlare, LBitmap::Light, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.DiffuseGlow(500, 500, 200, 50, RGB(255, 255, 255));


LBitmap::DigitalSubtract

#include "ltwrappr.h"

virtual L_INT LBitmap::DigitalSubtract (pMaskBitmap, uFlags);

virtual L_INT LBitmap::DigitalSubtract (plMaskBitmap, uFlags);

pBITMAPHANDLE pMaskBitmap; | /* pointer to the source mask bitmap handle */
L_UINT uFlags; | /* flags that specify how to process the bitmap */
LBitmapBase *plMaskBitmap; | /* pointer to the source mask bitmap object */

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
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.
plMaskBitmap | Pointer to the bitmap object referencing the mask bitmap. The mask bitmap is the source bitmap. plMaskBitmap will not be affected.

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::ShiftData, LBitmap::SelectData, LBitmap::ColorizeGray, LBitmap::MultiScaleEnhancementBitmap, LBitmapBase::Combine
Topics: | Raster Image Functions: Modifying Intensity Values
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

void TestFunction(LBitmap *pLeadBitmap, LBitmap *pMaskBmp)
{
/* This example performs digital subtraction. */

pLeadBitmap->DigitalSubtract (pMaskBmp, DS_CONTRASTENH);
// Now we have the resulting image in LiveBmp
}


LBitmap::DirectionEdgeStatistical

#include "ltwrappr.h"

virtual L_INT LBitmap::DirectionEdgeStatistical (uDim, uThreshold, nAngle, crEdgeColor, crBkColor)

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 LBitmap::EdgeDetectStatistical, 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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmapBase::Combine, LBitmap::IntensityDetect, LBitmap::Sharpen, LBitmap::SpatialFilter, LBitmap::EdgeDetector, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
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

void TestFunction(LBitmap *pLeadBitmap)
{
/* Find the edges in the bitmap*/
pLeadBitmap->DirectionEdgeStatistical (15, 128, 4500, RGB(255, 255, 255), RGB(0, 0, 0));
}


LBitmap::DisplaceMap

#include "ltwrappr.h"

L_INT LBitmap::DisplaceMap(phDisplacementMap, uHorzFact, uVertFact, crFill, uFlags)

L_INT LBitmap::DisplaceMap(plDisplacementMap, uHorzFact, uVertFact, crFill, uFlags)

pBITMAPHANDLE phDisplacementMap; | /* pointer to the displacement bitmap handle */
LBitmapBase * plDisplacementMap; | /* pointer to LBitmapBase class object*/
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
phDisplacementMap | Pointer to the bitmap handle that references the displacement map bitmap.
plDisplacementMap | Pointer to LBitmapBase class object 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 LBitmap::DisplaceMap 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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::Dry, LBitmap::GlowFilter, LBitmap::Ocean, LBitmap::GlassEffect, LBitmap::LensFlare, LBitmap::Light, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Processing an Image
 | Raster Image Functions: Processing an Image
 | Raster Image Functions: Combining Images
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Artistic Effects

Example

This example is for LBitmap::DisplaceMap(plDisplacementMap, uHorzFact, uVertFact, crFill, uFlags)

LBitmap btmp ;
LBitmap LeadBitmap;
L_INT n = LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
n = btmp.Load(TEXT("displacementmap.bmp"),0,ORDER_BGR) ;
/* Shift the image according to the displacement map*/
LeadBitmap.DisplaceMap(&btmp, 5, 5, RGB(0,0,0), FILL_CLR|DSPL_TILE);

This example is for LBitmap::DisplaceMap(phDisplacementMap, uHorzFact, uVertFact, crFill, uFlags)

LBitmap btmp ;
LBitmap LeadBitmap;
L_INT n = LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
n = btmp.Load(TEXT("displacementmap.bmp"),0,ORDER_BGR) ;
/* Shift the image according to the displacement map*/
LeadBitmap.DisplaceMap(btmp.GetHandle(), 5, 5, RGB(0,0,0), FILL_CLR|DSPL_TILE);


LBitmap::DotRemove

#include "ltwrappr.h"

virtual L_INT LBitmap::DotRemove(pDotRemove)

LPDOTREMOVE pDotRemove;

/* pointer to a structure */

Finds and removes dots and specks of various sizes. This function is available in the Document/Medical Toolkits.

Parameter | Description
pDotRemove | Pointer to the DOTREMOVE structure that LEADTOOLS uses to remove dots.

Returns

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

Comments

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.

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.

The behavior of this function can be modified by overriding LBitmap::DotRemoveCallback.

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: | LBitmap::DotRemoveCallback, LBitmap::Smooth, LBitmap::LineRemove, LBitmap::InvertedText, LBitmap::BorderRemove, LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

//This example updates a region with all 1x1 to 3x3 specks that are solid black
//If a speck has any white pixels, it is NOT added to the region
//The call is configured to update a single LEAD region corresponding to all changes
//The image itself is unchanged
//The derived class LMyBitmap is used to override the DotRemoveCallBack function
//The callback member function is used to display information about each speck that is removed
//The callback member function does NOT receive a Windows region

void CCleanv12Dlg::OnButtonDots()
{
L_INT32 nRet;
BITMAPHANDLE BitmapRegion;
DOTREMOVE dr;
dr.uStructSize = sizeof(DOTREMOVE);

memset(&BitmapRegion, 0, sizeof(BITMAPHANDLE));

dr.uStructSize = sizeof(DOTREMOVE);

dr.uBitmapStructSize = sizeof(BITMAPHANDLE);
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;
dr.uBitmapStructSize = sizeof(BitmapRegion);
nRet = m_Bitmap.DotRemove(&dr);

if (nRet == SUCCESS)
{
//Delete the existing region
LBitmapRgn Region(&m_Bitmap);
if(Region.BitmapHasRgn())
{
Region.Free();
}

m_Bitmap.SetHandle(dr.pBitmapRegion, FALSE);
Invalidate();
}
}

L_INT LMyBitmap::DotRemoveCallBack(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iWhiteCount,
L_INT32 iBlackCount
)
{
CString strMsg;
L_INT32 nRet;

//Note: no hRgn to delete because it was not requested
strMsg.Format(
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(strMsg);

//Do not remove the speck if it contains any white pixels
if (iWhiteCount > 0)
{
nRet = SUCCESS_NOREMOVE;
}
else
{
nRet = SUCCESS_REMOVE;
}
return nRet;
}


LBitmap::DotRemoveCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::DotRemoveCallBack(hRgn, pBoundingRect, iWhiteCount, iBlackCount)

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 */

Called for each dot found by LBitmap::DotRemove. 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.

Returns

SUCCESS_REMOVE | Remove the dot.
SUCCESS_NOREMOVE | Do not remove the dot.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This function 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 LBitmap::DotRemove(). If DOT_IMAGE_UNCHANGED and DOT_SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::DotRemove
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::DotRemove.


LBitmap::DrawStar

#include "ltwrappr.h"

virtual L_INT LBitmap::DrawStar(pStarInfo)

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
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 LBase::EnableStatusCallback.

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:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay,.LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
STARINFO StarInfo;
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 = BitmapWindow->GetWidth()/2;
StarInfo.pCenter.y = BitmapWindow->GetHeight ()/2;
StarInfo.uFlag = STR_INSIDE;
StarInfo.uHoleSize = 50;
StarInfo.uOpacity = 100;
StarInfo.uSpoke = 5;
StarInfo.uStarHeight = BitmapWindow->GetHeight()/2;
StarInfo.uStarWidth = BitmapWindow->GetWidth()/2;
StarInfo.crFillUpper = RGB(255, 0, 0);
StarInfo.crFillLower = RGB(0, 0, 255);

BitmapWindow->DrawStar(&StarInfo);
}


LBitmap::Dry

#include "ltwrappr.h"

virtual L_INT LBitmap::Dry (uDim)

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

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->Dry(5);
}


LBitmap::DynamicBinary

#include "ltwrappr.h"

virtual L_INT LBitmap::DynamicBinary (uDim, uLocalContrast)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::HighPassFilter, LBitmap::IntensityDetect, LBitmap::IntensityDetect, LBitmap::MedianFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::WindowLevel, LBitmap::Despeckle, LBitmap::Deskew
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Changing Brightness and Contrast

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example converts it into a black and white image without changing its bits per pixel */
/* convert it into a black and white image without changing its bits per pixel */
pLeadBitmap->DynamicBinary (8, 16);
}


LBitmap::EdgeDetectEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::EdgeDetectEffect(uLevel, uThreshold, uFlags)

L_UINT uLevel; | /* edge weight */
L_UINT uThreshold; | /* threshold value */
L_UINT uFlags; | /* edges type */

Performs edge detection on the image.

Parameter | Description
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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::EdgeDetector, LBitmap::SpatialFilter, LBitmap::EdgeDetectStatistical, LBitmap::DirectionEdgeStatistical.
Topics: | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* Apply find edges effect on the image*/
pLeadBitmap->EdgeDetectEffect(50, 0, EDGE_SOFT);
}


LBitmap::EdgeDetector

#include "ltwrappr.h"

virtual L_INT LBitmap::EdgeDetector (uThreshold, uFilter)

L_UINT uThreshold; | /* threshold value */
L_UINT uFilter; | /* filter to be used */

Applies the specified edge filter to the class object's bitmap. This function is available in the Document Toolkits.

Parameter | Description
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

LTDIS
LTFIL
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: | LBitmap::DiffuseGlow, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::IntensityDetect, LBitmap::Sharpen, LBitmap::SpatialFilter, Class Members
Topics: | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Image Processing: Filtering Images
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
Bitmap.Load(szFile);
Bitmap.EdgeDetector(60, EDG_SOBEL_ALL);
}


LBitmap::EdgeDetectStatistical

#include "ltwrappr.h"

virtual L_INT LBitmap::EdgeDetectStatistical (uDim, uThreshold, crEdgeColor, crBkColor)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmapBase::Combine, LBitmap::IntensityDetect, LBitmap::Sharpen, LBitmap::SpatialFilter, LBitmap::EdgeDetector
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

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->EdgeDetectStatistical (15, 128, RGB(255, 255, 255), RGB(0, 0, 0));
}


LBitmap::Emboss

#include "ltwrappr.h"

virtual L_INT LBitmap::Emboss(uDirection=EMBOSS_N, uDepth=500)

L_UINT uDirection; | /* direction of the apparent light source */
L_UINT uDepth; | /* apparent depth of this three-dimensional effect */

Applies an emboss effect to the class object's bitmap, letting you specify the depth and direction of the effect.

Parameter | Description
uDirection | The direction of the apparent light source. Possible 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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("V:\\images\\babe.cmp"), 0,ORDER_BGR);
LeadBitmap.Emboss();


LBitmap::ExtractMessage

#include "ltwrappr.h"

virtual L_INT LBitmap::ExtractMessage (pAddMesgInfo)

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
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 LBitmap::AddMessage.

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.

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.

See Also

Functions: | LBitmap::AddMessage.
Topics: | Raster Image Functions: Getting and Setting File Information
 | Non-Image Data

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LPADDMESGINFO pAddMesgInfo;

pAddMesgInfo = new ADDMESGINFO;

if(!pAddMesgInfo)
return;

memset(pAddMesgInfo, 0, sizeof(ADDMESGINFO));
pAddMesgInfo->uStructSize = sizeof(ADDMESGINFO);
LAniWnd->ExtractMessage(pAddMesgInfo);
MessageBox(NULL, pAddMesgInfo->pStrMsg, TEXT("Notice"), MB_OK);
}


LBitmap::FFT

#include "ltwrappr.h"

virtual L_INT LBitmap::FFT (pFTArray, uFlags)

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
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 LBitmap::DFT 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 LBitmap::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 LBitmap::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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example loads a bitmap and applies a FFT transformation. */
pFTARRAY pFTArray;
/* Resize the bitmap to make sure the bitmap dimensions are power of two*/
pLeadBitmap->Size (256, 512, SIZE_BICUBIC);
/* Allocate FFT buffer*/
pLeadBitmap->AllocFTArray (&pFTArray, sizeof(FTARRAY));
/* Apply FFT*/
pLeadBitmap->FFT( pFTArray, FFT_FFT | FFT_GRAY);
/*
:
:
Free FFT buffer */
LBitmap::FreeFTArray (pFTArray);
}


LBitmap::Fragment

#include "ltwrappr.h"

L_INT LBitmap::Fragment(uOffset, uOpacity)

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
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 LBitmap::DisplaceMap function to displace a bitmap's pixels horizontally and vertically according to the values of the displacement map image.

Use the LBitmap::Offset function to shift a bitmap's pixels horizontally and vertically.

Use the LBitmapRgn::Offset 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 LBase::EnableStatusCallback.

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: | LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::FeatherAlphaBlend, LBitmapBase::CreateFadedMask, LBitmap::TextureAlphaBlend, LBitmap::DisplaceMap, LBitmap::Offset, LBitmapRgn::Offset, LBitmap::BumpMap, LBitmap::Canvas, LBitmapBase::CombineBitmapWarp, LBitmap::BricksTexture, LBitmap::DisplaceMap
Topics: | Raster Image Functions: Combining Images
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.Fragment( 4, 100);


LBitmap::FreeFTArray

#include "ltwrappr.h"

static L_INT LBitmap::FreeFTArray(pFTArray)

pFTARRAY pFTArray;

/* pointer to structure */

Frees the 2D storage array that was allocated by LBitmap::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.

See Also

Functions: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

For an example, refer to LBitmap::DFT.


LBitmap::FreeHandShear

#include "ltwrappr.h"

virtual L_INT LBitmap::FreeHandShear(pAmplitudes, uAmplitudesCount, uScale, crFill, uFlags)

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
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 LBitmap::GetCurvePoints function. They may also be obtained through the Wave Shear Dialog, LDialogImageEffect::DoModalWaveShear.
uAmplitudesCount | Number of entries in the pAmplitudes array.
uScale | Factor used to 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 pAmplitudes data can be obtained from the LBitmap::GetCurvePoints function. They may also be obtained through the Wave Shear Dialog, LDialogImageEffect::DoModalWaveShear.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LDialogImageEffect::DoModalWaveShear, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT apUserPoint [4];
L_INT pAmplitudes[13];
L_INT nMax, i;

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 stores it in pAmplitudes array*/
LAnimationWindow::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));
}
}

LAniWnd->FreeHandShear(pAmplitudes, 13, 100,0, FILL_RPT | SHR_HORZ);
}


LBitmap::FreeHandWave

#include "ltwrappr.h"

virtual L_INT LBitmap::FreeHandWave (pAmplitudes, uAmplitudesCount, uScale, uWaveLen, nAngle, crFill, uFlags)

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
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 LBitmap::GetCurvePoints function. They may also be obtained through the Wave Shear Dialog, LDialogImageEffect::DoModalWaveShear.
uAmplitudesCount | Number of entries in the pAmplitudes array.
uScale | Factor used to 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.
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 in 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 pAmplitudes data can be obtained from the LBitmap::GetCurvePoints function, or from the Wave Shear Dialog, LDialogImageEffect::DoModalWaveShear.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LDialogImageEffect::DoModalFreeHandWave, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT apUserPoint [4];
L_INT aAmplitudes[13];
/* Load a bitmap at its own bits per pixel */
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;

LAnimationWindow::GetCurvePoints(aAmplitudes, apUserPoint, 4, NULL, GUB_LINEAR);

LAniWnd->FreeHandWave(aAmplitudes, 13, 100, 10, 0, 0, FILL_RPT | DIS_FRQ);
}


LBitmap::FreePlaneBend

#include "ltwrappr.h"

virtual L_INT LBitmap::FreePlaneBend(pnCurve, uCurveSize, uScale, crFill, uFlags)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT apUserPoint [4];
L_INT pnCurve[13];

/* Applay 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;
LAnimationWindow::GetCurvePoints(pnCurve, apUserPoint, 4, NULL, GUB_LINEAR);

BitmapWindow->FreePlaneBend(pnCurve, 13,200, RGB(255,0,0), FILL_CLR | FPB_VERT);
}


LBitmap::FreeRadBend

#include "ltwrappr.h"

virtual L_INT LBitmap::FreeRadBend(pnCurve, uCurveSize, uScale, CenterPt,crFill, uFlags)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT apUserPoint [4];
L_INT pnCurve[13];
POINT CenterPt;
/* Applay 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;
LAnimationWindow::GetCurvePoints (pnCurve, apUserPoint, 4, NULL, GUB_LINEAR);
CenterPt.x = BitmapWindow->GetWidth()/2;
CenterPt.y = BitmapWindow->GetHeight()/2;

BitmapWindow->FreeRadBend(pnCurve, 13,200, CenterPt, RGB(255,0,0), FILL_CLR | FILL_ROT);
}


LBitmap::FrqFilter

#include "ltwrappr.h"

static L_INT LBitmap::FrqFilter(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 LBitmap::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 LBitmap::FreeFTArray function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap, pFTARRAY pFTArray)
{
/* this example filters the acxData of a pFTARRAY structure produced by the Fast Fourier Transform function*/
RECT rcRange;
rcRange.left = 0;
rcRange.right = pLeadBitmap->GetWidth () / 4;
rcRange.top = 0;
rcRange.bottom = pLeadBitmap->GetHeight () / 2;
/*lpFTData is known*/
/* filters the frequencies*/
LBitmap::FrqFilter(pFTArray, &rcRange, FRQ_INSIDE_X | FRQ_INSIDE_Y);
}


LBitmap::FrqFilterMask

#include "ltwrappr.h"

virtual L_INT LBitmap::FrqFilterMask(pFTArray, bOnOff)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap, LBitmap *pMaskBitmap, pFTARRAY pFTArray)
{
/* Assume acxData field of pFTArray is the correct size*/
/* apply DFT*/
pLeadBitmap->DFT (pFTArray, NULL, DFT_DFT | DFT_GRAY);

/* filter frequencies */
pMaskBitmap->FrqFilterMask( pFTArray, TRUE);

/* apply inverse DFT */
/* After this call, the image should be clean */
pLeadBitmap->DFT (pFTArray, NULL, DFT_IDFT | DFT_ALL| DFT_IDFT_SCL);

}


LBitmap::FTDisplay

#include "ltwrappr.h"

virtual L_INT LBitmap::FTDisplay (pFTArray, uFlags)

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
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 LBitmap::FFT or LBitmap::DFT 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 LBase::EnableStatusCallback.

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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Fourier Transform Functions
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

void CDemoView::OnUpdatePreview(CCmdUI* pCmdUI)
{
pCmdUI->Enable(!m_LAniWnd.IsPlaying());
}
void TestFunction(LBitmap *pLeadBitmap, LBitmap *pDisplayBitmap)
{
/* This example applies the Discrete Fourier Transform function to it, and displays the data*/
RECT rcRange;
pFTARRAY pFTArray;
pDisplayBitmap->Copy(*pLeadBitmap);
/*Allocates buffer*/
pLeadBitmap->AllocFTArray (&pFTArray, sizeof(FTARRAY));

rcRange.left = 0;
rcRange.right = pLeadBitmap->GetWidth () / 4;
rcRange.top = 0;
rcRange.bottom = pLeadBitmap->GetHeight () / 2;
/* apply DFT*/
pLeadBitmap->DFT (pFTArray, &rcRange, DFT_DFT | DFT_GRAY |
DFT_RANGE| DFT_INSIDE_X| DFT_OUTSIDE_Y);
/*plot frequency magnitude*/
pDisplayBitmap->FTDisplay(pFTArray, DSP_FT_MAG | DSP_FT_LOG);
/*
:
:
Frees buffer*/
LBitmap::FreeFTArray (pFTArray);
}


LBitmap::FunctionalLight

#include "ltwrappr.h"

L_INT EXT_FUNCTION LBitmap::FunctionalLight(pLightParams)

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
pLightParams | Pointer to the LPLIGHTPARAMS 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 LBase::EnableStatusCallback.

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:

LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::DiceEffect, LBitmap::RingEffect

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example generates a linear lighting effect with a center at (uXOrigin,uYOrigin). */
LIGHTPARAMS LightParams;

/* 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)(pLeadBitmap->GetWidth ()/2);
LightParams. uYOrigin = (L_UINT)(pLeadBitmap->GetHeight()/2);

/* Apply the linear lighting effect */
pLeadBitmap->FunctionalLight (&LightParams);
}


LBitmap::GammaCorrect

#include "ltwrappr.h"

virtual L_INT LBitmap::GammaCorrect(uGamma)

L_UINT uGamma;

/* unsigned integer that represents the gamma value */

Adjusts the intensity of colors in the class object's bitmap by changing the gamma constant that is used to map the intensity values.

Parameter | Description
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 LBase::EnableStatusCallback.

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.

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
LTFIL
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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("V:\\images\\babe.cmp"), 0,ORDER_BGR);
LeadBitmap.GammaCorrect(235);


LBitmap::GammaCorrectExt

#include "ltwrappr.h"

L_INT LBitmap::GammaCorrectExt(uGamma, uFlag)

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
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 LBitmap::GammaCorrect function, but has been extended to allow the specification of the color space 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 LBase::EnableStatusCallback.

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:

LBitmap::GammaCorrect, LBitmap::ChangeIntensity, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LDialogColor::DoModalGammaAdjustment, LBitmap::WindowLevel, LBitmap::ChannelMix, LBitmap::Deinterlace, LBitmap::Desaturate, LBitmap::EdgeDetectStatistical, LBitmap::LightControl, LBitmap::SmoothEdges, LBitmap::LocalHistoEqualize, LBitmap::AddWeighted, LBitmap::ColorMerge, LBitmap::ColorSeparate, LBuffer::ConvertColorSpace, LBitmap::Multiply, LBitmap::AutoColorLevel, LBitmap::ColorLevel, LBitmap::Correlation, LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmapRgn::HolesRemovalRgn, LBitmap::SelectiveColor, LBitmap::Skeleton, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::MathFunction, LBitmap::Segment, LBitmap::AdaptiveContrast, LBitmap::ApplyMathLogic, LBitmap::ColorIntensityBalance, LBitmap::ColorizeGray, LBitmap::ContBrightInt, LBitmap::DigitalSubtract, LBitmap::DynamicBinary, LBitmap::EdgeDetectEffect, LBitmap::FunctionalLight, LBitmap::MultiScaleEnhancementBitmap, LBitmap::SelectData, LBitmap::ShiftData

Topics:

Raster Image Functions: Modifying Intensity Values

Changing Brightness and Contrast

Raster Image Functions: Doing Color Space Conversions

Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.GammaCorrectExt (250, YUV_SPACE);


LBitmap::GaussianFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::GaussianFilter (nRadius)

L_INT nRadius;

/* radius of the neighborhood */

Smooths or blurs the class object's bitmap by applying a Gaussian filter to it.

Parameter | Description
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 class object's 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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::HighPassFilter, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::Solarize, LDialogImageEffect::DoModalGaussianBlur, LBitmap::WindowLevel, LBitmap::UnsharpMask, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

L_INT ApplyGaussianFilter(LBitmap & Bitmap, L_TCHAR * szFileName, L_INT nRadius)
{
Bitmap.Load(szFileName);
return Bitmap.GaussianFilter(nRadius);
}


LBitmap::GetAutoTrimRect

#include "ltwrappr.h"

virtual L_INT LBitmap::GetAutoTrimRect(uThreshold, pRect)

L_UINT uThreshold; | /* delta value for detecting blank space */
LPRECT pRect; | /* address of the variable to be updated */

Gets the rectangle that would be used to trim the class object's bitmap if LBitmap::AutoTrim were used.

Parameter | Description
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 LBitmapBase::Trim instead of LBitmap::AutoTrim 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 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

LTDIS
LTFIL
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: | LBitmap::AutoTrim, LBitmapBase::Trim, LBitmapBase::CopyRect, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

LBitmap LeadBitmap;
RECT rcTrimRect;
L_TCHAR szDummyBuffer[256];

LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.GetAutoTrimRect(100, &rcTrimRect);
wsprintf(szDummyBuffer, TEXT("Left: %d\t Top: %d\nRight: %d\tBottom: %d"), rcTrimRect.left,
rcTrimRect.top, rcTrimRect.right, rcTrimRect.bottom);
MessageBox(0, szDummyBuffer, TEXT("GetAutoTrimRect"), MB_OK);


LBitmap::GetCurvePoints

#include "ltwrappr.h"

static L_INT LBitmap::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 LBitmap::FreeHandShear, or LBitmap::FreeHandWave 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.

See Also

Functions: | LBitmap::GetFunctionalLookupTable, LBitmap::GetUserLookUpTable, LBitmap::FreeHandShear, LBitmap::FreeHandWave
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values

Example

For an example, refer to LBitmap::FreeHandShear or LBitmap::FreeHandWave.


LBitmap::GetFeretsDiameter

#include "ltwrappr.h"

static L_INT LBitmap::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.

See Also

Functions: | LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Analysis: Object or Region Analysis

Example

void TestFunction(LBitmap *pLeadBitmap)
{
RECT rcRect;
POINT L_FAR * pPoints;
L_UINT uSize, uFeretsDiam, uFstIndex, uSndIndex;
RGNXFORM MyXForm;
rcRect.top = pLeadBitmap->GetHeight ()/4;
rcRect.bottom = pLeadBitmap->GetHeight ()*3/4;
rcRect.left = pLeadBitmap->GetWidth ()/4;
rcRect.right = pLeadBitmap->GetWidth ()*3/4;
pLeadBitmap->Region()->SetRgnEllipse (&rcRect);
pLeadBitmap->Region()->GetRgnXForm (&MyXForm);
pLeadBitmap->GetRgnContourPoints(&MyXForm,&pPoints, &uSize);
LBitmap::GetFeretsDiameter (pPoints, uSize, &uFeretsDiam, &uFstIndex, &uSndIndex);
}


LBitmap::GetFunctionalLookupTable

#include "ltwrappr.h"

virtual L_INT LBitmap::GetFunctionalLookupTable (pLookupTable, uLookupLen, uStart, uEnd, nFactor, uFlag)

L_UINT * 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 | [0] Apply the exponential function.
 | FLT_LN | [1] Apply the natural logarithm function.
 | FLT_LINEAR | [2] Apply the linear function.
 | FLT_SIGMOID | [3] 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 LBitmap::RemapIntensity 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)

nFirstValue = exp(0).

nLastValue = exp(nFactor)

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 | + | uStart + (uEnd – uStart) * (ln (1 + (nFactor/10.0 * (x-uStart))/(uEnd- uStart)) - nFirstValue)
 |  |  |  | / (nLastValue – nFirstValu e)

where:

nFirstValue = 0.

nLastValue = ln(1 + nFactor)

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 LBitmap::GetFunctionalLookupTable with uStart set to 0, uEnd set to x, and uFlag set to FLT_LINEAR.

Call LBitmap::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.)

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

LTFIL
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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::GetUserLookupTable, LBitmap::RemapIntensity, LBitmap::ApplyVOILUT
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
L_UINT LookupTable[256];

Bitmap.Load(pszFile, 24, ORDER_BGR);

Bitmap.GetFunctionalLookupTable(LookupTable, 256, 0, 255, 5, FLT_EXP);
Bitmap.RemapIntensity(LookupTable, 256, CHANNEL_MASTER);
}


LBitmap::GetHistogram

#include "ltwrappr.h"

virtual L_INT LBitmap::GetHistogram(pHisto, uHistoLen, uFlags)

L_UINT32 * pHisto; | /* an array to hold the histogram */
L_UINT uHistoLen; | /* length of the histogram */
L_UINT uFlags; | /* flags */

Fills an array that charts how many times each intensity level occurs in the class object's 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
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] Use all channels.
 | CHANNEL_RED | [0x0001] Use Red channel only.
 | CHANNEL_GREEN | [0x0002] Use Green channel only.
 | CHANNEL_BLUE | [0x0003] Use 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 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 ( 216 – 1) for 16-bit grayscale or from 0 to ( 212 – 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 LBitmap::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 entries for 12-bit bitmaps and 65536 entries 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 216 = 65,536 L_UINT32 values.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

This function supports signed data images.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoEqualize, LBitmap::GammaCorrect, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast

Example

// This sample will draw a line to represent the histogram for an image
L_VOID DrawHistogram(HWND hwnd)
{
L_UINT32 Histogram[256];
LBitmap LeadBitmap;
RECT rc;
HDC hdc;

hdc = GetDC(hwnd);
LeadBitmap.Load(TEXT("V:\\images\\babe.cmp"), 0,ORDER_BGR);
LeadBitmap.GetHistogram(Histogram, 256, CHANNEL_MASTER| HIST_ALL_BITS);
GetClientRect(hwnd, &rc);
for(int i=0; i<256; i++)
{
//Draw a vertical line that will represent the Intensity levels
MoveToEx(hdc, i*2, rc.bottom, NULL);
LineTo(hdc, i*2, rc.bottom-Histogram[i]);
}
ReleaseDC(hwnd, hdc);
}


LBitmap::GetHistogramGray

This function has been removed. To achieve the same functionality, use the LBitmap::GetHistogram function.


LBitmap::GetLinearVOILUT

#include "ltwrappr.h"

virtual L_INT LBitmap::GetLinearVOILUT(pCenter, pWidth, uFlags)

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 the object is not linear, the function will fail.

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

See Also

Functions: | LBitmap::WindowLevel, LBitmap::WindowLevelFillLUT, LBitmap::GetUserLookupTable, LBitmap::RemapIntensity, LBitmap::ApplyLinearVOILUT, Class Members
Topics: | Raster Image Functions: Palettes

Example

/* checks the linearity of the LUT and computes its window width and center by using the GetLinearVOILUT function.*/
L_INT TestFunction(LBitmap * pBitmap, L_DOUBLE * pCenter, L_DOUBLE *pWidth)
{
return pBitmap->GetLinearVOILUT(pCenter, pWidth, 0);
}


LBitmap::GetMarksCenterMass

#include "ltwrappr.h"

virtual L_INT LBitmap::GetMarksCenterMass (pMarkPoints, pMarkCMPoints, uMarksCount)

POINT L_FAR * pMarkPoints; | /* pointer to an array of registration mark locations */
POINT L_FAR * pMarkCMPoints; | /* pointer to an array to be filled */
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
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:

1. | Use LBitmap::SearchRegMarks to find the registration marks.
2. | Pass data from pMarkDetectedPoints to this function to determine the points representing the center of mass for each registration mark.
3. | Pass these points to LBitmap::GetTransformationParameters to detect the image rotation, scaling and translation.

This function does not use LBase::EnableStatusCallback.

If you simply want to automatically straighten a bitmap, use the LBitmap::Deskew 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.

See Also

Functions: | LBitmapBase::Combine, LBitmapBase::Rotate, LBitmapBase::Size, LBitmapBase::Resize, LBitmap::Deskew, LBitmap::IsRegMarkBitmap, LBitmap::SearchRegMarks, LBitmap::GetTransformationParameters
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to LBitmap::GetTransformationParameters.


LBitmap::GetMinMaxBits

#include "ltwrappr.h"

virtual L_INT LBitmap::GetMinMaxBits(pnLowBit, pnHighBit)

L_INT L_FAR * pnLowBit; | /* address of a variable to be updated */
L_INT L_FAR * pnHighBit; | /* address of a 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 Document/Medical toolkits only.

Parameter | Description
pnLowBit | Address of a variable to be updated with the lowest bit set in the bitmap.
pnHighBit | Address of a variable to 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 LBitmap::WindowLevel or LBitmap::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

LTDIS
LTFIL
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: | LBitmap::GetMinMaxVal, LBitmap::WindowLevel, LBitmap::WindowLevelBitmap, Class Members
Topics: | Raster Image Functions: Palettes
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Processing an Image

Example

LBitmap LeadBitmap;
L_INT nLowBit, nHighBit;
L_TCHAR szDummyBuffer[50];

LeadBitmap.Load(TEXT("test16.tif"), 0,ORDER_BGR);
if(
((LeadBitmap.IsGrayScale()!=GRAY_NO)&&
((LeadBitmap.GetBitsPerPixel ()==12)||
(LeadBitmap.GetBitsPerPixel()==16)))
)
{
LeadBitmap.GetMinMaxBits(&nLowBit, &nHighBit);
wsprintf(szDummyBuffer, TEXT("LowBit= %d\tHighBit= %d"), nLowBit, nHighBit);
MessageBox(NULL, szDummyBuffer, TEXT("GetMinMaxBits"), MB_OK);
}
else
MessageBox(NULL, TEXT("Not a (12 or 16) gray scale image."), TEXT("GetMinMaxBits"), MB_OK);


LBitmap::GetMinMaxVal

#include "ltwrappr.h"

virtual L_INT LBitmap::GetMinMaxVal(puMinVal, puMaxVal)

L_UINT L_FAR * puMinVal; | /* address of the variable to be updated */
L_UINT L_FAR * puMaxVal; | /* address of the variable to be updated */

Returns the minimum and maximum intensity values present in a 12 or 16-bit grayscale or a 48 or 64-bit color image. This function is available in Document/Medical toolkits only.

Parameter | Description
puMinVal | Address of a variable to be updated with the minimum intensity value present in the bitmap.
puMaxVal | Address of a variable to 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 LBitmap::WindowLevel or LBitmap::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

LTDIS
LTFIL
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: | LBitmap::GetMinMaxBits, LBitmap::WindowLevel, LBitmap::WindowLevelBitmap, Class Members
Topics: | Raster Image Functions: Palettes
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Processing an Image

Example

LBitmap LeadBitmap;
L_INT nLowBit, nHighBit;
L_TCHAR szDummyBuffer[50];

LeadBitmap.Load(TEXT("image1.cmp "), 0,ORDER_BGR);
if(
((LeadBitmap.IsGrayScale()!=GRAY_NO)&&
((LeadBitmap.LBitmapBase::GetBitsPerPixel()==12)||
(LeadBitmap.LBitmapBase::GetBitsPerPixel()==16)))
)
{
LeadBitmap.GetMinMaxVal(&nLowBit, &nHighBit);
wsprintf(szDummyBuffer, TEXT("LowBit= %d\tHighBit= %d"), nLowBit, nHighBit);
MessageBox(NULL, szDummyBuffer, TEXT("GetMinMaxBits"), MB_OK);
}
else
MessageBox(NULL, TEXT("Not a (12 or 16) gray scale image."), TEXT("GetMinMaxBits"), MB_OK);


LBitmap::GetObjectInfo

#include "ltwrappr.h"

virtual L_INT LBitmap::GetObjectInfo (puX, puY, pnAngle, puRoundness, bWeighted)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Analysis: Object or Region Analysis

Example

void TestFunction(LBitmap *pLeadBitmap)
{
L_UINT uX, uY, uRound;
/* Get the objects center of mass and it's roundness. I am not interested in the axis' orientation, so I pass NULL… */
pLeadBitmap->GetObjectInfo (&uX, &uY, NULL, &uRound, FALSE);
}


LBitmap::GetOverlay

#include "ltwrappr.h"

virtual L_INT LBitmap::GetOverlay(nIndex, pOverlayBitmap, uStructSize, uFlags)

virtual L_INT LBitmap::GetOverlay(nIndex, pLOverlayBitmap, uStructSize, uFlags)

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 */
LBitmapBase* pLOverlayBitmap; | /* pointer to the overlay bitmap Object */

Gets the overlay bitmap for a certain index.

Parameter | Description
nIndex | The index of the overlay being retrieved. This index is zero-based.
pOverlayBitmap | Pointer to the overlay bitmap handle which will be filled with the new overlay bitmap. Cannot be NULL.
uStructSize | Size of the BITMAPHANDLE structure pointed to by pOverlayBitmap. Pass sizeof(BITMAPHANDLE).
uFlags | Flags that determine retrieving options. Values cannot be combined. Possible values are:
 | Value | Meaning
 | OVERLAY_COPY | [0x0000] Retrieve a copy of the overlay bitmap from the overlay list.
 | OVERLAY_NOCOPY | [0x0001] Retrieve the actual overlay bitmap. 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] Retrieve the actual overlay bitmap, and also remove the bitmap from the overlay list. This is recommended over OVERLAY_NOCOPY.
pLOverlayBitmap | Pointer to the overlay bitmap object which will be filled with the new overlay bitmap. Cannot be NULL.

Returns

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

Comments

This function will get the overlay bitmap. You can get a copy of the overlay bitmap (OVERLAY_COPY) or you can 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. See the comments from LBitmap::SetOverlay for more information about how to use OVERLAY_NOCOPY.

If you use OVERLAY_MOVE, the overlay bitmap from the corresponding index will be invalidated.

pOverlayBitmap is assumed to be unallocated an 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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations, Overlay Overview

Example

/* This example will get the overlay bitmaps and save them to separate files. */
L_VOID SaveOverlays(HWND hWnd, LBitmap *plBitmap)
{
L_INT nRet;
LBitmap 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 = plBitmap->GetOverlay(i, &OverlayBitmap, sizeof(BITMAPHANDLE), OVERLAY_NOCOPY);
if(nRet == SUCCESS)
{
wsprintf(s, TEXT("e:\\i\\overlay%d_copy.cmp"), i);
nRet = OverlayBitmap.Save(s , FILE_LEAD1BIT, 1, 1, NULL);
if(nRet != SUCCESS)
MessageBox(hWnd, TEXT("Error saving file!"), s, MB_OK);
}
}
}


LBitmap::GetOverlayAttributes

#include "ltwrappr.h"

virtual L_INT LBitmap::GetOverlayAttributes(nIndex, pOverlayAttributes, uStructSize, uFlags)

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 - pass sizeof(OVERLAYATTRIBUTES) */
L_UINT uFlags; | /* flags that determine which attributes should be retrieved */

Gets one or more overlay attributes for a certain index.

Parameter | Description
nIndex | The index of the overlay whose attributes we want to retrieve. This index is zero-based.
pOverlayAttributes | Structure which will be filled with the overlay attributes.
uFlags | Flags that determine which attributes to retrieve. You can combine values by using a bitwise OR ( | ). Possible values are:
 | Value | Meaning
 | OVERLAYATTRIBUTES_ORIGIN | [0x0001] Retrieve the top-left position. pOverlayAttributes ->ptOrigin will be updated with the top-left offset.
 | OVERLAYATTRIBUTES_COLOR | [0x0002] Retrieve the color. pOverlayAttributes ->crColor will be updated with the color.
 | OVERLAYATTRIBUTES_FLAGS | [0x0004] Retrieve the flags. pOverlayAttributes ->uFlags will be updated with the flags.
 | OVERLAYATTRIBUTES_BITINDEX | [0x0008] Retrieve the corresponding bitplane position. pOverlayAttributes-> uBitPosition will be updated with the bitplane index.
 | OVERLAYATTRIBUTES_DICOM | [0x0010] Retrieve the DICOM-related attributes, 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

One or more overlay attributes will be retrieved. Their values will be stored in the structure pointed by pOverlayAttributes. pOverlayAttributes ->uStructSize will be set to the value of the parameter uStructSize. Only uStructSize and the values retrieved by the function will be set. 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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Overlay Overview

Example

For an example, refer to LBitmap::SetOverlayAttributes


LBitmap::GetOverlayCount

#include "ltwrappr.h"

virtual L_INT LBitmap::GetOverlayCount(uFlags)

L_UINT uFlags;

/* reserved for future use */

Gets the number of overlays that have been defined for the specified main bitmap.

Parameter | Description
uFlags | Reserved for future use. Pass 0.

Returns

The overlay count

Comments

This function will count how many overlays have been defined. The overlays are defined by calling LBitmap::SetOverlay or LBitmap::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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations, Overlay Overview

Example

/* This example will count the overlays from plBitmap which has been defined and initialized elsewhere. */

L_UINT uCount;
uCount = pBitmap->GetOverlayCount(0);
/* now uCount contains the number of overlays */


LBitmap::GetRgnContourPoints

#include "ltwrappr.h"

virtual L_INT LBitmap::GetRgnContourPoints (pXForm, ppPoints, puSize)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Analysis: Object or Region Analysis

Example

void TestFunction(LBitmap *pLeadBitmap)
{
RECT rcRect;
POINT L_FAR * pPoints;
L_UINT uSize;
rcRect.top = pLeadBitmap->GetHeight ()/3;
rcRect.bottom = pLeadBitmap->GetHeight ()*2/3;
rcRect.left = pLeadBitmap->GetWidth ()/3;
rcRect.right = pLeadBitmap->GetWidth ()*2/3;
pLeadBitmap->Region()->SetRgnEllipse (&rcRect);
pLeadBitmap->GetRgnContourPoints (NULL, &pPoints, &uSize);
}


LBitmap::GetRgnPerimeterLength

#include "ltwrappr.h"

virtual L_INT LBitmap::GetRgnPerimeterLength (pXForm, puLength)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Working with the Existing Bitmap Region
 | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Analysis: Object or Region Analysis

Example

void TestFunction(LBitmap *pLeadBitmap)
{
RECT rcRect;
L_UINT uPerimeter;
rcRect.top = pLeadBitmap->GetHeight ()/3;
rcRect.bottom = pLeadBitmap->GetHeight ()*2/3;
rcRect.left = pLeadBitmap->GetWidth ()/3;
rcRect.right = pLeadBitmap->GetWidth ()*2/3;
pLeadBitmap->Region()->SetRgnEllipse (&rcRect);
pLeadBitmap->GetRgnPerimeterLength(NULL, &uPerimeter);
}


LBitmap::GetStatisticsInfo

#include "ltwrappr.h"

virtual L_INT LBitmap::GetStatisticsInfo (pStatisticsInfo, uChannel, uStart, uEnd)

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.

See Also

Functions: | LBitmap::ConvertToColoredGray, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Analysis: Image Analysis
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

void TestFunction(LBitmap *pLeadBitmap)
{
STATISTICSINFO StatisticsInfo;

/*Get statistical image information */
pLeadBitmap->GetStatisticsInfo (&StatisticsInfo,CHANNEL_MASTER, 0, 255);
}


LBitmap::GetTransformationParameters

#include "ltwrappr.h"

virtual L_INT LBitmap::GetTransformationParameters (pRefPoints, pTrnsPoints, pnXTranslation, pnYTranslation,pnAngle, puXScale, puYScale)

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
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 LBitmap::GetMarksCenterMass 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 LBitmap::SearchRegMarks to find the new positions for the reference marks

Using LBitmap::GetMarksCenterMass 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 LBitmap::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:

1. | Shift the image by (-*pXTranslation / 100, -*pYTranslation / 100) using LBitmapBase::Combine or LBitmapBase::CombineExt
2. | Rotate without resizing by – (*pnAngle)
3. | Resize using scaling factors of (100 / *puXScale, 100 / *puYScale) using LBitmapBase::Size or LBitmapBase::Resize

This function does not use LBase::EnableStatusCallback.

If you simply want to automatically straighten a bitmap, use the LBitmap::Deskew 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: | LBitmapBase::Combine, LBitmapBase::Rotate, LBitmapBase::Size, LBitmapBase::Resize, LBitmap::IsRegMarkBitmap, LBitmap::SearchRegMarks, LBitmap::GetMarksCenterMass
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

/* Get aRefPoints from pre-calculated saved values. You have to implement LoadRefParameters */
// LoadRefParameters(aRefPoints);
// Then send the aRefPoints to this function.
void TestFunction(LBitmap * pLeadBitmap, LPPOINT paRefPoints)
{
/* 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.
*/
L_INT nAngle;
L_UINT uXScale, uYScale;
L_INT uXTranslation, uYTranslation;
SEARCHMARKS aSearchMarks[3];
POINT aMarkPoints[3];
POINT aMarkCMPoints[3];

/*Get registration marks CM*/
aSearchMarks[0].uStructSize = sizeof(SEARCHMARKS);

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));

pLeadBitmap->SearchRegMarks (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);

pLeadBitmap->GetMarksCenterMass (aMarkPoints, aMarkCMPoints, 3);

pLeadBitmap->GetTransformationParameters (paRefPoints, aMarkCMPoints, &uXTranslation, &uYTranslation, &nAngle, &uXScale, &uYScale);

pLeadBitmap->ApplyTransformationParameters(uXTranslation, uYTranslation,nAngle, uXScale, uYScale, RGS_SIZE_BICUBIC | RGS_SIZE_FAVORWHITE);

}


LBitmap::GetUserLookupTable

#include "ltwrappr.h"

virtual L_INT LBitmap::GetUserLookupTable (pLookupTable, uLookupLen, apUserPoint, uUserPointCount, puPointCount)

L_UINT * pLookupTable; | /* lookup table */
L_UINT uLookupLen; | /* lookup table length */
POINT *apUserPoint; | /* array of points */
L_UINT uUserPointCount; | /* number of points in the array */
L_UINT *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.
uUserPointCount | 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 LBitmap::RemapIntensity 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.

See Also

Functions: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::GetFunctionalLookupTable, LBitmap::RemapIntensity
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
L_UINT LookupTable[256];
POINT apUserPoint[3] = { {0, 0}, {128, 150}, {255, 255} };

Bitmap.Load(pszFile, 24, ORDER_BGR);

Bitmap.GetUserLookupTable(LookupTable, 256, apUserPoint, 3, NULL);
Bitmap.RemapIntensity(LookupTable, 256, CHANNEL_MASTER);
}


LBitmap::GlassEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::GlassEffect(uCellWidth, uCellHeight, uFlags)

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
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 LBase::EnableStatusCallback.

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:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::RemoveRedeye, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

/* The following example applies a glass effect to it: */
void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->GlassEffect(20,10, GLASS_WFRQ | GLASS_HPER );
}


LBitmap::GlowFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::GlowFilter (uDim, uBright, uThreshold)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::DiffuseGlow, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Filtering Images
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Correcting Colors
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->GlowFilter(5, 3, 0);
}


LBitmap::GrayScaleExt

#include "ltwrappr.h"

virtual L_INT LBitmap::GrayScaleExt(RedFact, GreenFact, BlueFact)

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

The summation (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

LTDIS
LTFIL
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: | LBitmapBase::GrayScale, LBitmapBase::IsGrayScale, LBitmap::ConvertToColoredGray, LBitmap::BalanceColors, LBitmap::SwapColors, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

L_INT ConvertToGray(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.GrayScaleExt(100, 300, 600);
}


LBitmap::GrayScaleToDuotone

#include "ltwrappr.h"

virtual L_INT LBitmap::GrayScaleToDuotone (pNewColor, crColor, uFlags)

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
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 LBitmapBase::IsGrayScale function is called by LBitmap::GrayScaleToDuotone to determine the kind of grayscale palette being used. If LBitmapBase::IsGrayScale returns GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to LBitmap::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 LBitmapBase::IsGrayScale returns a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the crColor parameter to LBitmap::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 LBitmap::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 LBitmap::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 LBitmap::GrayScaleToDuotone with the two colors you wish to use in the pNewColor parameter.
(b) | If the bitmap is grayscale (not binary) call LBitmap::GrayScaleToDuotone with the 256 colors you wish to use in the pNewColor parameter.
(c) | If the bitmap is not grayscale (it is color) call LBitmap::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.

See Also

Functions: | LBitmapBase::GrayScale, LBitmapBase::IsGrayScale, LBitmap::GrayScaleToMultitone
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

/* This example loads a bitmap and converts it to a Duotone. */
void MyTestFunction(LAnimationWindow * LAniWnd)
{
COLORREF crColor; /* New Color */

/* Change the bitmap to grayscale bitmap */
LAniWnd->GrayScale ( 8);

/* The new color is Red */
crColor = RGB(255, 0, 0);

/* Apply duotone conversion*/
LAniWnd->GrayScaleToDuotone(NULL, crColor, DT_REPLACE);
}


LBitmap::GrayScaleToMultitone

#include "ltwrappr.h"

virtual L_INT LBitmap::GrayScaleToMultitone (uToneType, uDistType, pColor, pGradient, uFlags)

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
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_USERDEFINE. If the toolkit is generating the gradient colors, the user sets the desired base color(s) in this parameter when LBitmap::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_USERDEFINE.
 | 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 LBitmap::GrayScaleToMultitone with uToneType set to DT_MONOTONE, uDistType set to DT_LINEAR and the color you wish to use set in pColor. The LBitmapBase::IsGrayScale function will be called by LBitmap::GrayScaleToDuotone to determine the kind of grayscale palette being used. If LBitmapBase::IsGrayScale returns GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the pColor parameter to LBitmap::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 LBitmapBase::IsGrayScale returns a value other than GRAY_ORDEREDINVERSE or GRAY_NOTORDERED, then the color passed in the pColor parameter to LBitmap::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 LBitmap::GrayScaleToMultitone with uDistType set to DT_LINEAR. The LBitmap::GrayScaleToMultitone function will take the color(s) passed to it in the pColor parameter and generate a 256 color gradient for each color.
 | 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.
 | 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.
 | 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 LBitmap::GrayScaleToMultitone with uDistType set to DT_LINEAR. The LBitmap::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 LBitmap::GrayScaleToMultitone with uToneType set to DT_MONOTONE, uDistType set to DT_USERDEFINE and the two colors you wish to use in the pGradient parameter.
(b) | If the bitmap is grayscale (not binary) call LBitmap::GrayScaleToMultitone with uDistType set to DT_USERDEFINE.
 | If the uToneType is set to DT_DUOTONE, set 512 colors (256 for each basic color) in the pGradient parameter.
 | If the uToneType is set to DT_TRITONE, set 768 colors (256 for each basic color) in the pGradient parameter.
 | 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 LBitmap::GrayScaleToMultitone with uDistType set to DT_USERDEFINE. (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.

See Also

Functions: | LBitmapBase::GrayScale, LBitmapBase::IsGrayScale, LBitmap::GrayScaleToDuotone
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

/* This example applies Duotone conversion to it. */
void TestFunction(LAnimationWindow *BitmapWindow)
{
COLORREF crColor[2]; /* New Color */

/* Change the bitmap to grayscale bitmap*/
BitmapWindow->GrayScale (8);

/* The new colors */
crColor[0] = RGB(255, 255, 0);
crColor[1] = RGB(255, 0, 0);

/* Apply Multitone conversion */
BitmapWindow->GrayScaleToMultitone(DT_DUOTONE,DT_LINEAR, crColor, NULL, DT_REPLACE);
}


LBitmap::HalfTone

#include "ltwrappr.h"

virtual L_INT LBitmap::HalfTone(uType, nAngle, uDim, hList)

virtual L_INT LBitmap::HalfTone(uType, nAngle, uDim, pLList)

L_UINT uType; | /* the type of halftoning */
L_INT32 nAngle; | /* angle of rotation */
L_UINT uDim; | /* size of the grain */
HBITMAPLIST hList; | /* handle to the list of bitmaps */
LBitmapList * pLList; | /* pointer to LBitmapList object that will be used in halftoning if the HT_USERDEF option is selected */

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
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 halftoning if the HT_USERDEF option is selected.
pLList | Pointer to LBitmapList object that will be used in halftoning 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LDialogColor::DoModalHalfTone, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
Bitmap.Load(pszFile);
Bitmap.HalfTone(HT_ELLIPS, 4500, 5, (LBitmapList*)NULL);

}


LBitmap::HalfTonePattern

#include "ltwrappr.h"

L_INT LBitmap::HalfTonePattern(uContrast, uRipple, uAngleContrast, uAngleRipple, nAngleOffset, crForeGround, crBackGround, uFlag)

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; | /* foreground 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
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 circular pattern.
 | HTPATTERN_ELLIPSE | [0x0004] Use an elliptical 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 LBitmap::ColorHalfTone to create an enlarged halftone screen for each image channel. The filter divides the image into rectangles and replaces each rectangle with circles, one for each channel. The size of each circle is proportional to the brightness of the rectangle that it is replacing.

Use the LBitmap::HalfTone 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 LBitmap::GrayScaleExt 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 LBitmap::HalfTonePattern 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 LBitmap::HalfTonePattern 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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmapSettings::DefaultDithering, LBitmap::GrayScaleExt, LBitmap::AutoColorLevel, LBitmap::ColorLevel, LBitmap::Correlation, LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmapRgn::HolesRemovalRgn, LBitmap::SelectiveColor, LBitmap::Skeleton, LBitmap::HalfTone, LBitmap::Pointillist, LBitmap::ColorHalfTone, LBitmap::ColorSeparate, LBitmap::ColorMerge, LBitmap::Desaturate, LBitmap::HalfTone, LBitmap::GetStatisticsInfo, LBitmap::GetHistogram, LBitmapBase::GetColorCount, LBitmapBase::GetColors, LBitmap::GetMinMaxBits, LBitmap::GetMinMaxVal, LBitmap::ConvertToColoredGray, LBitmap::ColorizeGray, LBitmap::ShiftData, LBitmap::SelectData, LBitmap::GetHistogramGray, LBitmapBase::IsGrayScale, LBitmap::WindowLevel, LBitmap::WindowLevelFillLUT
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Filtering Images
 | Applying Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.HalfTonePattern(100, 200, 12, 2, 4500, RGB(255,255,255), RGB(255,0,0), HTPATTERN_LINE);


LBitmap::HighPassFilter

#include "ltwrappr.h"

L_INT LBitmap::HighPassFilter(uRadius, uOpacity)

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
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 (LBitmap::GaussianFilter).

To increase the thickness of the edges, increase the value of uRadius. Usually a low value for uRadius is better.

Unlike the LBitmap::UnsharpMask function, when using this function image noise is not increased.

As an example, if you use the following image:

And you were to call LBitmap::HighPassFilter 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 LBase::EnableStatusCallback.

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: | LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::UnsharpMask, LBitmap::GaussianFilter
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.HighPassFilter(10, 100);


LBitmap::HistoContrast

#include "ltwrappr.h"

virtual L_INT LBitmap::HistoContrast(nChange)

L_INT nChange;

/* amount of contrast change */

Increases or decreases the contrast of the image in the class object's bitmap, using a histogram to determine the median brightness.

Parameter | Description
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 LBitmap::ChangeContrast 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::AdjustTint, LBitmap::GammaCorrectExt, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::Invert, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::GetHistogram, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoEqualize, LBitmap::GammaCorrect, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.HistoContrast(250);


LBitmap::HistoEqualize

#include "ltwrappr.h"

virtual L_INT LBitmap::HistoEqualize(nFlag)

L_INT nFlag;

/* flag */

Linearizes the number of pixels in the class object's bitmap, based on the specified color space. This can be used to bring out the detail in dark areas of an image.

Parameter | Description
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

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.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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 does 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
LTFIL
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: | LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::Invert, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::GetHistogram, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoContrast, LBitmap::GammaCorrect, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.HistoEqualize(0);


LBitmap::HolePunchRemove

#include "ltwrappr.h"

virtual L_INT LBitmap::HolePunchRemove(pHolePunch)

LPHOLEPUNCH pHolePunch;

/* pointer to a structure */

Finds and removes hole punches. This function is available in the Document/Medical Toolkits.

Parameter | Description
pHolePunch | Pointer to the HOLEPUNCH structure that LEADTOOLS uses to remove hole punches.

Returns

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

Comments

This function detects and removes hole punches that are common in scanned documents.

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.

The behavior of this function can be modified by overriding LBitmap::HolePunchRemoveCallback.

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: | LBitmap::HolePunchRemoveCallback, LBitmap::Smooth, LBitmap::LineRemove, LBitmap::BorderRemove, LBitmap::DotRemove, LBitmap::InvertedText
Topics: | Cleaning Up 1-Bit Images

Example

//This example updates a Windows region with removed hole punches
//For the example, a Windows region is updated and then converted to a LEAD region
//but in practice it would easier and faster to just 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
//The derived class LMyBitmap is used to override the HolePunchRemoveCallBack function
//The callback member function is used to display information about each hole punch removed
//The callback member function does NOT receive a Windows region

void CCleanv12Dlg::OnButtonHolepunch()
{
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 = m_Bitmap.HolePunchRemove(&hr);

if (nRet == SUCCESS)
{
//Delete the existing region
LBitmapRgn Region(&m_Bitmap);
if(Region.BitmapHasRgn())
{
Region.Free();
}

Region.SetRgnCombineMode(L_RGN_SET) ;
Region.SetRgnHandle(hr.hRgn);
DeleteObject(hr.hRgn);
Invalidate();
}
}

L_INT LMyBitmap::HolePunchRemoveCallBack(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iHoleIndex,
L_INT32 iHoleTotalCount,
L_INT32 iWhiteCount,
L_INT32 iBlackCount
)
{
CString strMsg;

strMsg.Format (
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(strMsg);

return SUCCESS_REMOVE;
}


LBitmap::HolePunchRemoveCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::HolePunchRemoveCallBack(hRgn, pBoundingRect, iHoleIndex, iHoleTotalCount, iWhiteCount, iBlackCount)

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 */

Called for each hole punch found by LBitmap::HolePunchRemove. 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 LBitmap::HolePunchRemove().
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.

Returns

SUCCESS_REMOVE | Remove the hole.
SUCCESS_NOREMOVE | Do not remove the hole.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This function 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 LBitmap::HolePunchRemove(). If HOLEPUNCH_IMAGE_UNCHANGED and HOLEPUNCH_SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::HolePunchRemove.


LBitmap::Impressionist

#include "ltwrappr.h"

virtual L_INT LBitmap::Impressionist(uHorzDim, uVertDim)

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
uHorzDim | Horizontal effect size, in pixels. Possible values range from 1 – 100.
uVertDim | Vertical effect size, in pixels. Possible values range from 1 – 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.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LDialogImageEffect::DoModalImpressionist, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images

Example

void MyTestFunction(LAnimationWindow * pAniWnd)
{
pAniWnd->Impressionist( 10, 10);
}


LBitmap::IntensityDetect

#include "ltwrappr.h"

virtual L_INT LBitmap::IntensityDetect(uLow, uHigh, crInColor, crOutColor, uChannel)

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
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 as that of the LBitmap::IntensityDetect (uLow, uHigh) function (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);

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::HighPassFilter, LBitmap::AutoBinary, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::Emboss, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.IntensityDetect(128, 255, RGB(0, 0, 0), RGB(255, 255, 255), IDB_CHANNEL_MASTER);


LBitmap::Invert

#include "ltwrappr.h"

virtual L_INT LBitmap::Invert(void);

Inverts the colors in the class object's bitmap, making it like a photographic negative.

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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::GetHistogram, LBitmap::ChangeContrast, LBitmap::ChangeIntensity, LBitmap::HistoEqualize, LBitmap::GammaCorrect, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Invert();


LBitmap::InvertedText

#include "ltwrappr.h"

virtual L_INT LBitmap::InvertedText(pInvertedText)

LPINVERTEDTEXT pInvertedText;

/* pointer to a structure */

Finds and inverts areas of inverted text in a 1-bit black and white image. This function is available in the Document/Medical Toolkits.

Parameter | Description
pInvertedText | Pointer to the INVERTEDTEXT structure that LEADTOOLS uses to find and correct inverted text.

Returns

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

Comments

This function finds and inverts areas of inverted text that are common in scanned text documents.

Below is an example of inverted text often found in scanned images:

Modifying the area of inverted text yields:

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.

The behavior of this function can be modified by overriding LBitmap::InvertedTextCallback.

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: | LBitmap::InvertedTextCallback, LBitmap::Smooth, LBitmap::LineRemove, LBitmap::BorderRemove, LBitmap::DotRemove, LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

//This example finds all inverted text regions greater than 5 inches in width and 1/2 inch in height
// and inverts it so that it appears normal
//The derived class LMyBitmap is used to override the InvertedTextCallBack function
//The callback member function is used to display additional information about the inverted text regions
//The callback member function does NOT receive a Windows region
//A LEAD region is updated by the function to show all of the changes.

void CCleanv12Dlg::OnButtonInvertedtext()
{
L_INT32 nRet;
BITMAPHANDLE BitmapRegion;
INVERTEDTEXT it;
it.uStructSize = sizeof(INVERTEDTEXT);
memset(&BitmapRegion, 0, sizeof(BITMAPHANDLE));

it.iSize = sizeof(INVERTEDTEXT);

//Units are in thousands of inches
it.iMinInvertWidth = 5000;
it.iMinInvertHeight = 500;
it.iMinBlackPercent = 70;
it.iMaxBlackPercent = 95;
it.pBitmapRegion = &BitmapRegion;
it.uBitmapStructSize = sizeof(BitmapRegion);
it.uFlags = INVERTEDTEXT_SINGLE_REGION | INVERTEDTEXT_LEAD_REGION | INVERTEDTEXT_USE_DPI;

nRet = m_Bitmap.InvertedText(&it);

if (nRet == SUCCESS)
{
//Delete the existing region
LBitmapRgn Region(&m_Bitmap);
if(Region.BitmapHasRgn())
{
Region.Free();
}

m_Bitmap.SetHandle(it.pBitmapRegion, FALSE);
Invalidate();
}
}

L_INT LMyBitmap::InvertedTextCallBack(
HRGN hRgn,
PRECT pBoundingRect,
L_INT32 iWhiteCount,
L_INT32 iBlackCount
)
{
CString strMsg;

//Note: no hRgn to delete because it was not requested
strMsg.Format(
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(strMsg);
return SUCCESS_REMOVE;
}


LBitmap::InvertedTextCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::InvertedTextCallBack(hRgn, pBoundingRect, iWhiteCount, iBlackCount)

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 */

Called for each inverted text segment found by LBitmap::InvertedText. 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.

Returns

SUCCESS_REMOVE | Invert the text.
SUCCESS_NOREMOVE | Do not invert the text.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This function 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 LBitmap::InvertedText(). If flags INVERTEDTEXT_IMAGE_UNCHANGED and INVERTEDTEXT _SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::InvertedText
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::InvertedText.


LBitmap::IsRegMarkBitmap

#include "ltwrappr.h"

virtual L_INT LBitmap::IsRegMarkBitmap (uType, uMinScale, uMaxScale, uWidth, uHeight)

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
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 LBitmap::SearchRegMarks instead.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

If you simply want to automatically straighten a bitmap, use the LBitmap::Deskew 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.

See Also

Functions: | LBitmapBase::Combine, LBitmapBase::Rotate, LBitmapBase::Size, LBitmapBase::Resize, LBitmap::GetTransformationParameters, LBitmap::SearchRegMarks, LBitmap::GetMarksCenterMass
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example determines if the object is a registration mark */
L_INT nRet;
/* check */
nRet = pLeadBitmap->IsRegMark(RGS_T, 90, 110, 31, 29);
if(nRet == SUCCESS)
{
//it is a registration mark
}
}


LBitmap::LensFlare

#include "ltwrappr.h"

virtual L_INT LBitmap::LensFlare(ptCenter, uBright, uFlag, crColor)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

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

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT CenterPt;
CenterPt.x = BitmapWindow->GetWidth()/2;
CenterPt.y = BitmapWindow->GetHeight()/2;

BitmapWindow->LensFlare(CenterPt, 100, LNS_TYPE_1, RGB(100, 150, 10));
}


LBitmap::Light

#include "ltwrappr.h"

virtual L_INT LBitmap::Light (pLightInfo, uLightNo, uBright, uAmbient, crAmbientClr)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Modifying Intensity Values

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
LIGHTINFO LightInfo;
LightInfo.uStructSize = sizeof(LIGHTINFO);
LightInfo.crFill = RGB(255, 255, 255);
LightInfo.nAngle = 0;
LightInfo.ptCenter.x = BitmapWindow->GetWidth()/2;
LightInfo.ptCenter.y = BitmapWindow->GetHeight()/2;
LightInfo.uEdge = 0;
LightInfo.uBright = 100;
LightInfo.uFlag = LGT_SPOTLIGHT;
LightInfo.uHeight = min(BitmapWindow->GetHeight(), BitmapWindow->GetWidth())/2;
LightInfo.uWidth = max(BitmapWindow->GetHeight(), BitmapWindow->GetWidth())/2;
LightInfo.uOpacity = 100;

BitmapWindow->Light(&LightInfo, 1, 100, 100, RGB(255,255,255));
}


LBitmap::LightControl

#include "ltwrappr.h"

virtual L_INT LBitmap::LightControl (puLowerAvr, puAverage, puUpperAvr,uFlag)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::Mosaic, LBitmap::Pixelate.
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 applies light control function. */
void TestFunction(LAnimationWindow *BitmapWindow)
{
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[2] = 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*/

BitmapWindow->LightControl(puLowerAvr, puAverage, puUpperAvr, YUV_SPACE);
}


LBitmap::LineProfile

#include "ltwrappr.h"

virtual L_INT LBitmap::LineProfile(FirstPoint, SecondPoint, ppRed, ppGreen, ppBlue)

POINT FirstPoin; | /* starting point of the line */
POINT SecondPoint; | /* end point of the line */
L_UINT ** ppRed; | /* pointer to a pointer */
L_UINT ** ppGreen; | /* pointer to a pointer */
L_UINT ** ppBlue; | /* 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
FirstPoin | 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.
ppRed | 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.
ppGreen | 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.
ppBlue | 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

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);
}

The range of 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 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

LTDIS
LTFIL
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: | LBitmapBase::Access, LBitmapBase::Release, LBitmapBase::Clear, LBitmapBase::GetRow, LBitmapBase::PutRow, LBitmapBase::GetRowCol, LBitmapBase::PutRowCol, LBitmapBase::PutPixelColor, LBitmapBase::GetPixelColor, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Removing Noise

Example

L_VOID LineProfileSample(LBitmap & Bitmap, L_TCHAR * szFileName)
{
L_UINT * pRed = NULL;
L_UINT * pGreen = NULL;
L_UINT * pBlue = NULL;
POINT StartPoint, EndPoint;

Bitmap.Load(szFileName);

StartPoint.x = 0;
StartPoint.y = 0;
EndPoint.x = Bitmap.GetWidth();
EndPoint.y = Bitmap.GetHeight ();

Bitmap.LineProfile(StartPoint, EndPoint, &pRed, &pGreen, &pBlue);

/* ... Do something with the colors in the arrays */

GlobalFreePtr(pRed);
GlobalFreePtr(pGreen);
GlobalFreePtr(pBlue);
}


LBitmap::LineRemove

#include "ltwrappr.h"

virtual L_INT LBitmap::LineRemove(pLineRemove)

LPLINEREMOVE pLineRemove;

/* pointer to a structure */

Removes horizontal and vertical lines in a 1-bit black and white image. This function is available in the Document/Medical Toolkits.

Parameter | Description
pLineRemove | Pointer to the LINEREMOVE structure that LEADTOOLS uses to perform the line removal operation

Returns

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

Comments

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.

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.

The behavior of this function can be further modified by overriding LBitmap::LineRemoveCallback.

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: | LBitmap::LineRemoveCallback, LBitmap::Smooth, LBitmap::BorderRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

//This example removes vertical lines that are at least 200 pixels in length
// and no more than 5 pixels in width
//The lines can have gaps up to two pixels in length.
//The derived class LMyBitmap is used to override the LineRemoveCallBack function.
//myBitmap is an object of class LMyBitmap.
//The callback member function is used to display information about each line removed.
//The callback member function does NOT receive a Windows region.

void CCleanv12Dlg::OnButtonLines()
{
LINEREMOVE lr;

lr.uStructSize = sizeof(LINEREMOVE);
lr.uBitmapStructSize = sizeof(BITMAPHANDLE);
lr.iGapLength = 2;
lr.iMaxLineWidth = 5;
lr.iMinLineLength = 200;
lr.iWall = 7;
lr.iMaxWallPercent = 10;
lr.uRemoveFlags = LINEREMOVE_HORIZONTAL;
lr.uFlags = LINE_USE_GAP;

m_Bitmap.LineRemove(&lr);
Invalidate();
}

L_INT LMyBitmap::LineRemoveCallBack(
HRGN hRgn,
L_INT32 iStartRow,
L_INT32 iStartCol,
L_INT32 iLength
)
{
CString strMsg;

strMsg.Format(
TEXT("RowCol[%d,%d] Length[%d]\n"),
iStartRow,
iStartCol,
iLength
);
OutputDebugString(strMsg);
return SUCCESS_REMOVE;
}


LBitmap::LineRemoveCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::LineRemoveCallBack(hRgn, iStartRow, iStartCol, iLength)

HRGN hRgn; | /* windows region */
L_INT32 iStartRow; | /* starting row */
L_INT32 iStartCol; | /* starting column */
L_INT32 iLength; | /* line length */

Called for each line found by LBitmap::LineRemove. 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.

Returns

SUCCESS_REMOVE | Remove the line.
SUCCESS_NOREMOVE | Do not remove the line.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This function is called for each line found by LBitmap::LineRemove. 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 LBitmap::LineRemove(). If flags LINE_IMAGE_UNCHANGED and LINE_SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::LineRemove
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::LineRemove.


LBitmap::LocalHistoEqualize

#include "ltwrappr.h"

virtual L_INT LBitmap::LocalHistoEqualize (nWidth, nHeight, nxExt, nyExt, uType, uSmooth)

L_INT nWidth; | /* width of the local histogram equalizer rectangle */
L_INT nHeight; | /* height of the local histogram equalizer rectangle */
L_INT nxExt; | /* width extension */
L_INT nyExt; | /* height extension */
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
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] Linearize the number of pixels across the RGB color space. (Separated channels)
 | YUV_SPACE | [0x0002] Linearize the number of pixels across the YUV color space.(Best results)
 | GRAY_SPACE | [0x0004] Linearize the number of pixels per gray level in a gray level representation of the image.
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 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.

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: | LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LDialogColor::DoModalLocalHistoEqualize
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast

Example

void MyTestFunction(LAnimationWindow * pAniWnd)
{
pAniWnd->LocalHistoEqualize(15,15,100,100, YUV_SPACE,2 );
}


LBitmap::MaskConvolution

#include "ltwrappr.h"

L_INT LBitmap::MaskConvolution(nAngle, uDepth, uHeight, uFlag)

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
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 LBase::EnableStatusCallback.

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:

LBitmap::PlasmaFilter, LBitmap::Emboss, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LDialogImageEffect::DoModalEmboss, LBitmap::WindowLevel, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::AddShadow, LBitmap::RevEffect, LBitmap::Aging, LBitmap::DiceEffect, LBitmap::FunctionalLight, LBitmap::PuzzleEffect, LBitmap::RingEffect, LBitmap::TextureAlphaBlend

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Detecting and Enhancing Edges and Lines

Raster Image Functions: Artistic Effects

Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.MaskConvolution(500, 45, 3, MSKC_EMBOSS);


LBitmap::MathFunction

#include "ltwrappr.h"

virtual L_INT LBitmap::MathFunction (uMType, uFactor)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::Add, LBitmapBase::Combine, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies a Log Function over the loaded image. */
/* Apply Log Function to this bitmap */
pLeadBitmap->MathFunction(MF_LOG, 100);
}


LBitmap::MaxFilter

LBitmap::MaxFilter (Document/Medical only)

#include "ltwrappr.h"

virtual L_INT LBitmap::MaxFilter(uDim=3)

L_UINT uDim;

/* dimensions of the neighborhood used for filtering (uDim x uDim), in pixels */

Erodes dark objects in the class object's bitmap by the specified amount. This function is available in Document/Medical toolkits only.

Parameter | Description
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 is a more controlled version of the omni-directional erosion filter that you can set with the LBitmap::BinaryFilter function.

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 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 does 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
LTFIL
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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LDialogImageEffect::DoModalMaxFilter, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

L_INT MaxFilterSample(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.MaxFilter();
}


LBitmap::MedianFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::MedianFilter(uDim=3)

L_UINT uDim

/* dimensions of the neighborhood used for filtering (uDim x uDim), in pixels */

Changes the color of each pixel in the class objects bitmap to the median color of pixels in its neighborhood. This is similar to the LBitmap::AverageFilter function, but it is used for noise reduction, rather than a blur effect.

Parameter | Description
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 LBase::EnableStatusCallback.

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 class object’s bitmap has a region, this function works only on the region. If the bitmap does not have a region, the 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

LTDIS
LTFIL
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: | LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.MedianFilter();


LBitmap::MinFilter

LBitmap::MinFilter (Document/Medical only)

#include "ltwrappr.h"

virtual L_INT LBitmap::MinFilter(uDim=3)

L_UINT uDim;

/* dimensions of the neighborhood used for filtering (uDim x uDim), in pixels */

Dilates dark objects in the class object’s bitmap by the specified amount. This function is available in Document/Medical toolkits only.

Parameter | Description
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 is a more controlled version of the omni-directional dilation filter that you can set with the LBitmap::BinaryFilter function.

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 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 does 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
LTFIL
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: | LBitmap::Fragment, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::Emboss, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LDialogImageEffect::DoModalMinFilter, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise

Example

L_INT MinFilterSample(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.MinFilter();
}


LBitmap::Mosaic

#include "ltwrappr.h"

virtual L_INT LBitmap::Mosaic(uDim=3)

L_UINT uDim;

/* dimensions of the tiles (uDim x uDim), in pixels */

Imposes a mosaic effect on the class object’s 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
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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Emboss, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Mosaic();


LBitmap::MosaicTiles

#include "ltwrappr.h"

L_INT LBitmap::MosaicTiles(pMosaicTilesInfo)

LPMOSAICTILESINFO pMosaicTilesInfo;

/* pointer to structure containing 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
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 LBitmap::MosaicTiles 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 LBitmap::Mosaic 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 LBitmap::Pixelate 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 LBitmap::RomanMosaic 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 LBitmap::Pointillist 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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Pixelate, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::DiceEffect, LBitmap::PuzzleEffect, LBitmap::RingEffect, LBitmap::Canvas, LBitmap::BricksTexture
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Artistic Effects

Example

MOSAICTILESINFO MosaicInfo; /* Structure which store the required parameters*/
LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
/*Fill the structures with the required parameters, the effect is applied using rectangular tiles, with black border color*/
memset(&MosaicInfo,0,sizeof(MOSAICTILESINFO));
MosaicInfo.uStructSize = sizeof(MOSAICTILESINFO);
MosaicInfo.crBorderColor = RGB(0, 0, 0);
MosaicInfo.crTilesColor = RGB(255, 255, 255);
MosaicInfo.uFlags = MSCT_CART | MSCT_SHADOWGRAY;
MosaicInfo.uTileHeight = m_LBitmapWnd.GetHeight()/5;
MosaicInfo.uTileWidth = m_LBitmapWnd.GetWidth()/5;
MosaicInfo.uOpacity = 50;
MosaicInfo.uShadowThreshold= 0;
MosaicInfo.uPenWidth = 7;

L_INT nRet = LeadBitmap.MosaicTiles(&MosaicInfo);


LBitmap::MotionBlur

#include "ltwrappr.h"

virtual L_INT LBitmap::MotionBlur (uDim, nAngle, bUnidirectional)

L_UINT uDim; | /* size of the blur effect */
L_INT nAngle; | /* direction of the motion */
L_BOOL bUnidirectional; | /* flag */

Applies a filter, to the class object's bitmap, which creates the illusion of movement in an image.

Parameter | Description
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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LDialogImageEffect::DoModalMotionBlur, LBitmap::WindowLevel
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
Bitmap.Load(szFile);
Bitmap.MotionBlur(20, 4500, FALSE);
}


LBitmap::Multiply

#include "ltwrappr.h"

virtual L_INT LBitmap::Multiply(uFactor)

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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LDialogImageEffect::DoModalMultiply, LBitmap::AddWeighted
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast

Example

void MyTestFunction(LAnimationWindow * pAniWnd)
{
pAniWnd->Multiply(80);
}


LBitmap::MultiScaleEnhancementBitmap

#include "ltwrappr.h"

virtual L_INT LBitmap::MultiScaleEnhancementBitmap (uContrast, uEdgeLevels, uEdgeCoeff, uLatitudeLevels, uLatitudeCoeff, uFlags)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmap::HistoContrast, LBitmap::AddWeighted, LBitmap::Multiply, LBitmap::SelectiveColor, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FTDisplay, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::MathFunction, LBitmap::SubtractBackground, LBitmap::UserFilter, LBitmap::AdaptiveContrast, LBitmap::ApplyMathLogic, LBitmap::ColorIntensityBalance, LBitmap::ColorizeGray, LBitmap::ContBrightInt, LBitmap::DigitalSubtract, LBitmap::DynamicBinary, LBitmap::EdgeDetectEffect, LBitmap::FunctionalLight, LBitmap::SelectData, LBitmap::ShiftData

Topics:

Raster Image Functions: Filtering Images

Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies multiscale enhancement. */
// Apply multiscale enhancement
pLeadBitmap->MultiScaleEnhancement( 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
}


LBitmap::Ocean

#include "ltwrappr.h"

virtual L_INT LBitmap::Ocean ( uAmplitude, uFrequency, bLowerTrnsp)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->Ocean(20,6,true);
}


LBitmap::Offset

#include "ltwrappr.h"

L_INT LBitmap::Offset(nHorizontalShift, nVerticalShift, crBackColor, uFlag)

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 LBitmapRgn::Offset 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 LBase::EnableStatusCallback.

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: | LBitmap::Emboss, LBitmap::MotionBlur, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::Tunnel, LBitmap::Spherize, LBitmapRgn::Offset
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.Offset(m_LBitmapWnd.GetWidth() / 2, m_LBitmapWnd.GetHeight() / 2, 0, FILL_WRAP);


LBitmap::Oilify

#include "ltwrappr.h"

virtual L_INT LBitmap::Oilify(uDim=4)

L_UINT uDim;

/* dimensions of the neighborhood (uDim x uDim), in pixels */

Applies an oil-painting effect to the class object's bitmap.

Parameter | Description
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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Emboss, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Oilify();


LBitmap::Perlin

#include "ltwrappr.h"

L_INT LBitmap::Perlin (uSeed, uFrequency, uIteration, uOpacity, crBClr, crFClr, nxCircle, nyCircle, nFreqLayout, nDenLayout, uFlags)

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
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 axes. 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 flags are set in the uFlags parameter. 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 in the uFlags parameter.
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 in the uFlags parameter.
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 flags are set to uFlags parameter. Possible values are range from 0 through 100. Increasing this value increases 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 indicate 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 indicate 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.

This function is similar to the LBitmap::Clouds 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 LBitmap::AddNoise 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 LBase::EnableStatusCallback.

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:

LBitmap::AddNoise, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::AddShadow, LBitmap::RevEffect, LBitmap::Aging, LBitmap::DiceEffect, LBitmap::FunctionalLight, LBitmap::PuzzleEffect, LBitmap::RingEffect, LBitmap::TextureAlphaBlend

Topics:

Raster Image Functions: Filtering Images

Applying Artistic Effects

Using the LBitmap::Perlin Function

Example

/* The following example loads a bitmap and adds Perlin noise to it: */
/* Load the bitmap, keeping the bits per pixel of the file */
LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
/* 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*/
LeadBitmap.Perlin( 0, 10, 8, 50, RGB (0, 0, 0), RGB (255, 0, 0), (L_INT) LeadBitmap.GetWidth() / 2, (L_INT) LeadBitmap.GetHeight() / 2, 4, 20, PRL_PURE |PRL_CIRCLE) ;


LBitmap::Perspective

#include "ltwrappr.h"

L_INT LBitmap::Perspective(pPoints, crBkgColor, uFlag)

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
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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Spherize
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images
 | Raster Image Functions: Processing an Image
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Artistic Effects

Example

POINT pNewLocations [4];
pNewLocations [0].x=m_LBitmapWnd.GetWidth()*3/9;
pNewLocations [0].y=m_LBitmapWnd.GetHeight()*1/12;
pNewLocations [1].x=m_LBitmapWnd.GetWidth()*3/4;
pNewLocations [1].y=m_LBitmapWnd.GetHeight()*2/12;
pNewLocations [2].x=m_LBitmapWnd.GetWidth()*2/10;
pNewLocations [2].y=m_LBitmapWnd.GetHeight()*8/10;
pNewLocations [3].x=m_LBitmapWnd.GetWidth()*10/11;
pNewLocations [3].y=m_LBitmapWnd.GetHeight()*7/10;

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.Perspective(pNewLocations,RGB(255,255,255), PERSPECTIVE_IMAGE);


LBitmap::Picturize

#include "ltwrappr.h"

virtual L_INT LBitmap::Picturize(pszDirName, uFlags, nCellWidth, nCellHeight)

L_TCHAR L_FAR * pszDirName; | /* directory name */
L_UINT uFlags; | /* flag that indicates the behavior of the process */
L_INT nCellWidth; | /* width of the images */
L_INT nCellHeight; | /* height of the images */

Replaces the class object's current image with an image created using images present in the specified directory.

Parameter | Description
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 | Flag that indicates the behavior of the process. Possible values are given below. These values can be combined using OR (|) or +.
 | Value | Meaning
 | PICTURIZE_LOADALL | [1] load all the pages in memory first. 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 | [2] resize the images that are not nCellWidth x nCellHeight using normal resize
 | PICTURIZE_RESAMPLE | [4] Resample the images that are not the required size (nCellWidth x nCellHeight). (slower process, better quality)
 | PICTURIZE_ONCE | [10] Use the image only once throughout the process.
 | PICTURIZE_EQUALUSAGE | [20] Use all images equally. That is, before an image will be used twice, all other images must be used at least once.
 | PICTURIZE_BESTFIT | [40] 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.

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.

The bitmap object is updated only once for every row of lines, where each line has a height dimension of nCellHeight. Therefore, the LBitmap::PicturizeCallBack() can be overridden to show the progress of every cell. For more information, refer to the LBitmap::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 LBitmap::PicturizeCallBack 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.

PICTURIZE_ONCE and PICTURIZE_EQUALUSAGE flags cannot be combined in the uFlags parameter.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::PicturizeCallBack, Class Members
Topics: | Raster Image Functions: Processing an Image

Example

//Picturize
// 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
LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Picturize(
TEXT("c:\\images"), // a directory contain images
PICTURIZE_LOADALL|PICTURIZE_RESIZE|PICTURIZE_EQUALUSAGE|PICTURIZE_BESTFIT,
32, 32);


LBitmap::PicturizeCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::PicturizeCallBack(pCellBitmap, x, y)

pBITMAPHANDLE pCellBitmap; | /* pointer to the bitmap handle */
L_INT x; | /* X coordinate */
L_INT y; | /* Y coordinate */

Called every time the best match is found to replace the rectangle

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.

Returns

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

Comments

This callback is called every time the best match is found to replace the rectangle starting at (x, y) in the class object's original bitmap.

Required DLLs and Libraries

LTDIS
LTFIL
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:

LBitmap::Picturize, Class Members

Example

#include "ltwrappr.h"
class LUserBitmap : public LBitmap
{
HWND m_hWnd;
public:
LUserBitmap(HWND hwnd);
virtual L_INT PicturizeCallBack(
pBITMAPHANDLE pCellBitmap,
L_INT x,L_INT y
);
virtual ~LUserBitmap();

};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LUserBitmap::LUserBitmap(HWND hwnd)
{
m_hWnd = hwnd;
}

LUserBitmap::~LUserBitmap()
{
}

L_INT LUserBitmap::PicturizeCallBack(
pBITMAPHANDLE pThumb,
L_INT x,L_INT y
)
{
LBitmap ThumbBitmap(pThumb);
RECT rcDest;
HDC hdc = GetDC(m_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 + ThumbBitmap.GetWidth(), y + ThumbBitmap.GetHeight());

// paint the bitmap at (x,y) coordinates
ThumbBitmap.Paint()->SetDC(hdc);
ThumbBitmap.SetDstRect(&rcDest);
ThumbBitmap.Paint()->PaintDC();

ReleaseDC(m_hWnd, hdc);

// return an error code if you want to abort the process
return SUCCESS;

}

L_INT MyPicturizeFunc(HWND hWnd)
{
LUserBitmap LeadBitmap(hWnd);

//Load an image
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);

// Call add noise function
// during the calling of this function
// StatusCallBack will be called
int nRet = LeadBitmap.Picturize(
TEXT("d:\\ltwin14\\images"),
PICTURIZE_LOADALL|PICTURIZE_RESIZE,
32, 32);
return nRet;
}


LBitmap::PicturizeList

#include "ltwrappr.h"

virtual L_INT L_PicturizeList(uxDim, uyDim, uLightnessFact, pBitmapList)

L_UINT uxDim; | /* thumbnail width */
L_UINT uyDim; | /* thumbnail height */
L_UINT uLightnessFact; | /* lightness factor */
LBitmapList * pBitmapList; | /* pointer to an LBitmapList object */

Picturizes the class object's bitmap using thumbnail images created from the specified bitmap list.

Parameter | Description
uxDim | Width of the thumbnail bitmap.
uyDim | 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.
pBitmapList | 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 class object's bitmap, or selected region, is broken down into rectangles of size uxDim x uyDim. 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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::Picturize LBitmap::PicturizeSingle, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile,
LBitmapList & BitmapList)
{
Bitmap.Load(szFile);
Bitmap.PicturizeList(20, 15, 200, &BitmapList);
}


LBitmap::PicturizeSingle

#include "ltwrappr.h"

virtual L_INT LBitmap::PicturizeSingle(pThumbBitmap, uxDim, uyDim, uLightnessFact)

LBitmapBase * pThumbBitmap; | /* pointer to an LBitmapBase object */
L_UINT uxDim; | /* thumbnail width */
L_UINT uyDim; | /* thumbnail height */
L_UINT uLightnessFact; | /* lightening or darkening value */

Picturizes the class object's bitmap using the specified thumbnail image.

Parameter | Description
pThumbBitmap | Pointer to an LBitmapBase object that contains 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 class object's bitmap, or selected region, is broken down into rectangles of size uxDim x uyDim. 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-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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::Picturize, LBitmap::PicturizeList, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile1,
L_TCHAR * szFile2)
{
LBitmapBase ThumbBitmap;

Bitmap.Load(szFile1);
ThumbBitmap.Load(szFile2);

Bitmap.PicturizeSingle(&ThumbBitmap, 20, 15, 200);
}


LBitmap::Pixelate

#include "ltwrappr.h"

virtual L_INT LBitmap::Pixelate(uCellWidth, uCellHeight, uOpacity, CenterPt, uFlags)

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
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 total opacity and 100 is total transparency.)
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.

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:

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalPixelate, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;
LAniWnd->Pixelate(5, 10, 100, CenterPt, PIX_AVR | PIX_RAD | PIX_WPER | PIX_HPER);
}


LBitmap::Plane

#include "ltwrappr.h"

virtual L_INT LBitmap::Plane(ptCenterPoint, uZValue, nDistance, uPlaneOffset, nRepeat nPydAngle, uStretch, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Doing Geometric Transformations

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT CenterPt;
CenterPt.x = BitmapWindow->GetWidth()/2;
CenterPt.y = BitmapWindow->GetHeight()/2;

BitmapWindow->Plane(CenterPt, 0, BitmapWindow->GetHeight(), BitmapWindow->GetWidth()/2, -1,4500, 25,100,0, 2000, RGB(255,0,0), RGB(0,0,0), PLANE_RIGHT | PLANE_LEFT | PLANE_FILL_CLR);
}


LBitmap::PlaneBend

#include "ltwrappr.h"

virtual L_INT LBitmap::PlaneBend(ptCenterPoint, uZValue, nDistance, uPlaneOffset, nRepeat, nPydAngle, uStretch, uBendFactor, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Tunnel, LBitmap::Plane, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::Ocean, LBitmap::DrawStar, LBitmap::Light, LBitmap::Dry
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT CenterPt;
CenterPt.x = BitmapWindow->GetWidth()/2;
CenterPt.y = BitmapWindow->GetHeight()/2;
BitmapWindow->PlaneBend( CenterPt, 0, BitmapWindow->GetHeight(), BitmapWindow->GetWidth()/2, -1,450, 25,40,10,0, 200, RGB(255,0,0), RGB(0,0,0), PLANE_DOWN | PLANE_UP | PLANE_FILL_CLR);
}


LBitmap::PlasmaFilter

#include "ltwrappr.h"

L_INT LBitmap::PlasmaFilter(pPlasmaInfo)

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
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 LBitmap::PlasmaFilter function, using a PLASMAINFO.uOpacity value of 0, which means that no image is to be used, and you use the following settings:

Parameter | Value
PLASMAINFO.uShift | 0
PLASMAINFO.uOpacity | 0
PLASMAINFO.uSize | 1000
PLASMAINFO.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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Spherize, LDialogImageEffect::DoModalPixelate, LBitmap::Pixelate
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Filtering Images
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects

Example

PLASMAINFO PlasmaInfo;
LBitmap LeadBitmap;
PlasmaInfo.uStructSize = sizeof(PLASMAINFO);
PlasmaInfo.uShift = 0;
PlasmaInfo.uOpacity = 50;
PlasmaInfo.uSize = 300;
PlasmaInfo.uFlags = PLSTYP_DIAGONAL | PLSCLR_RGB2;

LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.PlasmaFilter(&PlasmaInfo);


LBitmap::Pointillist

#include "ltwrappr.h"

L_INT LBitmap::Pointillist(uSize, crColor, uFlags)

L_UINT uSize; | /* dot size */
COLORREF crColor; | /* 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
uSize | Dot size, in pixels.
crColor | 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 crColor.
 | The following flags indicate which dot type to use:
 | Value | Meaning
 | POINTILLIST_STICKER | [0x0010] Use Dots that will overlap like stickers.
 | POINTILLIST_POINT | [0x0020] Use Dots that will adjust like bubbles.

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 LBitmap::Pointillist using the following values:

Parameter | Value
uSize | 4
crColor | Black
uFlags | POINTILLIST_COLOR | POINTILLIST_STICKER

The following figure results:

Use the LBitmap::RomanMosaic 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 LBitmap::Mosaic 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 LBitmap::Pixelate 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 LBitmap::MosaicTiles 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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmap::HalfTone, LBitmap::Mosaic, LBitmap::Pixelate, LBitmap::MosaicTiles, LBitmap::RomanMosaic, LBitmap::Cubism, LBitmap::DiceEffect, LBitmap::GlassEffect, LBitmap::PuzzleEffect, LBitmap::RingEffect, LBitmap::Canvas, LBitmap::BricksTexture, LBitmap::Dry, LBitmap::Impressionist
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.Pointillist(25, RGB(255,255,255), POINTILLIST_COLOR | POINTILLIST_POINT);


LBitmap::Polar

#include "ltwrappr.h"

virtual L_INT LBitmap::Polar(crFill, uFlags)

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

If CART_TO_POL is set, 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 source image into a circle around the center of the bitmap.

If POL_TO_CART is set, this function takes the pixels from concentric circles and considers their positions as values in a Cartesian coordinate system. Then it converts all the pixels in a circle into horizontal lines.

If there is any region selected on the bitmap, the effect will be applied on the region dimensions only.

Support for 12 and 16-bit grayscale images are 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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalPolar, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LAniWnd->Polar(0, FILL_RPT | CART_TO_POL);
}


LBitmap::Posterize

#include "ltwrappr.h"

virtual L_INT LBitmap::Posterize(uLevels=4)

L_UINT uLevels;

/* number of color levels to use */

Imposes a poster effect on the class object's 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
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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Posterize();


LBitmap::Punch

#include "ltwrappr.h"

virtual L_INT LBitmap::Punch (nValue, uStress, CenterPt, crFill, uFlags)

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

Support for 12 and 16-bit grayscale images are 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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalPunch, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->Punch(100, 100, CenterPt, 0, FILL_RPT | FILL_WOUTROT);
}


LBitmap::PuzzleEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::PuzzleEffect( uXBlock, uYBlock, uRandomize, uFlags, crColor);

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
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 uXBlock and uYBlock parameters as the width and height of each block, in pixels.
 | PUZZLE_COUNT | [0x0020] Apply the puzzle effect using 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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Mosaic, LBitmap::Picturize, LBitmap::PicturizeList, LBitmap::PicturizeSingle, LBitmap::Pixelate, LBitmap::Cubism, LBitmap::DiceEffect, LBitmap::RingEffect
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

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.

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies a Puzzle Effect over the loaded image. */
/* Apply Puzzle Effect to this bitmap */
pLeadBitmap->PuzzleEffect (10, 10, 0, PUZZLE_BORDER | PUZZLE_SHUFFLE | PUZZLE_COUNT | BITMAP_RESIZE, RGB(0,0,0));
}


LBitmap::RadialBlur

#include "ltwrappr.h"

virtual L_INT LBitmap::RadialBlur (uDim, uStress, CenterPt)

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
uDim | An integer that represents the size of the neighborhood used in blurring. Increasing this value will increase the amount of blurring. Valid values range from 1 through 100.
uStress | An integer that represents the amount of the blur intensity. Valid values range from 1 through 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.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalRadialBlur, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->RadialBlur(50, 10, CenterPt);
}


LBitmap::RadWave

#include "ltwrappr.h"

virtual L_INT LBitmap::RadWave(uAmplitude, uWaveLen, nPhase, CenterPt, crFill, uFlags)

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.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalRadialWave, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->RadWave(5, 25, 0, CenterPt, 0, FILL_RPT | DIS_FRQ);
}


LBitmap::RemapHue

#include "ltwrappr.h"

virtual L_INT LBitmap::RemapHue(pMask, pHTable, pSTable, pVTable, uLUTLen)

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. Support for 48 and 64-bit images is available only in the Document/Medical toolkits.

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

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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Changing Brightness and Contrast

Example

// 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(LBitmap * pBitmap, COLORREF crNewColor)
{
L_UINT L_FAR * uMaskTable;
L_UINT L_FAR * uHueTable;
L_UINT uHueGreen, uHueChange;
L_INT iHueChange;
L_INT i, iCount, nRet, uLUTLen;
if(pBitmap->GetBitsPerPixel() >= 48)
uLUTLen = 0x10000;
else if(pBitmap->IsGrayScale())
uLUTLen = 256;
else if((pBitmap->GetHandle())->pLUT && (pBitmap->GetHandle())->Flags.UseLUT)
uLUTLen = 256;
else
uLUTLen = (1 << pBitmap->GetBitsPerPixel ());
//Allocate tables
uMaskTable = (L_UINT *)malloc (uLUTLen * sizeof(L_UINT));
uHueTable = (L_UINT *)malloc (uLUTLen * sizeof(L_UINT));

//Initialize tables
for (i=0; i<uLUTLen; i++)
{
uMaskTable[i] = 0;
uHueTable[i] = i;
}

//Get the hue for green
uHueGreen = RGB(0,255,0);

//Obtain new hue
iHueChange = (L_INT)RGB(0,255,0) - (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 = pBitmap->RemapHue(uMaskTable, uHueTable, NULL, NULL, uLUTLen);

if(uMaskTable)
free(uMaskTable);
if(uHueTable)
free (uHueTable);
return nRet;
}


LBitmap::RemapIntensity

#include "ltwrappr.h"

virtual L_INT LBitmap::RemapIntensity(pLUT, uLUTLen, uChannel)

L_UINT * pLUT; | /* table of uLUTLen integers containing lookup values */
L_UINT uLUTLen; | /* length of the lookup table */
L_UINT uChannel; | /* flag that indicates the color channel to be affected */

Uses a lookup table to change the class object's bitmap intensity values. You can apply the change to red, green, blue, or all color channels.

Parameter | Description
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 | Flag that indicates the color channel to be affected. 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::GetUserLookupTable, LBitmap::GetFunctionalLookupTable, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::ChangeHue, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * pszFile)
{
L_UINT LookupTable[256];

Bitmap.Load(pszFile);

LookupTable[0] = 255;
LookupTable[255] = 0;

Bitmap.GetFunctionalLookupTable(LookupTable, 256, 0, 255, 0,
FLT_LINEAR);
Bitmap.RemapIntensity(LookupTable, 256, CHANNEL_MASTER);
}


LBitmap::RemoveRedEye

#include "ltwrappr.h"

virtual L_INT LBitmap::RemoveRedEye (rcNewColor, uThreshold, nLightness)

COLORREF rcNewColor; | /* new eye color */
L_UINT uThreshold; | /* threshold value */
L_INT nLightness; | /* lightening or darkening value */

Removes the "red eye" effect in the class object's bitmap by converting the red color in the eye to the new specified color.

Parameter | Description
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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBase::EnableStatusCallback, Class Members
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

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
Bitmap.Load(szFile);
Bitmap.RemoveRedEye(RGB(5, 20, 10), 128, 100);
}


LBitmap::RevEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::RevEffect(uLineSpace, uMaximumHeight)

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
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 LBitmap::GaussianFilter blur with a large nRadius value.

Apply the LBitmap::RevEffect 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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Emboss, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::Segment, LBitmap::SubtractBackground, LBitmap::UserFilter
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* Apply Rev effect on the image*/
pLeadBitmap->RevEffect (3, 37);
}


LBitmap::RingEffect

#include "ltwrappr.h"

virtual L_INT LBitmap::RingEffect (nXOrigin, nYOrigin, uRadius, uRingCount, uRandomize, crColor, nAngle, uFlags);

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
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 LBase::EnableStatusCallback.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::Mosaic, LBitmap::Picturize, LBitmap::PicturizeList, LBitmap::PicturizeSingle, LBitmap::Pixelate, LBitmap::Cubism, LBitmap::DiceEffect, LBitmap::PuzzleEffect
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* This example applies a Spiral Effect over the loaded image. */
L_UINT uXorg, uYorg, uRadius;

uXorg = (L_UINT)(pLeadBitmap->GetWidth ()/2);
uYorg = (L_UINT)(pLeadBitmap->GetHeight ()/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. */
pLeadBitmap->RingEffect( uXorg, uYorg, uRadius, 10, 0, RGB(0,0,0), 100, RING_COLOR | RING_FIXEDANGLE | RING_MAXRADIUS);
}


LBitmap::Ripple

#include "ltwrappr.h"

virtual L_INT LBitmap::Ripple (uAmplitude, uFrequency, nPhase, uAttenuation, CenterPt, crFill, uFlag)

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

Support for 12 and 16-bit grayscale images are 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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalRipple, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::RadialBlur, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->Ripple(20, 10, 0, 0, CenterPt, 0, FILL_RPT);
}


LBitmap::RomanMosaic

#include "ltwrappr.h"

L_INT LBitmap::RomanMosaic(uTileWidth, uTileHeight, uBorder, uShadowAngle, uShadowThresh, crColor, uFlags)

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

Use the LBitmap::Mosaic 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 LBitmap::Pixelate 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 LBitmap::MosaicTiles 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 LBitmap::Pointillist function to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.

As an example, if you use the following figure:

and you call the LBitmap::RomanMosaic 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:

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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Spherize, LBitmap::MosaicTiles, LBitmap::Pointillist
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap
 | Raster Image Functions: Artistic Effects

Example

   LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"),
 0,ORDER_BGR);
LeadBitmap.RomanMosaic(15,
 15, 5, SHADOW_E, 0, RGB(0,0,0), RMN_RECT | RMN_SHADOWGRAY);


LBitmap::SampleTarget

#include "ltwrappr.h"

virtual L_INT LBitmap::SampleTarget (crSample, crTarget, uFlags)

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
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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Artistic Effects
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Correcting Colors
 | Raster Image Functions: Correcting Colors

Example

/* The following example applies the sample target function:*/
void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->SampleTarget(RGB(50, 100, 150), RGB(20, 10 , 100), SAMP_RED| SAMP_MID);
}


LBitmap::Scramble

#include "ltwrappr.h"

virtual L_INT LBitmap::Scramble (nColStart, nRowStart nWidth, nHeight, uKey, uFlags)

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

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: | LAnnEncrypt::GetEncryptOptions, LAnnEncrypt::SetEncryptOptions, Class Members
Topics: | Annotation Functions: Object Properties
 | Implementing Annotations
 | Automated User Interface for Annotations
 | Annotation Functions: Creating and Deleting Annotations
 | Types of Annotations

Example

L_VOID ExampleScrambleBitmap(LBitmap *pLBitmap)
{
if (!pLBitmap->IsAllocated())
return;

pLBitmap->Scramble(
0,
0,
pLBitmap->GetWidth()/2,
pLBitmap->GetHeight()/2,
123,
SB_ENCRYPT);
}


LBitmap::SearchRegMarks

#include "ltwrappr.h"

virtual L_INT LBitmap::SearchRegMarks (pSearchData, uMarkCount)

LPSEARCHMARKS pSearchMarks; | /* array describing the registration marks to be found */
L_UINT uMarkCount; | /* size of array */

Searches bitmap object for the registration marks according to the information in pSearchMarks. This function is available in the Document/Medical Toolkits.

Parameter | Description
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 LBitmap::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 LBase::EnableStatusCallback.

If you simply want to automatically straighten a bitmap, use the LBitmap::Deskew 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.

See Also

Functions: | LBitmapBase::Combine, LBitmapBase::Rotate, LBitmapBase::Size, LBitmapBase::Resize, LBitmap::IsRegMarkBitmap, LBitmap::GetTransformationParameters, LBitmap::GetMarksCenterMass
Topics: | Raster Image Functions: Document Imaging
 | Detecting Registration Marks

Example

For an example, refer to LBitmap::GetTransformationParameters.


LBitmap::Segment

#include "ltwrappr.h"

virtual L_INT LBitmap::Segment(uThreshold, uFlag)

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
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 LBase::EnableStatusCallback.

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:

LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::HighPassFilter, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::HistoContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::Sharpen, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::Posterize, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::SubtractBackground, LBitmap::UserFilter

Topics:

Raster Image Functions: Modifying Intensity Values

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* segment the bitmap */
pLeadBitmap->Segment (20, SGM_RGB);
}


LBitmap::SelectData

#include "ltwrappr.h"

virtual L_INT LBitmap::SelectData (pSrcBitmap, crColor, uSrcLowBit, uSrcHighBit, uThreshold, bCombine)

virtual L_INT LBitmap::SelectData (plSrcBitmap, crColor, uSrcLowBit, uSrcHighBit, uThreshold, bCombine)

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 */
LBitmapBase *plSrcBitmap; | /* pointer to the source bitmap object */

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
pSrcBitmap | Pointer to the source 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.
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.
plSrcBitmap | Pointer to the source bitmap object that will contain the result of the function. This bitmap object 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.

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 LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::WindowLevel, LBitmap::WindowLevelBitmap, LBitmap::GrayScaleToDuotone, LBitmap::GrayScaleToMultitone, LBitmap::ShiftData, LBitmap::ColorizeGray, LBitmap::SelectiveColor
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Using Color Values in LEADTOOLS
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap, LBitmap *pSrcBitmap)
{
/* This example applies Selecting. */

// Call the function
pLeadBitmap->SelectData (
pSrcBitmap,
RGB(233, 10, 77),
2 /* uSrcLowBit */,
6 /* uSrcHighBit */,
25 /* uThreshold */,
TRUE);

pLeadBitmap->Free ();

// Now we have the resulted image in pLeadBitmap
}


LBitmap::SelectiveColor

#include "ltwrappr.h"

virtual L_INT LBitmap::SelectiveColor (pSelClr)

pSELCLR pSelClr;

/* pointer a 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
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 LBitmap::SelectiveColor 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].

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::ColorLevel, LBitmap::AutoColorLevel
Topics: | Raster Image Functions: Modifying Intensity Values
 | Correcting Colors
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

/* This example loads a bitmap and applies selective color to the image. */
void MyTestFunction(LAnimationWindow * LAniWnd)
{
SELCLR selClr; /* Variable to be used in the function */
// 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
LAniWnd->SelectiveColor (&selClr);
}


LBitmap::SetKaufmannRgn

#include "ltwrappr.h"

L_INT LBitmap::SetKaufmannRgn (pProcessedBitmap,nRadius,nMinInput,nMaxInput, nRgnThreshold, ptRgnStart,bRemoveHoles, puPixelsCount, uCombineMode)

pBITMAPHANDLE pProcessedBitmap; | /* 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
pProcessedBitmap | 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 by this object. 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 pProcessedBitmap contains the data from this object's bitmap, enhanced using the internal enhancing procedures, and the resulting region. This region is drawn on the image in this object's bitmap, but the bitmap in this object 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 puPixelsCount value for this first region.
2. | Call the function once more to create a region for the second area. Save the puPixelsCount 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 LBase::EnableStatusCallback.

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: | LBitmapRgn::SetRgnColor, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnBorder, LBitmapRgn::SetRgnCurve, LBitmapRgn::SetRgnFromMask, LBitmapRgn::SetRgnMagicWand, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect, LBitmapRgn::SetRgnXForm, LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::WindowLevel, LBitmap::HistoContrast, LBitmap::ColorLevel, LBitmap::GaussianFilter, LBitmapRgn::HolesRemovalRgn
Topics: | Creating a Bitmap Region
 | Raster Image Functions: Creating and Using a Region

Example

void SetkaufmannrgnExample()
{
POINT pt;
L_UINT uFirstPixelCount;
L_UINT uSecondPixelCount;
L_UCHAR szText[20] = "\0";
LBitmap Bitmap;
L_INT nRet = 0 ;

/* Load a bitmap at its own bits per pixel */
nRet = Bitmap.Load(TEXT("Image3.dic"),0,ORDER_BGRORGRAY,NULL,NULL) ;
if (nRet != SUCCESS)
{
MessageBox(TEXT("Failed to load image!"), TEXT("Load Failure"), MB_OK | MB_ICONERROR);
return ;
}

/* get the center of the bitmap */
pt.x = BITMAPWIDTH(Bitmap.GetHandle()) >> 1;
pt.y = BITMAPHEIGHT(Bitmap.GetHandle()) >> 1;

// Converting the bitmap into 8 bit gray scale bitmap
nRet = Bitmap.GrayScale() ;

// apply the function in order to get the pixels count of the first region.
nRet = Bitmap.SetKaufmannRgn(NULL, 21, 54, 110, 13, pt, FALSE, (unsigned long*)&uFirstPixelCount, L_RGN_SET) ;

// apply the function once more.
nRet = Bitmap.SetKaufmannRgn(NULL, 29, 51, 229, 207, pt, TRUE, (unsigned long*)&uSecondPixelCount, L_RGN_SET);

// print the ratio between the first and the second region.
_gcvt(uFirstPixelCount * 1.0 / uSecondPixelCount, 3, (char*)szText);
MessageBox((char*)szText, "Ratio", MB_OK | MB_ICONINFORMATION);
}


LBitmap::SetOverlay

#include "ltwrappr.h"

virtual L_INT LBitmap::SetOverlay(nIndex, pOverlayBitmap, uFlags)

virtual L_INT LBitmap::SetOverlay(nIndex, pLOverlayBitmap, uFlags)

L_INT nIndex; | /* the overlay index */
pBITMAPHANDLE pOverlayBitmap; | /* pointer to the overlay bitmap handle */
L_UINT uFlags; | /* flags that determine setting options */
LBitmapBase * pLOverlayBitmap; | /* pointer to the overlay bitmap Object */

Sets the overlay bitmap for a certain index.

Parameter | Description
nIndex | The index of the overlay being affected. 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 setting options. Values cannot be combined. Possible values are:
 | Value | Meaning
 | OVERLAY_COPY | [0x0000] Insert a copy of the overlay bitmap into the overlay list. pOverlayBitmap will not be affected.
 | OVERLAY_NOCOPY | [0x0001] Set pOverlayBitmap 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] Move pOverlayBitmap into the overlay list. It will also be reset, so you cannot make changes to it. This is recommended over OVERLAY_NOCOPY.
pLOverlayBitmap | Pointer to the overlay bitmap obect which contains the new overlay bitmap. This can be NULL, in which case the corresponding overlay bitmap will be freed.

Returns

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

Comments

The old overlay bitmap from index nIndex is freed. If pOverlayBitmap is NULL, the old overlay bitmap is freed and the size is reset to:

OverlayWidth = BITMAPWIDTH(pBitmap) - nLeft

OverlayHeight = BITMAPHEIGHT(pBitmap) – nTop,

where

nLeft is the left overlay offset

nTop is the top overlay offset

BITMAPWIDTH is a macro which determines the display bitmap width, taking the ViewPerspective into account.

BITMAPHEIGHT is a macro which determines the display bitmap height, taking the ViewPerspective 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 bitmaphandle stored in the array. For example, if you free the overlay bitmap, the data pointed 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 LBitmap::SetOverlay. Note that you can call LBitmap::SetOverlay with an unallocated bitmap. In that case, only the width and height are used from the overlay bitmap.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations, 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(LBitmap *plBitmap,LPTSTR pszName,L_INT nIndex,COLORREF crColor)
{
L_INT nRet;
LBitmap OverlayBitmap;
OVERLAYATTRIBUTES OverlayAttributes;

// load and then set the overlay bitmap
nRet = OverlayBitmap.Load( pszName, 1,ORDER_RGB,NULL,NULL);
if(nRet == SUCCESS)
nRet = plBitmap->SetOverlay( 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 = plBitmap->GetBitsPerPixel() - nIndex - 1;
nRet = plBitmap->SetOverlayAttributes(nIndex,
&OverlayAttributes,
OVERLAYATTRIBUTES_COLOR |
OVERLAYATTRIBUTES_FLAGS |
OVERLAYATTRIBUTES_ORIGIN |
OVERLAYATTRIBUTES_BITINDEX);
}
return nRet;
}


LBitmap::SetOverlayAttributes

#include "ltwrappr.h"

virtual L_INT LBitmap::SetOverlayAttributes(nIndex, pOverlayAttributes, uFlags)

L_INT nIndex; | /* the overlay index */
pOVERLAYATTRIBUTES pOverlayAttributes; | /* pointer to the overlay attributes structure */
L_UINT uFlags; | /* flags that determine which attributes should be changed */

Sets overlay attributes for a certain index.

Parameter | Description
nIndex | The index of the overlay being affected. This index is zero-based.
pOverlayAttributes | Structure containing the overlay attributes.
uFlags | Flags that determine overlay attributes should be changed. You can combine values using a bitwise OR ( | ). Possible values are:
 | Value | Meaning
 | OVERLAYATTRIBUTES_ORIGIN | [0x0001] Change the top-left position. pOverlayAttributes->ptOrigin contains the new top-left offset
 | OVERLAYATTRIBUTES_COLOR | [0x0002] Change the color. pOverlayAttributes->crColor contains the new color
 | OVERLAYATTRIBUTES_FLAGS | [0x0004] Change the flags. pOverlayAttributes->uFlags contains the new flags
 | OVERLAYATTRIBUTES_BITINDEX | [0x0008] Change the corresponding bitplane position. pOverlayAttributes->uBitPosition contains the new bitplane index.
 | OVERLAYATTRIBUTES_DICOM | [0x0010] Change the DICOM-related attributes, 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

Some or all the overlay attributes are being changed. Before calling this function, initialize pOverlayAttributes->uStructSize to be sizeof(OVERLAYATTRIBUTES) and initialize all the attributes you are changing. You do not need to initialize the structure variables that you are not updating. For example, if you are not setting OVERLAYATTRIBUTES_ORIGIN, 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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations, Overlay Overview

Example

/* You can also see the example for LBitmap::SetOverlayBitmap */
/* This example will change only one of the flag attributes for all the overlays */
/* Note that OverlayAttributes.uStructSize is not initialized directly. LBitmap::GetOverlayAttributes
is initializing OverlayAttributes.uStructSize */
L_VOID ShowOverlays(HWND hWnd, LBitmap * plBitmap, L_BOOL bShow)
{
L_INT i;
OVERLAYATTRIBUTES OverlayAttributes;

for(i = 0; i <= MAX_OVERLAYS; i++)
{
plBitmap->GetOverlayAttributes(i, &OverlayAttributes, sizeof(OverlayAttributes), OVERLAYATTRIBUTES_FLAGS);
if(bShow)
OverlayAttributes.uFlags |= OVERLAY_AUTOPAINT;
else
OverlayAttributes.uFlags &= ~OVERLAY_AUTOPAINT;
plBitmap->SetOverlayAttributes(i, &OverlayAttributes, OVERLAYATTRIBUTES_FLAGS);
}

InvalidateRect(hWnd, NULL, FALSE);
}


LBitmap::Sharpen

#include "ltwrappr.h"

virtual L_INT LBitmap::Sharpen(nSharpness)

L_INT nSharpness;

/* amount to change the sharpness */

Increases or decreases the sharpness of the image in the class object's bitmap.

Parameter | Description
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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Emboss, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions:Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Sharpen(500);


LBitmap::ShiftData

#include "ltwrappr.h"

virtual L_INT LBitmap::ShiftData (pSrcBitmap, uSrcLowBit, uSrcHighBit, uDstLowBit, uDstBitsPerPixel)

virtual L_INT LBitmap::ShiftData (plSrcBitmap, uSrcLowBit, uSrcHighBit, uDstLowBit, uDstBitsPerPixel)

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 */
LBitmapBase *plSrcBitmap; | /* pointer to the source bitmap object */

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
pSrcBitmap | Pointer to the source bitmap that will contain the result of the function. The user should free the bitmap before passing it to the function.
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
plSrcBitmap | Pointer to the source bitmap object that will contain the result of the function. The user should free the bitmap before passing it to the function.

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 bitmap object since there is no space for them.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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.

See Also

Functions: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::SelectData, LBitmap::ColorizeGray.
Topics: | Raster Image Functions: Modifying Intensity Values
 | Grayscale Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Correcting Colors

Example

void TestFunction(LBitmap *pLeadBitmap, LBitmap *pSrcBitmap)
{
/* This example applies Shifing. */
/* Move 5 bits starting from bit 2 into the high 8-bits of the destination bitmap */
pLeadBitmap->ShiftData (pSrcBitmap,
2 /* uSrcLowBit */,
6 /* uSrcHighBit*/,
3 /* uDstLowBit */,
8 /* uDstBitsPerPixel */ );

pLeadBitmap->Free ();

// Now we have the resulting image in pLeadBitmap
}


LBitmap::ShiftMinimumToZero

#include "ltwrappr.h"

L_INT LBitmap::ShiftMinimumToZero(puShiftAmount)

L_UINT L_FAR * puShiftAmount;

/* pointer to the shifting amount */

Converts the signed bitmap to an unsigned bitmap by increasing or shifting the bitmap's intensity values, so the lowest intensity value (the most negative value) will be shifted to zero. This function is available in the Raster Pro and above toolkits.

Parameter | Description
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 LBitmap::ConvertSignedToUnsigned. However, LBitmap::ShiftMinimumToZero updates the puShiftAmount parameter with the value by which the intensity values were shifted.

The LBitmap::ShiftMinimumToZero and LBitmap::ShiftZeroToNegative functions are most often used in concert with one or more image processing or analysis functions. LBitmap::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, LBitmap::ShiftZeroToNegative converts the unsigned data back to signed data.

This function updates the "Flags.Signed", "MinVal" and "MaxVal" members of the class object’s BITMAPHANDLE member; a pointer obtained by calling LBitmapBase::GetHandle function.

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.

See Also

Functions: | LBitmapBase::ClearNegativePixels, LBitmap::ConvertUnsignedToSigned, LBitmap::ConvertSignedToUnsigned, LBitmap::ShiftZeroToNegative
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

L_VOID ShiftMinimumToZeroExample()
{
// This function will apply LBitmap::MultiScaleEnhancementBitmap on a signed image,
// but since LBitmap::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_UINT nShiftAmount;
LBitmap LeadBitmap;
L_INT nRet;
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
nRet = LBaseFile::GetDefaultLoadFileOption(&LoadFileOption, sizeof(LoadFileOption));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
nRet = LeadBitmap.Load(TEXT("C:\\SignedBtimap.dcm"), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

// Convert the bitmap to unsigned bitmap by shifting the negative values to become positive.
nRet = LeadBitmap.ShiftMinimumToZero(&nShiftAmount);

// Apply multiscale enhancement
nRet = LeadBitmap.MultiScaleEnhancementBitmap( 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 = LeadBitmap.ShiftZeroToNegative( nShiftAmount, -32767, 32766, 0, 65535);
}


LBitmap::ShiftZeroToNegative

#include "ltwrappr.h"

L_INT LBitmap::ShiftZeroToNegative(nShiftAmount, nMinInput, nMaxInput, nMinOutput, nMaxOutput)

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
nShiftAmount | The amount by which to decrease the bitmap's intensity values. This value is used to shift the bitmap data to include negative values.
nMinInput | The bitmap's minimum intensity value. This value can be obtained by calling the LBitmap::GetMinMaxVal function.
nMaxInput | The bitmap's maximum intensity value. This value can be obtained by calling the LBitmap::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 LBitmap::ConvertUnsignedToSigned. However, LBitmap::ShiftZeroToNegative lets the user determine the value by which to shift the data, while in LBitmap::ConvertUnsignedToSigned, the shift is fixed always. (i.e. shift center to zero.)

The LBitmap::ShiftMinimumToZero and LBitmap::ShiftZeroToNegative are most often used in concert with one or more image processing or analysis functions. LBitmap::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, LBitmap::ShiftZeroToNegative converts the unsigned data back to signed data.

This function updates the "Flags.Signed", "MinVal" and "MaxVal" members of the class object’s BITMAPHANDLE member; a pointer obtained by calling LBitmapBase::GetHandle function.

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.

See Also

Functions: | LBitmapBase::ClearNegativePixels, LBitmap::ConvertUnsignedToSigned, LBitmap::ConvertSignedToUnsigned, LBitmap::ShiftMinimumToZero
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

L_VOID ShiftZeroToNegativeExample()
{
// This function will apply LBitmap::MultiScaleEnhancementBitmap on a signed image,
// but since LBitmap::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_UINT nShiftAmount;
LBitmap LeadBitmap;
L_INT nRet;
LOADFILEOPTION LoadFileOption;

/* enable negative pixels to be loaded from TIFF files */
nRet = LBaseFile::GetDefaultLoadFileOption(&LoadFileOption, sizeof(LoadFileOption));
LoadFileOption.Flags |= ELO_SIGNED;

/* Load the bitmap, keeping the bits per pixel of the file */
nRet = LeadBitmap.Load(TEXT("C:\\SignedBtimap.dcm"), 0, ORDER_BGRORGRAY, &LoadFileOption, NULL);

// Convert the bitmap to unsigned bitmap by shifting the negative values to become positive.
nRet = LeadBitmap.ShiftMinimumToZero(&nShiftAmount);

// Apply multiscale enhancement
nRet = LeadBitmap.MultiScaleEnhancementBitmap( 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 = LeadBitmap.ShiftZeroToNegative( nShiftAmount, -32767, 32766, 0, 65535);
}


LBitmap::Skeleton

#include "ltwrappr.h"

virtual L_INT LBitmap::Skeleton(uThreshold)

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
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 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: | LBitmap::DiffuseGlow, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmapBase::Combine, LBitmap::IntensityDetect, LBitmap::Sharpen, LBitmap::SpatialFilter, LBitmap::EdgeDetector, LBitmap::GlowFilter, LBitmap::Correlation
Topics: | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Filtering Images
 | Color Halftones and Halftone Images
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

/* This example loads a bitmap and finds its edges using LBitmap::EdgeDetector then produces the skeleton of these edges */
void MyTestFunction(LAnimationWindow * LAniWnd)
{
/* Find the edges in the bitmap*/
LAniWnd->EdgeDetector (60, EDG_SOBEL_ALL);
LAniWnd->Skeleton(128);
}


LBitmap::Slice

#include "ltwrappr.h"

L_INT LBitmap::Slice(pOptions, pnDeskewAngle);

pSLICEBITMAPOPTIONS pOptions; | /* pointer to a structure */
L_INT32 L_FAR * pnDeskewAngle; | /* address of the deskew angle variable to be updated */

Extracts individual slices from radiographic scanned film. This function is available in the Raster Pro and above toolkits.

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

Returns

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

Comments

Please note that this function is not currently supported in the Class Library. However, this functionality can be implemented by calling the API function directly. The following code sample indicates how to call the API function from your code:

/*The following example finds all the slices inside some radiographic scanned film and saves them to the selected folder:*/

typedef struct tagSLICEBITMAPUSERINFO

{

L_CHAR 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;

}

void CDemoView::OnExampleSlicebitmap()

{

SLICEBITMAPOPTIONS Options;

SLICEBITMAPUSERINFO UserData;

L_INT nRet;

L_CHAR S[30] = TEXT("");

L_CHAR Message[512] = TEXT("");

L_CHAR *SlicesFolder = "e:\\slices";

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(m_LAniWnd.GetHandle(), &Options, NULL, ExampleSliceCB, (L_VOID L_FAR *)(&UserData));

if(nRet == SUCCESS)

{

lstrcpy(Message, TEXT("The number of sliced images is "));

wsprintf(S, TEXT("%d"), (UserData.SlicesCount));

strcat(Message, S );

MessageBox( Message, TEXT("SliceBitmap Example"), MB_OK);

}

}

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 LBitmap::Slice 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 LBase::EnableStatusCallback.

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: | LBitmap::SliceCallBack
Topics: | Processing an Image
 | Raster Image Functions: Creating and Maintaining Lists of Images
 | Raster Image Functions: Processing an Image
 | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Processing an Image

Example

L_INT LUserBitmap::SliceCallBack(pBITMAPHANDLE pBitmap, LPRECT lpSliceRect, L_INT nAngle)
{
static L_INT nCount = 1 ;
L_TCHAR szFileName[L_MAXPATH];
L_INT nRet;
LBitmap UserBitmap;

wsprintf(szFileName,TEXT("C:\\Slices\\Slice%d.bmp"), (nCount));

UserBitmap.SetHandle(pBitmap) ;

nRet = UserBitmap.Save(szFileName, FILE_BMP, 24, 2, 0);
if(nRet == SUCCESS)
{
(nCount)++;
UserBitmap.Free();
GlobalFree(UserBitmap.GetHandle());
}
return SUCCESS;
}
void CDemoView::OnSlice()
{
int nRet = 0;
LUserBitmap UserBitmap;

SLICEBITMAPOPTIONS Options;
memset(&Options , 0, sizeof(Options));

Options.uStructSize = sizeof(Options);
Options.uMaxDeskewAngle = 500;
Options.crFill = RGB(0,0,0);
Options.uFlags = SLC_DESKEW | SLC_DSKW_LINEAR | SLC_CUTSLICES ;

UserBitmap.EnableCallBack(TRUE);

UserBitmap.SetHandle(m_LAniWnd.GetHandle()) ;
nRet = UserBitmap.Slice(&Options, NULL);
m_LAniWnd.SetHandle(UserBitmap.GetHandle()) ;
}


LBitmap::SliceCallBack

#include "ltwrappr.h"

L_INT LBitmap::SliceCallBack(pBitmap, lpSliceRect, nAngle)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap */
LPRECT lpSliceRect; | /* pointer to the bounding rectangle of the extracted slice */
L_INT nAngle; | /* deskew angle */

Handles each slice segment found by the LBitmap::Slice 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 LBitmapBase::Free, 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.

Returns

>0 | Continue the process.
-1 | Stop the process and return the specified error code. Refer to Return Codes.

Comments

Please note that the slice functionality is not currently supported in the Class Library. However, this functionality can be implemented by calling the API function directly. For a code sample that indicates how to call the API function from your code, refer to LBitmap::Slice.

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: | LBitmap::Slice
Topics: | Processing an Image
 | Raster Image Functions: Creating and Maintaining Lists of Images
 | Raster Image Functions: Creating and Using a Region

Example

For an example, refer to LBitmap::Slice.


LBitmap::Smooth

#include "ltwrappr.h"

virtual L_INT LBitmap::Smooth(pSmooth)

LPSMOOTH pSmooth;

/* pointer to a structure */

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
pSmooth | Pointer to the SMOOTH structure that LEADTOOLS uses to perform the smoothing operation

Returns

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

Comments

This function smooths the text in scanned text documents.

The behavior of this function can be modified by overriding LBitmap::SmoothCallback.

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.

See Also

Functions: | LBitmap::SmoothCallback, LBitmap::LineRemove, LBitmap::BorderRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove
Topics: | Cleaning Up 1-Bit Images

Example

//This example smooths all nicks and bumps up to 2 pixels in length
//Long bumps/nicks are treated before short bumps/nicks
//A LEAD region is updated to show all the changes.
//The derived class LMyBitmap is used to override the SmoothCallBack function.
//myBitmap is an object of class LMyBitmap.
//This callback member function is used to display information about bumps or nicks
//The callback member function does NOT receive a Windows region

void CCleanv12Dlg::OnButtonSmooth()
{
SMOOTH smooth;
BITMAPHANDLE BitmapHandle;
L_INT32 nRet;

smooth.iSize = sizeof (SMOOTH);
smooth.iLength = 2;
smooth.pBitmapRegion = &BitmapHandle;

smooth.uFlags = SMOOTH_SINGLE_REGION | SMOOTH_LEAD_REGION | SMOOTH_FAVOR_LONG;
nRet = m_Bitmap.Smooth(&smooth);

if (nRet == SUCCESS)
{
//Delete the existing region
LBitmapRgn Region(&m_Bitmap);
if(Region.BitmapHasRgn())
{
Region.Free();
}

m_Bitmap.SetHandle(smooth.pBitmapRegion, FALSE);
Invalidate();
}
}

L_INT LMyBitmap::SmoothCallBack(
L_UINT32 uBumpOrNick,
L_INT32 iStartRow,
L_INT32 iStartCol,
L_INT32 iLength,
L_UINT32 uHorV
)
{
CString strMsg;
CString strHorV;
CString strBumpOrNick;

switch (uBumpOrNick)
{
case SMOOTH_BUMP:
strBumpOrNick = TEXT("Bump");
break;

case SMOOTH_NICK:
strBumpOrNick = TEXT("Nick");
break;
}

if (uHorV == SMOOTH_HORIZONTAL_ELEMENT)
{
strHorV = TEXT("Horizontal");
}
else
{
strHorV = TEXT("Vertical");
}

//Note: no hRgn to delete because it was not requested
strMsg.Format(
TEXT("Type[%s]\tRow Col[%d, %d]\tLength[%d]\t[%s]\n"),
strBumpOrNick,
iStartRow,
iStartCol,
iLength,
strHorV);
OutputDebugString(strMsg);
return SUCCESS_REMOVE;
}


LBitmap::SmoothCallBack

#include "ltwrappr.h"

virtual L_INT LBitmap::SmoothCallBack(uBumpOrNick, iStartRow, iStartCol, iLength, uHorV)

L_UINT32 uBumpOrNick; | /* flag */
L_INT32 iStartRow; | /* starting row */
L_INT32 iStartCol; | /* starting column */
L_INT32 iLength; | /* length */
L_UINT32 uHorV; | /* flag */

Called for each bump or nick found by LBitmap::Smooth. 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

Returns

SUCCESS_REMOVE | Remove the bump or fill the nick.
SUCCESS_NOREMOVE | Do not remove the bump or fill the nick.
Otherwise | An error occurred. Refer to Return Codes.

Comments

This member function is called for each bump and nick found by LBitmap::Smooth. Return SUCCESS_REMOVE to have the bump removed or the nick filled. 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 LBitmap::Smooth().If flags SMOOTH_IMAGE_UNCHANGED and SMOOTH_SINGLE_REGION are being used, then the return value of this function 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: | LBitmap::Smooth
Topics: | Cleaning Up 1-Bit Images

Example

For an example, refer to LBitmap::Smooth.


LBitmap::SmoothEdges

#include "ltwrappr.h"

virtual L_INT LBitmap::SmoothEdges(uAmount, uThreshold)

L_UINT uAmount; | /* blur size */
L_UINT uThreshold; | /* threshold value */

Smoothes the rough edges in the image.

Parameter | Description
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 LBase::EnableStatusCallback.

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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::Fragment, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Solarize
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Correcting Colors
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
BitmapWindow->SmoothEdges(75, 0);
}


LBitmap::Solarize

#include "ltwrappr.h"

virtual L_INT LBitmap::Solarize(uThreshold)

L_UINT uThreshold;

/* intensity threshold */

Applies an effect to the class object's bitmap 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
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

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Emboss, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions:Filtering Images
 | Applying Artistic Effects

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.Solarize(50);


LBitmap::SpatialFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::SpatialFilter(pFilter);

LPSPATIALFLT pFilter;

/* pointer to the spatial filter to use */

Imposes a spatial filter on the class object's bitmap. You can supply your own filter or use one of the predefined filters.

Parameter | Description
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

Imposes a spatial filter on the class object's bitmap. You can supply your own filter or use one of the predefined filters. 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.

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 LBitmap::SpatialFilter 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::DiffuseGlow, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::BinaryFilter, LBitmap::AddNoise, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Deleting and Enhancing Edges and Lines
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.SpatialFilter(FLT_PREWITT_HORZ);


LBitmap::Spherize

#include "ltwrappr.h"

virtual L_INT LBitmap::Spherize(nValue, CenterPt, crFill, uFlags)

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
nValue | Amount of stretching where :
 | Positive values: stretch the central pixels toward the edges.
 | Negative values: stretch the pixels toward the Center.
 | Valid range is –500 to 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.

Support for 12 and 16-bit grayscale images are 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.

Libraries

win32

ltkrn14n.dll (ltkrn_n.lib import library)
ltimg14n.dll (ltimg_n.lib import library)

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalSpherize, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::RadialBlur, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->Spherize(100, CenterPt, 0, FILL_RPT | FILL_WOUTROT);
}


LBitmap::StretchIntensity

#include "ltwrappr.h"

virtual L_INT LBitmap::StretchIntensity(void);

Increases the contrast in the class object's bitmap by centering, maximizing, and proportioning the range of intensity values.

Returns

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

Comments

Unlike the LBitmap::ChangeContrast 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 LBase::EnableStatusCallback.

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
LTFIL
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: | LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::HistoContrast, LBitmap::ChangeHue, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeContrast, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.StretchIntensity();


LBitmap::SubtractBackground

#include "ltwrappr.h"

virtual L_INT LBitmap::SubtractBackground (uRollingBall, uShrinkSize, uBrightnessFactor, uFlags)

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
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_AUTO | [0] The Shrink Size depends on the ball size.
 | SBK_1_1 | [1] No Resize (Highest accuracy).
 | SBK_1_2 | [2] Resize to half width and height.
 | SBK_1_4 | [3] Resize to quarter width and height.
 | SBK_1_8 | [4] Resize to eighth width and height (very fast).
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 LBitmap::Multiply. 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 LBase::EnableStatusCallback.

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: | LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::UserFilter
Topics: | Changing Brightness and Contrast
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Changing Brightness and Contrast

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/* Apply Subtract Background effect on the image*/
pLeadBitmap->SubtractBackground(50, 0, 0, SBK_BG_DARK | SBK_RES_SHOW);
}


LBitmap::SwapColors

#include "ltwrappr.h"

virtual L_INT LBitmap::SwapColors(nFlags)

L_INT nFlags;

/* flag */

Swaps the specified color channels.

Parameter | Description
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 data of the class object's 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.

This function supports signed data images.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::ConvertToColoredGray, LBitmap::BalanceColors, LBitmapBase::GrayScale, LBitmap::GrayScaleExt, LBitmapBase::IsGrayScale, Class Members
Topics: | Correcting Colors
 | Raster Image Functions: Modifying Intensity Values
 | Raster Image Functions: Correcting Colors

Example

L_INT SwapRedBlue(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.SwapColors(SWAP_RB);
}


LBitmap::Swirl

#include "ltwrappr.h"

virtual L_INT LBitmap::Swirl(nAngle, CenterPt)

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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalSwirl, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::RadialBlur, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->Swirl(180, CenterPt);
}


LBitmap::TextureAlphaBlend

#include "ltwrappr.h"

virtual L_INT LBitmap::TextureAlphaBlend (nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, pBitmapMask, nOpacity, pBitmapUnderlay, pOffset)

virtual L_INT LBitmap::TextureAlphaBlend (nXDst, nYDst, nWidth, nHeight, plBitmapSrc, nXSrc, nYSrc, plBitmapMask, nOpacity, plBitmapUnderlay, pOffset)

L_INT nXDst; | /* x coordinate in destination bitmap */
L_INT nYDst; | /* y coordinate in destination bitmap */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
pBITMAPHANDLE pBitmapSrc; | /* pointer to a bitmap handle */
L_INT nXSrc; | /* x coordinate in source bitmap */
L_INT nYSrc; | /* y coordinate in source bitmap */
pBITMAPHANDLE pBitmapMask; | /* pointer to a bitmap handle */
L_INT nOpacity; | /* opacity value */
pBITMAPHANDLE pBitmapUnderlay; | /* pointer to the underlay bitmap handle */
LPPOINT pOffset; | /* pointer to an underlay bitmap offset */
LBitmapBase *plBitmapSrc; | /* pointer to a bitmap object */
LBitmapBase *plBitmapMask; | /* pointer to a bitmap object */
LBitmapBase *plBitmapUnderlay; | /* pointer to the underlay bitmap object */

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 caller object with variable opacity. The result is combined again with caller object using a constant opacity (using nOpacity). This function is available in the Raster Pro and above toolkits.

Parameter | Description
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. This applies to pBitmapSrc, pBitmapMask.
nYSrc | The Y coordinate of the origin of the source rectangle. This applies to pBitmapSrc, pBitmapMask.
pBitmapMask | Pointer to the bitmap handle that references the fade mask. This parameter can be set to NULL, in which case the combine is performed with a constant opacity (nOpacity).
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. This parameter will be used only if pBitmapUnderlay is not NULL.
plBitmapSrc | Pointer to the bitmap object that references the source bitmap.
plBitmapMask | Pointer to the bitmap object that references the fade mask. This parameter can be set to NULL, in which case the combine is performed with a constant opacity (nOpacity).
plBitmapUnderlay | Pointer to the bitmap object 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.

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 LBitmapBase::AlphaBlend function.

To combine two bitmaps with feathering, use the LBitmapBase::FeatherAlphaBlend function.

This function works as follows:

If pBitmapUnderlay is not NULL, pBitmapUnderlay is applied with an underlay operation to pBitmapMask. If present, pOffset is used to shift the starting point for the underlay pattern. If pBitmapMask is NULL, pBitmapUnderlay is not used.

If pBitmapMask is not NULL, it is used to combine pBitmapSrc with caller object using a variable opacity. If pBitmapMask is NULL, this step is skipped. (A local copy of pBitmapSrc will be used – the original bitmap passed as pBitmapSrc will not be affected).

pBitmapSrc will be combined with caller object using fixed opacity (nOpacity).

To create a bitmap that contains a fade mask, use LBitmapBase::CreateFadedMask.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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.

As an example:

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::AlphaBlend, LBitmapBase::FeatherAlphaBlend, LBitmapBase::CreateFadedMask.
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

void TestFunction(LBitmap *pBitmapSrc, LBitmap *pBitmapDst, LBitmap *pBitmapMask)
{
/* Combine BitmapSrc with BitmapDst, with fade mask bitmap and a 100 opacity*/
pBitmapDst->TextureAlphaBlend (0, 0, 100, 100,
pBitmapSrc, 100, 100, pBitmapMask, 100, NULL, NULL);
/* Free the temporary bitmaps */
pBitmapSrc->Free ();
pBitmapMask->Free ();
}


LBitmap::Tunnel

#include "ltwrappr.h"

virtual L_INT LBitmap::Tunnel( ptCenterPoint, uZValue, nDistance, uRad, nRepeat, nRotationOffset, uStretch, uStartBright, uEndBright, uBrightLength, crBright, crFill, uFlags)

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

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 LBase::EnableStatusCallback.

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.

See Also

Functions:

LBitmap::AdjustTint. LBitmap::ColorHalfTone, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Impressionist, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave

Topics:

Raster Image Functions: Doing Geometric Transformations

Raster Image Functions: Artistic Effects

Applying Artistic Effects

Using Color Values in LEADTOOLS

Raster Image Functions: Correcting Colors

Example

void TestFunction(LAnimationWindow *BitmapWindow)
{
POINT CenterPt;
CenterPt.x = BitmapWindow->GetWidth()/2;
CenterPt.y = BitmapWindow->GetHeight()/2;

BitmapWindow->Tunnel(CenterPt, 0, BitmapWindow->GetHeight(), BitmapWindow->GetWidth()/2, -1,0, 25,100,0, 2000, RGB(255,0,0), RGB(0,0,0),TUN_AXIS_WIDTH | PLANE_FILL_CLR);
}


LBitmap::UnsharpMask

#include "ltwrappr.h"

virtual L_INT LBitmap::UnsharpMask (nAmount, nRadius, nThreshold, uColorType)

L_INT nAmount; | /* adjustment factor */
L_INT nRadius; | /* radius of the mask */
L_INT nThreshold; | /* threshold value */
L_UINT uColorType; | /* flag */

Sharpens the class object's bitmap by applying the unsharp mask.

Parameter | Description
nAmount | A percentage value that represents an adjustment factor.
nRadius | Value that indicates the size of the neighborhood used for blurring each pixel of the class object's 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.
uColorType | 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.

To update a status bar or detect a user interrupt during the execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Deskew, LBitmap::DeskewExt, LBitmap::DiffuseGlow, LBitmap::GlowFilter, LBitmap::HalfTonePattern, LBitmap::HighPassFilter, LBitmap::MaskConvolution, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::MedianFilter, LBitmap::AddNoise, LBitmap::IntensityDetect, LBitmap::SpatialFilterp, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LDialogImageEffect::DoModalUnsharpMask, LBitmap::WindowLevel, LBitmap::GaussianFilter, Class Members
Topics: | Raster Image Functions: Filtering Images
 | Detecting and Enhancing Edges and Lines
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines

Example

L_INT ApplyUnsharpMask(LBitmap & Bitmap, L_TCHAR * szFileName)
{
Bitmap.Load(szFileName);
return Bitmap.UnsharpMask(200, 15, 50, RGB_SPACE);
}


LBitmap::UpdateOverlayBits

#include "ltwrappr.h"

virtual L_INT LBitmap::UpdateOverlayBits(nIndex, uFlags)

L_INT nIndex; | /* the overlay index */
L_UINT uFlags; | /* flags that determine which bits to update */

This function can update 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.

Parameter | Description
nIndex | The index of the overlay used in the process. This overlay must have a 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 use a bitwise OR ( | ) to combine SETOVERLAYBITS_FROMOVERLAY and SETOVERLAYBITS_CLEAR. Possible values are:
 | Value | Meaning
 | SETOVERLAYBITS_FROMOVERLAY | [0x0001] Update the main bitmap’s bits for corresponding plane using the data for 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 bitmap bits 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 bitmaps is only in the Medical toolkits.

If SETOVERLAYBITS_FROMOVERLAY is set, 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 uncovered by the overlay bitmap are set to 0. If SETOVERLAYBITS_CLEAR is not set, the bits uncovered 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) - nLeft

OverlayHeight = BITMAPHEIGHT(pBitmap) – nTop,

where

nLeft is the left overlay offset

nTop is the top overlay offset

BITMAPWIDTH is a macro which determines the display bitmap width, taking the ViewPerspective into account.

BITMAPHEIGHT is a macro which determines the display bitmap height, taking the ViewPerspective 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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations, Overlay Overview

Example

L_INT BurnOverlay(HWND hWnd, LBitmap *plBitmap)
{
L_INT nRet;
// Load your bitmap and set overlay.
// ..
// ..
// ..
nRet = plBitmap->UpdateOverlayBits( 0, SETOVERLAYBITS_FROMOVERLAY);
if(nRet != SUCCESS)
MessageBox(hWnd, TEXT("Error setting Overlay 0!"), TEXT("Error"), MB_OK);

return nRet;
}


LBitmap::UserFilter

#include "ltwrappr.h"

virtual L_INT LBitmap::UserFilter (pFilter);

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
pFilter | Pointer to an LPUSERFLT 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.

See Also

Functions: | LBitmap::HighPassFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmap::AddNoise, LBitmap::Sharpen, LBitmap::Posterize, LBitmap::Mosaic, LBitmap::Emboss, LBitmap::AverageFilter, LBitmap::MedianFilter, LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MinFilter, LBitmap::Oilify, LBitmap::Solarize, LBitmap::WindowLevel, LBitmap::AddShadow, LBitmap::AllocFTArray, LBitmap::ChangeHueSatIntBitmap, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DFT, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::FTDisplay, LBitmap::GetStatisticsInfo, LBitmap::GetFeretsDiameter, LBitmap::GetObjectInfo, LBitmap::GetRgnContourPoints, LBitmap::GetRgnPerimeterLength, LBitmap::MathFunction, LBitmap::RevEffect, LBitmap::Segment, LBitmap::SubtractBackground
Topics: | Raster Image Functions: Filtering Images
 | Removing Noise

Example

void TestFunction(LBitmap *pLeadBitmap)
{
/*In this example the high pass filter will be applied using user defined matrix*/
LPUSERFLT pFilter;
L_INT i, j;

/* Allocate the user filter structure. And also we need a (3x3) matrix with 9 elements. */
pFilter = (LPUSERFLT)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 */
pLeadBitmap->UserFilter (pFilter);

/* Free the filter */
free(pFilter);
}


LBitmap::Vignette

#include "ltwrappr.h"

L_INT LBitmap::Vignette(pVignetteInfo)

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
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 LBitmap::Vignette 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 LBase::EnableStatusCallback.

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: | LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::FeatherAlphaBlend, LBitmapBase::CreateFadedMask, LBitmap::TextureAlphaBlend
Topics: | Raster Image Functions: Combining Images
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

VIGNETTEINFO VignetteInfo; /* Structure which stores the required parameters*/
/*Fill the structures with the required parameters: Use an elliptical Vignette shape, perform feathering */
/* inside the vignette object, center the ellipse, use a fading color of blue*/
VignetteInfo.uStructSize = sizeof(VIGNETTEINFO);
VignetteInfo.crVigColor = RGB(0,0,255);
VignetteInfo.nFading = 50;
VignetteInfo.uFlags = VIGNETTE_ELLIPSE | VIG_FILLIN;
VignetteInfo.uFadingRate = 100;
VignetteInfo.uHeight = m_LBitmapWnd.GetHeight()/ 2;
VignetteInfo.uWidth = m_LBitmapWnd.GetWidth()/ 2;
VignetteInfo.ptCenter.x = m_LBitmapWnd.GetWidth()/ 2;
VignetteInfo.ptCenter.y = m_LBitmapWnd.GetHeight()/ 2;

LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
L_INT nRet = LeadBitmap.Vignette(&VignetteInfo);


LBitmap::Wave

#include "ltwrappr.h"

virtual L_INT LBitmap::Wave (uAmplitude, uWaveLen, nAngle, uHorzFact, uVertFact, crFill, uFlags)

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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalWave, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::RadialBlur, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->Wave(20, 25, 0, 100 , 100, 0, FILL_RPT | DIS_PER| WV_SIN);
}


LBitmap::Wind

#include "ltwrappr.h"

virtual L_INT LBitmap::Wind(uDim, nAngle, uOpacity)

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

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalWind, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::RadialBlur, LBitmap::ZoomBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
LAniWnd->Wind(40, 4500, 0);
}


LBitmap::WindowLevel

#include "ltwrappr.h"

virtual L_INT LBitmap::WindowLevel(nLowBit, nHighBit, pLUT, uLUTLength, uFlags);

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; | /* flag that indicates which functions use pLUT*/

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
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.
uFlags | Flag that indicates whether pLUT is used by the paint and image processing functions or only by the paint functions. Possible values are:
 | Value | Meaning
 | 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 LBitmap::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.

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

LTDIS
LTFIL
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: | LBitmap::WindowLevelBitmap, LPaint::PaintDC, LPaint::PaintDCBuffer, LPaint::PaintRgnDC, LPaint::PaintRgnDCBuffer, LPaintEffect::PaintRgnDCEffect, Class Members
Topics: | Raster Image Functions: Palettes
 | Raster Image Functions:Displaying and Printing
 | Grayscale Images
 | Saving Window-Leveled Bitmaps
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Processing an Image

Example

//WindowLevel
LBitmap LeadBitmap;
LeadBitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
LeadBitmap.WindowLevel(1, 5, NULL, 0, 0);


LBitmap::WindowLevelBitmap

#include "ltwrappr.h"

virtual L_INT LBitmap::WindowLevelBitmap(nLowBit, nHighBit, pLUT, uLUTLength, nOrderDst)

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
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.
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 class object's bitmap to a window leveled bitmap. To implement window leveling without affecting the image, use LBitmap::WindowLevel.

The bitmap data is changed by this function.

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

LTDIS
LTFIL
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: | LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Palettes
 | Grayscale Images
 | Saving Window-Leveled Bitmaps

Example

L_VOID MyFunctions(HWND hWnd)
{
L_UINT32 x;
L_INT nLowBit;
L_INT nHighBit;
L_UINT nLow;
L_UINT nHigh;
L_UINT32 nSize;
RGBQUAD L_HUGE* ptmp;
RGBQUAD L_HUGE* pLUT;
LBitmap LeadBitmap;

/* Change the bitmap to 16-bit grayscale */
LeadBitmap.GrayScale(16 );

LeadBitmap.GetMinMaxBits(&nLowBit, &nHighBit);
LeadBitmap.GetMinMaxVal(&nLow, &nHigh);

nSize = (L_UINT32)(1L<<(nHighBit - nLowBit + 1));
pLUT = (RGBQUAD L_HUGE*)GlobalAlloc(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


LBitmap::WindowLevelFillLUT

LBitmap::WindowLevelFillLUT (Document/Medical Imaging only)

#include "ltwrappr.h"

virtual L_INT LBitmap::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 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.
uLowBit | Value indicating the low bit used for leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
uHighBit | 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 LBitmap::GetMinMaxVal.
nMaxValue | The bitmap's maximum value. This value can be obtained by LBitmap::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.
 | The following flags indicate how the range is used to fill the LUT and whether the LUT contains signed or unsigned data:
 | 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 LBitmap::WindowLevel according to the LUT type flag.

If you select FILLLUT_LINEAR, the LUT will be filled as follows:

bInside | 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)

The nFactor parameter is used for logarithmic, exponential, 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 to use mapping, 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 the 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.

See Also

Functions: | LBitmap::WindowLevel, Class Members
Topics: | Raster Image Functions: Palettes
 | Raster Image Functions: Displaying and Printing
 | Using Color Values in LEADTOOLS
 | Grayscale Images
 | Saving Window-Leveled Bitmaps
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Processing an Image

Example

void WindowLevelFillLUTExample()
{
RGBQUAD L_HUGE* pLUT;
L_INT nRet;
L_INT nMin, nMax;
L_INT nLowBit, nHighBit;
LONG fSigned = 0 ;
LBitmap myBitmap;

LSettings::UnlockSupport(L_SUPPORT_MEDICAL, L_KEY_MEDICAL);
nRet = myBitmap.Load(TEXT("d:\\work\\images\\gray16.tif"),16);

myBitmap.GetMinMaxBits(&nLowBit, &nHighBit);
myBitmap.GetMinMaxVal(&nMin, &nMax);

/* allocate the lookup table */
pLUT = (RGBQUAD L_HUGE*)malloc(sizeof(RGBQUAD) * (1<<(nHighBit - nLowBit + 1)));

//set the FILLLUT_SIGNED flag for signed images
fSigned = FILLLUT_UNSIGNED;
if(myBitmap.IsPixelsSigned())
fSigned = FILLLUT_SIGNED;

/* fill the LUT with a color gradient */
myBitmap.WindowLevelFillLUT((RGBQUAD L_HUGE*)pLUT,
1<<(nHighBit - nLowBit + 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|
fSigned         /*
 Fill Inside range*/);

/* window level the bitmap using the new LUT */
myBitmap.WindowLevelBitmap(nLowBit,
nHighBit,
(RGBQUAD L_HUGE*)pLUT,
1<<(nHighBit - nLowBit + 1),
ORDER_BGR);

/* free the table */
free(pLUT);
return;
}


LBitmap::ZigZag

#include "ltwrappr.h"

L_INT LBitmap::ZigZag(uAmplitude, uAttenuation, uFrequency, nPhase, CenterPt, crFill, uFlags)

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
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 LBitmap::ZigZag 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 LBitmap::Ripple, LBitmap::ZoomWave and LBitmap::RadWave.

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 LBase::EnableStatusCallback.

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Impressionist, LBitmap::Polar, LBitmap::Punch, LBitmap::RadialBlur, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::ZoomWave, LBitmap::BumpMap, LBitmap::Cubism, LBitmap::DrawStar, LBitmap::Dry, LBitmap::FreePlaneBend, LBitmap::FreeRadBend, LBitmap::GlassEffect, LBitmap::GlowFilter, LBitmap::LensFlare, LBitmap::Light, LBitmap::Ocean, LBitmap::PlaneBend, LBitmap::Plane, LBitmap::SampleTarget, LBitmap::Tunnel, LBitmap::Spherize, LBitmap::MosaicTiles, LBitmap::Pointillist
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Applying Artistic Effects
 | Raster Image Functions: Artistic Effects
 | Raster Image Functions: Functions Where the Region Preempts the Bitmap

Example

/* Apply ZigZag waves from the center of the image*/
POINT CenterPt;
LBitmap LeadBitmap;
CenterPt.x = m_LBitmapWnd.GetWidth()/2;
CenterPt.y = m_LBitmapWnd.GetHeight()/2;

LeadBitmap.Load(TEXT("C:\\IMAGE4.CMP"), 0,ORDER_BGR);
LeadBitmap.ZigZag(50, 1000, 10, 0, CenterPt, 0, FILL_RPT | ZG_POND);


LBitmap::ZoomBlur

#include "ltwrappr.h"

virtual L_INT LBitmap::ZoomBlur(uDim, uStress, CenterPt)

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
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 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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalZoomBlur, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::RadialBlur, LBitmap::ZoomWave
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Filtering Images

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->ZoomBlur(50, 5, CenterPt);
}


LBitmap::ZoomWave

#include "ltwrappr.h"

virtual L_INT LBitmap::ZoomWave(uAmplitude, uFrequency, nPhase, uZomFact, CenterPt, crFill, uFlag)

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

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: | LBitmap::AddNoise, LBitmap::Emboss, LBitmap::Mosaic, LBitmap::MotionBlur, LBitmap::Oilify, LBitmap::Posterize, LBitmap::RemoveRedeye, LBitmap::Solarize, LBitmapBase::Underlay, LDialogImageEffect::DoModalZoomWave, LBitmap::Bending, LBitmap::Cylindrical, LBitmap::FreeHandShear, LBitmap::Impressionist, LBitmap::FreeHandWave, LBitmap::Pixelate, LBitmap::Polar, LBitmap::Punch, LBitmap::RadWave, LBitmap::Ripple, LBitmap::Spherize, LBitmap::Swirl, LBitmap::Wave, LBitmap::Wind, LBitmap::ZoomBlur, LBitmap::RadialBlur
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Processing an Image
 | Applying Artistic Effects
 | Using Color Values in LEADTOOLS

Example

void MyTestFunction(LAnimationWindow * LAniWnd)
{
POINT CenterPt;
CenterPt.x = (LAniWnd->GetHandle ())->Width/2;
CenterPt.y = (LAniWnd->GetHandle ())->Height/2;

LAniWnd->ZoomWave(20 , 10 , 0 , 0, CenterPt, 0 , FILL_RPT);
}


LBitmapBase::LBitmapBase

#include "ltwrappr.h"

L_VOID LBitmapBase::LBitmapBase(void)

L_VOID LBitmapBase::LBitmapBase(uWidth, uHeight, uBitsPerPixel=24, uOrder=ORDER_BGRORGRAY, pPalette=NULL, uViewPerspective=TOP_LEFT, crFill=0, uMemory=TYPE_CONV, pData=NULL, dwSize=0)

L_VOID LBitmapBase::LBitmapBase(pInfo, pBits)

L_VOID LBitmapBase::LBitmapBase(hDC, hBitmap, hPalette)

L_VOID LBitmapBase::LBitmapBase(pBitmapHandle)

L_UINT uWidth; | /* initial bitmap width */
L_UINT uHeight; | /* initial bitmap height */
L_UINT uBitsPerPixel; | /* The number of bits per pixel */
L_UINT uOrder; | /* color order */
LPRGBQUAD pPalette; | /* pointer to a palette*/
L_UINT uViewPerspective; | /* bitmap’s view perspective */
COLORREF crFill; | /* fill color value*/
L_UINT uMemory; | /* type of memory */
BITMAPINFO L_FAR * pInfo; | /* pointer to a bitmap info structure */
L_UCHAR L_FAR * pBits; | /* pointer to the bitmap data */
HDC hDC; | /* handle to a windows DC */
HBITMAP hBitmap; | /* handle to a device dependent bitmap */
HPALETTE hPalette; | /* handle of the palette */
pBITMAPHANDLE pBitmapHandle; | /* pointer to a LEAD bitmap handle */
L_CHAR L_FAR *pData; | /* data pointer */
L_UINT32 dwSize; | /* size of the data buffer pointed to by pData */

Constructs and initializes the member variables of the class object.

Parameter | Description
uWidth | The desired initial bitmap width.
uHeight | The desired initial bitmap height.
uBitsPerPixel | The number of bits per pixel. Valid values are 0, 1, 4, 8, 12, 16, 24, and 32. Use 0 to create an 8-bit grayscale bitmap. If uBitsPerPixel is 0, the function ignores the uOrder and pPalette parameters.
uOrder | Color order for 16-, 24-, and 32-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
pPalette | Pointer to the palette that the bitmap will use. You can specify your own palette, or use NULL to use LEAD's fixed palette.
uViewPerspective | The desired view perspective for the bitmap. Possible values are:
 | Value | Meaning
 | TOP_LEFT | [0] Top-left of image is first in memory.
 | BOTTOM_LEFT | [2] Bottom-left of image is first in memory.
 | 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_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.
crFill | The color value to use to fill the bitmap after creating it.

uMemory | Flag that indicates the type of memory to allocate. Possible values are:
 | Value | Meaning
 | TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk.
 | 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 only for 1-bit, 8-bit grayscale and 24-bit images.
pInfo | Pointer to a BITMAPINFO structure that describes the bitmap data.
pBits | Pointer to the bitmap data to be used in initializing the bitmap.
hDC | Handle to a windows DC.
hBitmap | Handle to a device dependent bitmap (DDB) of type HBITMAP.
hPalette | Handle of the palette to be used for the bitmap or NULL if the bitmap does not have a palette.
pBitmapHandle | Pointer to a LEAD bitmap handle that describes an allocated bitmap.
pData | Data pointer that will contain the bitmap data when uMemory is TYPE_USER. If pData is NULL, the data pointer must be passed later, by calling LBitmapBase::SetDataPointer, 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

None

Comments

These are the constructors for the LBitmapBase class. They construct and initialize the member variables of the class object.

LBitmapBase::LBitmapBase(void) will initialize the bitmap width, height, and bits per pixel to 0.

LBitmapBase::LBitmapBase(uWidth, uHeight, uBitsPerPixel, uOrder, pPalette, uViewPerspective, crFill, uMemory) constructs an LBitmapBase object and allocates a bitmap with the desired width, height, bits per pixel, color order, view perspective and memory type. You can check for successful allocation by calling the LBitmapBase::IsAllocated() member function. Even if the allocation fails, the class object is still constructed.

LBitmapBase::LBitmapBase(pInfo, pBits) constructs an LBitmapBase object and allocates a bitmap using the passed bitmap info and data (DIB). You can check for successful allocation by calling the LBitmapBase::IsAllocated() member function. Even if the allocation fails, the class object is still constructed.

LBitmapBase::LBitmapBase(hDC, hBitmap, hPalette) constructs an LBitmapBase object and allocates a bitmap using the passed hBitmap (DDB). You can check for successful allocation by calling the LBitmapBase::IsAllocated() member function. Even if the allocation fails, the class object is still constructed.

LBitmapBase::LBitmapBase(pBitmapHandle) constructs an LBitmapBase object and allocates a bitmap from another LEAD bitmap handle. You can check for successful allocation by calling the LBitmapBase::IsAllocated() member function. Even if the allocation fails, the class object is still constructed.

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.

See Also

Elements: | LBitmapBase::~LBitmapBase, LBitmapBase::IsAllocated, Class Members
Topics: | Using Color Values in LEADTOOLS

Example

/*This is the example for LBitmapBase::LBitmapBase():*/

// this will call the default constructor and destructor when it is out of scope
LBitmapBase MyBitmap;

/*This is the example for LBitmapBase::LBitmapBase(uWidth, uHeight, uBitsPerPixel, uOrde, pPalette, uViewPerspective, crFill, uMemory, pData, dwSize):*/

LBitmapBase MyBitmap(100, 200, 24, ORDER_BGR, NULL, TOP_LEFT, 0, TYPE_CONV);
if(MyBitmap.IsAllocated())
// Do something….

/*This is the example for LBitmapBase::LBitmapBase(pInfo, pBits):*/

L_VOID MyFunction()
{
LBitmapBase TmpBitmap;
HGLOBAL hDIB;
BITMAPINFO L_FAR *pInfo;
L_UCHAR L_FAR *pBits;
L_INT nColorData;

// Load a bitmap at 8 bits per pixel so that we can demonstrate palette handling
TmpBitmap.Load (TEXT("image3.cmp"), 8, ORDER_BGR);
hDIB = TmpBitmap.ConvertToDIB(DIB_BITMAPV5HEADER);

pInfo = (BITMAPINFO L_FAR *) GlobalLock( hDIB );
if(pInfo->bmiHeader.biBitCount <= 8)
nColorData = 1 << pInfo->bmiHeader.biBitCount;
else
nColorData = 0;

pBits = (L_UCHAR L_FAR *) pInfo + sizeof(BITMAPINFOHEADER) + (nColorData * sizeof(RGBQUAD));

LBitmapBase MyBitmap(pInfo, pBits);

GlobalUnlock(hDIB) ;
 GlobalFree(hDIB);
TmpBitmap.Free();
}

/*This is the example for LBitmapBase::LBitmapBase(hDC, hBitmap, hPalette):*/

L_VOID TestFunc(HINSTANCE hAppInstance)
{
HBITMAP hBitmap=LoadBitmap(hAppInstance,TEXT("Bitmap1"));
HDC hDC=GetDC(0);
LBitmapBase MyBitmap(hDC, hBitmap, 0);
ReleaseDC(0,hDC);
}

/*This is the example for LBitmapBase::LBitmapBase(pBitmapHandle):*/

BITMAPHANDLE hBitmap;
L_LOADBITMAP(TEXT("image1.cmp"), &hBitmap,sizeof(hBitmap), 0, ORDER_RGB,NULL,NULL);
LBitmapBase MyBitmap(&hBitmap);


LBitmapBase::~LBitmapBase

#include "ltwrappr.h"

virtual L_VOID LBitmapBase::~LBitmapBase(void)

Destroys the class object and frees any allocated variables and memory associated with the object.

Returns

None

Comments

This is the destructor for the LBitmapBase class. It destroys the class object and frees any allocated variables and memory associated with the object.

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.

See Also

Elements:

LBitmapBase::LBitmapBase, Class Members

Example

// this will call the default constructor and destructor when it is out of scope
LBitmapBase MyBitmap;


LBitmapBase::Access

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Access(void)

Provides exclusive access to the image data contained in a class object’s bitmap handle.

Returns

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

Comments

This call locks the memory. 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 LBitmapBase::Release to unlock the bitmap data, for more efficient use of Windows memory resources.

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.

See Also

Elements: | LBitmapBase::Release, LBitmapBase::ChangeHeight, LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::PutRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For an example, refer to LBitmapBase::GetRow.


LBitmapBase::Allocate

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Allocate(nMemoryType=TYPE_CONV)

L_INT nMemoryType;

/* type of memory */

Allocates memory for the bitmap data.

Parameter | Description
nMemoryType | The type of memory to be used when allocating memory for the bitmap data. Possible 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. This flag can be used 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 only for 1-bit, 8-bit grayscale and 24-bit images.

Returns

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

Comments

The amount of memory allocated depends on the size of the image indicated in the internal bitmap handle (Width, Height, and BitsPerPixel). LBitmapBase::Initialize 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 LBitmapBase::Initialize. Normally, the functions that load or create a bitmap allocate the required memory for you. (In that case, calling Allocate() causes your application to lose memory.)

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.

See Also

Functions: | LBitmapBase::Free, LBitmapBase::Create, LBitmapBase::Initialize, Class Members
Topics: | Raster Image Functions: Creating and Deleting Images

Example

LBitmapBase MyBitmap;

MyBitmap.Initialize(100,200,24);
MyBitmap.Allocate(TYPE_CONV);

if(MyBitmap.IsAllocated())
MyBitmap.Free();


LBitmapBase::AlphaBlend

#include "ltwrappr.h"

virtual L_INT LBitmapBase::AlphaBlend (nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, nOpacity)

L_INT nXDst; | /* x coordinate */
L_INT nYDst; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
LBitmapBase *pBitmapSrc; | /* pointer to an LBitmapBase object */
L_INT nXSrc; | /* x coordinate */
L_INT nYSrc; | /* y coordinate */
L_INT nOpacity; | /* opacity value */

Combines image data of both the class object's bitmap and the specified bitmap, using the specified opacity value. The class object's bitmap is considered as the destination bitmap and it will be updated with the result of the operation. The specified bitmap is considered as the source bitmap.

Parameter | Description
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 LBitmapBase that contains 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 LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::FeatherAlphaBlend, LBitmapBase::CreateFadedMask
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmapBase & Bitmap, L_TCHAR * szFile1,
L_TCHAR * szFile2)
{
LBitmapBase BitmapSrc;

Bitmap.Load(szFile1);
BitmapSrc.Load(szFile2);

BitmapSrc.Size(2 * Bitmap.GetWidth() / 3,
2 * Bitmap.GetHeight() / 3,
SIZE_RESAMPLE);

Bitmap.AlphaBlend(Bitmap.GetWidth() / 6,
Bitmap.GetHeight() / 6,
BitmapSrc.GetWidth(),
BitmapSrc.GetHeight(),
&BitmapSrc,
0,
0,
150);
}


LBitmapBase::ChangeCompression

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ChangeCompression(nComp)

L_INT nComp;

/* compression type */

Compresses or decompresses a bitmap. This function is available only in Document/Medical toolkits.

Parameter | Description
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 LBitmapBase::Allocate.
 | 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.

Required DLLs and Libraries

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

See Also

Functions: | LBitmapBase::Allocate, LBitmapBase::Create, LBitmapBase::IsSuperCompressed, Class Members
Topics: | Super Compressed Bitmaps Speeding up 1-Bit Documents Raster Image Functions: Compression Functions

Example

L_VOID ToggleCompression(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
L_TCHAR szMessage[256];

Bitmap.Load(pszFile);

if (Bitmap.GetBitsPerPixel() == 1 || Bitmap.GetBitsPerPixel() == 24)
{
wsprintf(szMessage, TEXT("BEFORE:\nImage Size: %ld bytes\nType: %s"),
Bitmap.GetMemSize(),
Bitmap.IsSuperCompressed() ?
TEXT("Super Compressed") : TEXT("Uncompressed"));

MessageBox(NULL, szMessage, TEXT("Changing Compression"), MB_OK);

if (Bitmap.ChangeCompression(Bitmap.IsSuperCompressed() ?
COMP_NONE : COMP_SUPER) == SUCCESS)
wsprintf(szMessage,
TEXT("AFTER:\nImage Size: %ld bytes\nType: %s"),
Bitmap.GetMemSize(),
Bitmap.IsSuperCompressed() ?
TEXT("Super Compressed") : TEXT("Uncompressed"));
else
wsprintf(szMessage, TEXT("Change Compressions Failed!"));

MessageBox(NULL, szMessage, TEXT("Changing Compression"), MB_OK);
}
}


LBitmapBase::ChangeHeight

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ChangeHeight(nHeight)

L_INT nHeight;

/* the new height of the bitmap */

Changes the height of the bitmap.

Parameter | Description
nHeight | The new height of the bitmap.

Returns

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

Comments

Call this function to change the height of the 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.

See Also

Elements: | LBitmapBase::Access, LBitmapBase::Allocate, LBitmapBase::Release, LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::PutRowColCompressed
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("Image1.cmp"));
MyBitmap.Load();

if(MyBitmap.IsAllocated())
{
MyBitmap.Access(); //add 50 lines to the image
MyBitmap.ChangeHeight(MyBitmap.GetHeight()+50);
MyBitmap.Release();
}


LBitmapBase::ChangeViewPerspective

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ChangeViewPerspective(nViewPerspective)

virtual L_INT LBitmapBase::ChangeViewPerspective(LBitmapSrc, nViewPerspective)

L_INT nViewPerspective; | /* desired view perspective*/
LBitmapBase& LBitmapSrc; | /* the source bitmap object*/

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
nViewPerspective | Desired view perspective. Possible values are:
 | Constant | Meaning
 | TOP_LEFT | [1] Top-left of image is first in memory.
 | BOTTOM_LEFT180 | [2] (Document/Medical only) Same as TOP_RIGHT, which is BOTTOM_LEFT rotated clockwise by 180 degrees.
 | BOTTOM_LEFT | [4] 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 | [6] (Document/Medical only) First row is the right side, first column is top side.
 | TOP_LEFT90 | [6] (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.
LBitmapSrc | The source bitmap object.

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.

Note:

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::RotateViewPerspective, LBitmapBase::GetViewPerspective, Class Members
Topics: | Accounting for View Perspective

Example

This is the example for LBitmapBase::ChangeViewPerspective(LBitmapSrc, nViewPerspective):

LBitmapBase MyBitmap,Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
if(MyBitmap.IsAllocated())
Bitmap2.ChangeViewPerspective(MyBitmap, BOTTOM_LEFT);

This is the example for LBitmapBase::ChangeViewPerspective(nViewPerspective):

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
if(MyBitmap.IsAllocated())
MyBitmap.ChangeViewPerspective(BOTTOM_LEFT);


LBitmapBase::Clear

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Clear(void)

Sets all bits to 0 in the specified bitmap, making it a black bitmap.

Returns

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

Comments

Call this function to clear the bitmap data, this will fill the bitmap data with zeros.

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.

See Also

Elements: | LBitmapBase::Fill, LBitmapBase::ClearNegativePixels, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("Image1.cmp"));
MyBitmap.Load();

MyBitmap.Clear();


LBitmapBase::ClearNegativePixels

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ClearNegativePixels(void)

Sets all of the class object's bitmap pixels with negative color values to 0.

Returns

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

Comments

If ELO_SIGNED flag has been set using LOADFILEOPTION, before 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 LBitmapBase::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 LBitmapBase::ClearNegativePixels if, after loading a bitmap, LBitmapBase::IsPixelsSigned returns TRUE.

LBitmapBase::ClearNegativePixels does nothing if LBitmapBase::IsPixelsSigned returns FALSE.

PROGRAMMING TIP: Call LBitmapBase::ClearNegativePixels right after LBitmapBase::Load or LFile::LoadBitmap.

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.

See Also

Elements: | LBitmapBase::IsPixelsSigned, LBitmapBase::Clear, LBitmapBase::Load, LFile::LoadBitmap, Class Members
Topics | Raster Image Functions: Getting and Setting Pixel Values

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

if(MyBitmap.IsPixelsSigned())
MyBitmap.ClearNegativePixels();


LBitmapBase::ColorRes

#include "ltwrappr.h"

virtual L_INT
 LBitmapBase::ColorRes(nBitsPerPixel,
 uFlags=CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING, pPalette=NULL, hPalette=NULL,
 uColors=0)

virtual L_INT LBitmapBase::ColorRes(BitmapSrc, nBitsPerPixel, uFlags=CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING, pPalette=NULL, hPalette=NULL, uColors=0)

L_UINT nBitsPerPixel; | /* the number of bits per pixel */
L_UINT32 uFlags; | /* flag that indicates the processing options */
LPRGBQUAD pPalette; | /* custom palette */
HPALETTE hPalette; | /* custom palette handle to use */
L_UINT uColors; | /* number of colors in the palette */
LBitmapBase& BitmapSrc; | /* the source bitmap */

Converts a class object’s bitmap from any bits-per-pixel to any bits-per-pixel.

Parameter | Description
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 ( | ). Possible values are:
 | 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 parameter, 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.
 | CRF_IDENTITYPALETTE | [0x08] Insert the Windows system palette.
 | CRF_FASTMATCHPALETTE | [0x20] Use a predefined table to speed conversion using your own palette. Refer to LBitmapSettings::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 toolkits.
 | 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.
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 palettein 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.
BitmapSrc | The source bitmap on which the conversion will be done.

Returns

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

Comments

Call this function to do a color resolution on the source class object's bitmap and place the result in the calling object's bitmap. Note that if the callback functions are enabled, then the LBitmapBase::ColorResBitmapCallBack function of the calling object will be called for the color resolution operation.

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 LBitmapSettings::CreateUserMatchTable.

Note:

The BitmapSrc parameter is passed by reference, and is a required parameter.

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

Elements: | LBitmapBase::ColorResBitmapCallBack, LBase::EnableCallBack, LBase::IsCallBackEnabled, Class Members
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

This example is for LBitmapBase::ColorRes(BitmapSrc, nBitsPerPixel, uFlags, pPalette, hPalette, uColors):

LBitmapBase MyBitmap,Bitmap2;
MyBitmap.Load(TEXT("image1.cmp"),24);

Bitmap2.ColorRes(MyBitmap, 8,CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING);

This example is for LBitmapBase::ColorRes(nBitsPerPixel, uFlags, pPalette, hPalette, uColors):

LBitmapBase MyBitmap;
MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.ColorRes(8,CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING);


LBitmapBase::ColorResBitmapCallBack

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ColorResBitmapCallBack(pBitmap, pBuffer, nLines)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_UCHAR L_FAR * pBuffer; | /* pointer to the buffer that contains the processed bitmap data */
L_INT nLines; | /* number of lines in the buffer */

Handles the converted image data that the LBitmapBase::ColorRes 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.

Returns

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

Comments

This function is called for the color resolution operation only if the callback functions are enabled. You can override this function to do your own processing. If you return an error code then the operation will be terminated. This function will be called only if you enabled the callback functions using LBase::EnableCallBack(TRUE).

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.

See Also

Elements:

LBitmapBase::ColorRes, LBase::EnableCallBack, LBase::IsCallBackEnabled, Class Members

Example

class MyBitmap : public LBitmapBase
{
protected:
virtual L_INT ColorResBitmapCallBack (pBITMAPHANDLE pBitmap, L_UCHAR L_FAR * pBuffer, L_INT nLines);

};

L_INT MyBitmap::ColorResBitmapCallBack(pBITMAPHANDLE pBitmap, L_UCHAR L_FAR * pBuffer, L_INT nLines)
{
::MessageBox(0,TEXT("Color Res"),TEXT("Color Res"),MB_OK);
return(SUCCESS);
}

L_VOID TestFunction()
{
MyBitmap Bitmap ;
Bitmap.Load(TEXT("image1.cmp"),24);
if(Bitmap.IsCallBackEnabled()==FALSE)
Bitmap.EnableCallBack(TRUE);
Bitmap.ColorRes(8,CRF_FIXEDPALETTE|CRF_FLOYDSTEINDITHERING); //this will call ColorResCallBack()
}


LBitmapBase::Combine

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Combine(pLBitmapSrc, nWidth, nHeight, nXDst=0, nYDst=0, nXSrc=0, nYSrc=0, uFlags= CB_OP_ADD|CB_DST_0)

LBitmapBase L_FAR * pLBitmapSrc; | /* pointer to the source bitmap handle */
L_INT nWidth; | /* width of the destination rectangle */
L_INT nHeight; | /* height of the destination rectangle */
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 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; | /* flag that indicates the operations to perform */

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
pLBitmapSrc | Pointer to the source bitmap handle to be combined with the current bitmap object.
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.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
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 LBitmapBase::CombineBitmap Function for the list of flags.

Returns

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

Comments

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 LBase::EnableStatusCallBack.

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

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.

See Also

Elements: | LBitmap::DiffuseGlow, LBitmap::MaskConvolution, LBitmap::HighPassFilter, LBitmap::UnsharpMask, LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Copying Images
 | Processing an Image
 | Removing Noise
 | Detecting and Enhancing Edges and Lines
 | Implementing Transparency
 | Raster Image Functions: Removing Noise
 | Raster Image Functions: Detecting and Enhancing Edges and Lines
 | 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. */
LBitmapBase LeadBitmap; /* Bitmap handle to hold the loaded image */
LBitmapBase 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 */
LeadBitmap.Load (TEXT("IMAGE3.CMP"));
TmpBitmap.Load(TEXT("ULAY4.BMP"));

/* Specify a position in the top left part of the displayed image */
XDst = LeadBitmap.GetWidth();
YDst = LeadBitmap.GetHeight() / 8;
/* Use the full size of the source bitmap */
YSize = TmpBitmap.GetWidth();
XSize = TmpBitmap.GetHeight();
XSrc = 0;
YSrc = 0;
/* Combine TmpBitmap with LeadBitmap, using flags for an ordinary paste */
LeadBitmap.Combine(&TmpBitmap, XSize, YSize, XDst, YDst, XSrc, YSrc, CB_OP_ADD | CB_DST_0);


LBitmapBase::CombineBitmapWarp

#include "ltwrappr.h"

virtual HMETAFILE LBitmapBase::CombineBitmapWarp (ptDstArray, pBitmapSrc, ptSrc, nSrcWidth, nSrcHeight, uFlags)

POINT ptDstArray; | /* array of points */
LBitmapBase * pBitmapSrc; | /* pointer to the source bitmap object */
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
ptDstArray | An array of POINT structures that contain the four points that define the warp area in the destination bitmap.
pBitmapSrc | Pointer to the bitmap object 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, or 24-, 32-, 48-, or 64-bit.

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.

See Also

Functions: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

void TestFunction(LBitmap *pMaster,LBitmap *pSlave)
{
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
pMaster->Load(TEXT("d:\\temp\\golf.jpg"), 24, ORDER_BGR, NULL, NULL);
pSlave->Load(TEXT("d:\\temp\\golf2.jpg"), 24, ORDER_BGR, NULL, NULL);

nRet = pMaster->CombineBitmapWarp(aptsDest,
pSlave,
ptSrc,
pSlave->GetWidth(), pSlave->GetHeight(),
CBW_BILINEAR);

pMaster->Save(TEXT("d:\\temp\\output.jpg"), FILE_JPEG, 0, 2, 0, NULL);
pMaster->Free();
pSlave->Free();
}


LBitmapBase::CombineExt

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CombineExt(pBitmapSrc, nWidth, nHeight, nXDst, nYDst, nXSrc, nYSrc, uFlag)

LBitmapBase * pBitmapSrc; | /* pointer to an LBitmapBase object */
L_INT nWidth; | /* width of the rectangle, measured in pixels */
L_INT nHeight; | /* height of the rectangle, measured in pixels */
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 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 the image data of both the class object’s bitmap (the destination bitmap) and the specified bitmap (the source bitmap), 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. The class object’s bitmap is updated with the result of this operation.

Parameter | Description
pBitmapSrc | Pointer to an LBitmapBase object that contains the source bitmap, which is combined with the class object's bitmap.
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.
nXDst | The X coordinate of the origin of the destination rectangle.
nYDst | The Y coordinate of the origin of the destination rectangle.
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 LBitmapBase::CombineExt 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 LBitmap::SpatialFilter 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 LBase::EnableStatusCallback.

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
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmapBase::Underlay, LBitmapBase::Combine, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmapBase & Bitmap, L_TCHAR * pszFile1,
L_TCHAR * pszFile2)
{
LBitmapBase BitmapSrc;

Bitmap.Load(pszFile1, 24, ORDER_BGR);
BitmapSrc.Load(pszFile2, 8, ORDER_BGR);

BitmapSrc.Size(2 * Bitmap.GetWidth() / 3,
2 * Bitmap.GetHeight() / 3,
SIZE_RESAMPLE);

Bitmap.CombineExt(&BitmapSrc,
BitmapSrc.GetWidth(),
BitmapSrc.GetHeight(),
Bitmap.GetWidth() / 6,
Bitmap.GetHeight() / 6,
0,
0,
CB_OP_ADD | CB_DST_0 |CB_SRC_RED|CB_DST_GREEN |
CB_RES_BLUE);
}


LBitmapBase::ConvertFromDDB

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ConvertFromDDB(hDC, hBitmap, hPalette)

HDC hDC; | /* handle to the device responsible for the conversion*/
HBITMAP hBitmap; | /* handle to the DDB to be converted*/
HPALETTE hPalette; | /* handle to the palette */

Converts a Windows device dependent bitmap (DDB) into an LBitmapBase object’s 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.
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 LBitmapBase object’s 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.

See Also

Elements: | LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDIB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to LBitmapBase::ConvertToDDB.


LBitmapBase::ConvertFromDIB

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ConvertFromDIB(pInfo, pBits)

BITMAPINFO L_FAR * pInfo; | /* pointer to the Windows BITMAPINFO structure*/
L_UCHAR L_FAR * pBits; | /* pointer to the DIB image data*/

Converts a Windows device independent bitmap (DIB) into an LBitmapBase object. 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
pInfo | Pointer to the Windows BITMAPINFO structure.
pBits | Pointer to a buffer containing 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.

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

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.

See Also

Elements: | LBitmapBase::ConvertToDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertFromDDB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

/* This example loads a bitmap, converts it to a DIB, then converts the DIB back to a bitmap */
LBitmapBase LeadBitmap;

void TestFunction(HWND hWnd)
{
LBitmapBase TmpBitmap;
HGLOBAL hDIB;
BITMAPINFO L_FAR * pInfo;
L_UCHAR L_FAR * pBits;
L_INT nColorData;

/* Load a bitmap at 8 bits per pixel so that we can demonstrate palette handling */
TmpBitmap.Load (TEXT("image3.cmp"), 8, ORDER_BGR);
hDIB = TmpBitmap.ConvertToDIB(DIB_BITMAPV5HEADER);
pInfo = (BITMAPINFO L_FAR *) GlobalLock( hDIB );
if(pInfo->bmiHeader.biBitCount <= 8)
nColorData = 1 << pInfo->bmiHeader.biBitCount;
else
nColorData = 0;

pBits = (L_UCHAR L_FAR *) pInfo + sizeof(BITMAPINFOHEADER) + (nColorData * sizeof(RGBQUAD));

LeadBitmap.ConvertFromDIB(pInfo, pBits);
GlobalUnlock(hDIB);
GlobalFree(hDIB);
TmpBitmap.Free();
}


LBitmapBase::ConvertFromEMF

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ConvertFromEMF(hWmf, uWidth, uHeight)

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

See Also

Functions: | Class Members, LChange::ChangeFromEMF, LChange::ChangeFromWMF, LChange::ChangeToEMF, LChange::ChangeToWMF, LBitmapBase::ConvertFromWMF, LBitmapBase::ConvertToWMF, LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Creating and Deleting Images

Example

/* This example loads a bitmap, converts it to a EMF, then converts
the EMF back to a bitmap
*/
void ConvertEMFToLead(LBitmap *pLeadBitmap)
{
LBitmap Bitmap; /* Bitmap handle for the initial image */
HENHMETAFILE hEMF;

/* Load a bitmap, keeping its own bits per pixel */
Bitmap.Load(TEXT("image3.cmp"), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a EMF */
hEMF = Bitmap.ConvertToEMF();

/* Free the initial bitmap */
Bitmap.Free();

/* Convert the EMF to create a new LEAD bitmap and preserve the size */
pLeadBitmap->ConvertFromEMF(hEMF, 0, 0);

/* Clean up */
DeleteEnhMetaFile(hEMF);
}


LBitmapBase::ConvertFromWMF

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ConvertFromWMF(hWMF, uWidth, uHeight)

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

See Also

Functions: | Class Members, LChange::ChangeFromEMF, LChange::ChangeFromWMF,
 | LChange::ChangeToEMF, LChange::ChangeToWMF,
 | LBitmapBase::ConvertFromEMF, LBitmapBase::ConvertToWMF,
 | LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

/* This example loads a bitmap, converts it to a WMF, then converts
the WMF back to a bitmap
*/

void ConvertWMFToLead(HWND hWnd, LBitmap* pLeadBitmap)
{
LBitmap Bitmap; /* Bitmap handle for the initial image */
HMETAFILE hWmf;

/* Load a bitmap, keeping its own bits per pixel */
Bitmap.Load(TEXT("image3.cmp"), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a WMF */
hWmf = Bitmap.ConvertToWMF( );

/* Free the initial bitmap */
Bitmap.Free();

/* Convert the WMF to create a new LEAD bitmap and preserve the size */
pLeadBitmap->ConvertFromWMF(hWmf, 0, 0);

/* Clean up */
DeleteMetaFile(hWmf);
}


LBitmapBase::ConvertSignedToUnsigned

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ConvertSignedToUnsigned(uShift)

L_UINT uShift;

/* shifting option */

Converts the signed class object's bitmap to an unsigned one.

Parameter | Description
uShift | Flag that indicates how the shift will be done. Possible values are:
 | Value | Meaning
 | SHIFT_ZERO_TO_CENTER | [0] Shift by 32768 (16-bit images) or by 2048 (12-bit images)
 | SHIFT_MIN_TO_ZERO | [1] 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 | [2] Set all the negative pixels to 0 and leave the positive pixels unchanged. (Achieves the same result as LBitmapBase::ClearNegativePixels).

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 LBitmapBase::IsPixelsSigned returns TRUE).

If LBitmapBase::IsPixelsSigned returns TRUE, this function will shift the color values in the class object's bitmap according to the uShift parameter.

The function will also update the MinVal and MaxVal members of the BITMAPHANDLE.

This function supersedes LBitmapBase::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.

See Also

Functions: | LBitmapBase::ClearNegativePixels, Class Members
Topics: | Processing an Image
 | Raster Image Functions: Getting and Setting Pixel Values

Example

L_VOID TestFunction(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
LOADFILEOPTION LoadFileOption;

// Enable negative pixels
LBaseFile::GetDefaultLoadFileOption(&LoadFileOption,sizeof(LOADFILEOPTION));
LoadFileOption.Flags |= ELO_SIGNED;

Bitmap.Load(pszFile, 0, ORDER_BGRORGRAY, &LoadFileOption);

// Clear negative pixels if the bitmap is signed
if (Bitmap.IsPixelsSigned())
Bitmap.ConvertSignedToUnsigned(SHIFT_NEG_TO_ZERO);
}


LBitmapBase::ConvertToDDB

#include "ltwrappr.h"

virtual HBITMAP LBitmapBase::ConvertToDDB(hDC)

HDC hDC;

/* handle to the device responsible for the conversion */

Converts an LBitmapBase object’s 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.

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 LBitmapBase object’s bitmap to the DDB. When you no longer need the DIB, you can free it using the Windows DeleteObject function.

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.

See Also

Elements: | LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDIB, LBitmapBase::ConvertFromDDB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

LBitmapBase MyBitmap,Bitmap2;
HDC hDC=GetDC(0);
HBITMAP hBitmap;

MyBitmap.Load(TEXT("image1.cmp"));
hBitmap=MyBitmap.ConvertToDDB(hDC);
Bitmap2.ConvertFromDDB(hDC, hBitmap, 0);

ReleaseDC(0,hDC);


LBitmapBase::ConvertToDIB

#include "ltwrappr.h

virtual HGLOBAL LBitmapBase::ConvertToDIB(uType)

L_UINT uType;

/* type of DIB */

Converts an LBitmapBase object’s 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
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

This function will return a handle to a DIB.

Comments

Call this function to get a device independent bitmap (DIB) copy from class object's bitmap.

When you no longer need the DIB, you can free it using the Windows GlobalFree function.

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.

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.

See Also

Elements: | LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertFromDDB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

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(LBitmapBase * pBitmap, L_TCHAR *pszFileName)
{
HGLOBAL hDIB;
hDIB = pBitmap->ConvertToDIB(DIB_BITMAPV5HEADER);
MySaveFile(hDIB, TEXT("e:\\erase\\dib3.bmp"));
GlobalFree(hDIB);
}


LBitmapBase::ConvertToEMF

#include "ltwrappr.h"

virtual HENHMETAFILE LBitmapBase::ConvertToEMF()

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.

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.

See Also

Functions: | Class Members, LChange::ChangeFromEMF, LChange::ChangeFromWMF,
 | LChange::ChangeToEMF, LChange::ChangeToWMF,
 | LBitmapBase::ConvertFromWMF, LBitmapBase::ConvertToWMF,
 | LBitmapBase::ConvertFromEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

For an example, refer to LBitmapBase::ConvertFromEMF


LBitmapBase::ConvertToWMF

#include "ltwrappr.h"

virtual HMETAFILE LBitmapBase::ConvertToWMF()

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.

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.

See Also

Functions: | Class Members, LChange::ChangeFromEMF, LChange::ChangeFromWMF,
 | LChange::ChangeToEMF, LChange::ChangeToWMF,
 | LBitmapBase::ConvertFromWMF, LBitmapBase::ConvertFromEMF,
 | LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

For an example, refer to LBitmapBase::ConvertFromWMF.


LBitmapBase::Copy

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Copy(LBitmapSrc)

LBitmapBase& LBitmapSrc;

/* the source bitmap object to be copied */

Copies a bitmap object.

Parameter | Description
LBitmapSrc | The source bitmap object to be copied.

Returns

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

Comments

Call this function to copy a bitmap object. This will copy the bitmap handle and data, all the other settings will not be changed.

Note:

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::CopyData, LBitmapBase::CopyHandle, LBitmapBase::CopyRect, Class Members
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

LBitmapBase MyBitmap, CopyBitmap;
MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

CopyBitmap.Copy(MyBitmap); //make a copy of the bitmap


LBitmapBase::CopyData

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CopyData(LBitmapSrc)

LBitmapBase& LBitmapSrc;

/* the source class object */

Copies the bitmap data of a class object.

Parameter | Description
LBitmapSrc | The source class object from which to copy the bitmap data.

Returns

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

Comments

The bitmap handle and all the other settings will not be changed.

Note:

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::Copy, LBitmapBase::CopyHandle, LBitmapBase::CopyRect, Class Members
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

LBitmapBase MyBitmap, Bitmap2;

MyBitmap.Load(TEXT("image1.cmp"),24);
Bitmap2.CopyHandle(MyBitmap);
Bitmap2.CopyData(MyBitmap);


LBitmapBase::CopyFromClipboard

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CopyFromClipboard(hWnd)

HWND hWnd;

/* handle to the active window. */

Copies image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB, DDB, or a WMF.

Parameter | Description
hWnd | Handle to the active window.

Returns

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

Comments

The LBitmapBase object’s 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 LBitmapBase::ColorRes.

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.

See Also

Elements: | LBitmapBase::IsClipboardReady, LBitmapBase::CopyToClipboard, Class Members
Topics: | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction(LBitmapBase& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsClipboardReady())
MyBitmap.CopyFromClipboard(hWnd);
}


LBitmapBase::CopyHandle

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CopyHandle(LBitmapSrc)

LBitmapBase& LBitmapSrc;

/* the source class object */

Copies the bitmap handle of a class object.

Parameter | Description
LBitmapSrc | The source class object from which to copy the bitmap handle.

Returns

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

Comments

The bitmap data and all the other settings will not be changed.

Note:

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::Copy, LBitmapBase::CopyData, LBitmapBase::CopyRect, Class Members
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

For an example, refer to LBitmapBase::CopyData.


LBitmapBase::CopyRect

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CopyRect(LBitmapSrc, nCol, nRow, uWidth, uHeight)

virtual L_INT LBitmapBase::CopyRect(LBitmapSrc, rect)

LBitmapBase& LBitmapSrc; | /* the source class object */
L_INT nCol; | /* the first column */
L_INT nRow; | /* the first row */
L_UINT uWidth; | /* the width of the rectangle to copy */
L_UINT uHeight; | /* the height of the rectangle to copy */
RECT& rect; | /* the rectangle to be copied */

Copies a rectangle from the source class object's bitmap.

Parameter | Description
LBitmapSrc | The source class object from which to copy the bitmap rectangle.
nCol | The first column of the source rectangle.
nRow | The first row of the source rectangle.
uWidth | The width of the rectangle to copy.
uHeight | The height of the rectangle to copy.
rect | The rectangle to be copied.

Returns

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

Comments

Call this function to copy a rectangle from the source class object's bitmap.

Call this function to copy a bitmap rectangle from the source object and create a new bitmap in the calling object.

Note: | The LBitmapSrc parameter is passed by reference, and is a required parameter.
Note: | The rect parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::Copy, LBitmapBase::CopyData, LBitmapBase::CopyHandle, Class Members
Topics: | Raster Image Functions: Copying Images
 | Raster Image Functions: Palettes
 | Raster Image Functions: Using the Clipboard

Example

This is an example for LBitmapBase::CopyRect(LBitmapSrc, nCol, nRow, uWidth, uHeight):

LBitmapBase MyBitmap, Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

Bitmap2.CopyRect(MyBitmap,0,0, MyBitmap.GetWidth()/2, MyBitmap.GetHeight()/2);

This is an example for LBitmapBase::CopyRect(LBitmapSrc, rect):

LBitmapBase MyBitmap, Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

RECT Rect={0,0, MyBitmap.GetWidth()/2, MyBitmap.GetHeight()/2};

Bitmap2.CopyRect(MyBitmap,Rect);


LBitmapBase::CopyToClipboard

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CopyToClipboard(hWnd, uFlags=COPY2CB_EMPTY|COPY2CB_DIB|COPY2CB_DDB|COPY2CB_PALETTE)

HWND hWnd; | /* handle to the active window that owns the clipboard */
L_UINT uFlags; | /* flag that indicates how image data is placed on the clipboard */

Copies the class object's bitmap to the clipboard.

Parameter | Description
hWnd | Handle to the active window that owns the clipboard.
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.

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

Elements: | LBitmapBase::IsClipboardReady, LBitmapBase::CopyFromClipboard, LBitmapBase::CopyToClipboard, Class Members
Topics: | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction(LBitmapBase& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsAllocated())
MyBitmap.CopyToClipboard(hWnd);
}


LBitmapBase::Create

#include "ltwrappr.h"

virtual L_INT
 LBitmapBase::Create(uWidth=100,
 uHeight=100, uBitsPerPixel=24, uOrder= ORDER_BGR, pPalette=NULL, uViewPerspective=TOP_LEFT,
 uMemory=TYPE_CONV, pData=NULL, dwSize=0)

L_UINT uWidth; | /* the desired initial bitmap width */
L_UINT uHeight; | /* the desired initial bitmap height */
L_UINT uBitsPerPixel; | /* bits per pixel for the bitmap */
L_UINT uOrder; | /* the color order */
LPRGBQUAD pPalette; | /* pointer to an array of RGBQUAD structures */
L_UINT uViewPerspective; | /* the desired view perspective for the bitmap */
L_UINT uMemory; | /* the type of memory */
L_CHAR L_FAR *pData; | /* data pointer */
L_UINT32 dwSize; | /* size of the data buffer pointed to by pData */

Creates a new bitmap in the bitmap object.

Parameter | Description
uWidth | The desired initial bitmap width.
uHeight | The desired initial bitmap height.
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 | The color order for 16-, 24-, and 32-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palletized images have no order. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
pPalette | Pointer to an array of RGBQUAD structures that contains palette info. Pass NULL to use LEAD's fixed palette.
uViewPerspective | The desired view perspective for the bitmap. For valid values, refer to Accounting for View Perspective.
uMemory | The type of memory to use when creating the bitmap. Possible values are:
 | Value | Meaning
 | TYPE_CONV | [0x0001] Use conventional memory if the image will fit, otherwise swap to disk.
 | TYPE_COMPRESSED | [0x0200] (Document/Medical only) Allocate an RLE-compressed bitmap. You can use this flag with TYPE_CONV. 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 only for 1-bit, 8-bit grayscale and 24-bit images.
pData | Data pointer that will contain the bitmap data when uMemory is TYPE_USER. If pData is NULL, the data pointer must be passed later, by calling LBitmapBase::SetDataPointer, 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

Call this function to create a new bitmap in the bitmap object with the desired dimensions and view perspective.

Some image processing functions, such as LBitmapBase::Rotate and LBitmapBase::ColorRes, 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 memory. Your original data will no longer be used.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

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.

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.

See Also

Elements: | LBitmapBase::Free, LBitmapBase::Allocate, LBitmapBase::Initialize, Class Members
Topics: | Raster Image Functions: Creating and Deleting Images

Example

LBitmapBase MyBitmap;

MyBitmap.Create(100, 200, 24, ORDER_BGR, NULL, TOP_LEFT, TYPE_CONV);


LBitmapBase::CreateAlphaBitmap

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CreateAlphaBitmap(LBitmapSrc)

LBitmapBase& LBitmapSrc;

/* the source class object */

Creates an alpha bitmap from the alpha channel of another class object's bitmap.

Parameter | Description
LBitmapSrc | The source class object from which to create the alpha bitmap.

Returns

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

Comments

Call this function to create an alpha bitmap from the alpha channel of another class object's bitmap.

Note:

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmapBase::Free, LBitmapBase::Create, Class Members
Topics: | Defining and Using a Bitmap Region
 | Saving a Region

Example

The following function checks if an image has a useful alpha channel bitmap.

void CheckAlphaBitmap(L_TCHAR* pszImageFile)
{
LBitmapBase Bitmap, AlphaBitmap;
LBitmapRgn Region;
L_UINT32 uArea;

Bitmap.Load(pszImageFile,
 0, ORDER_BGR);

AlphaBitmap.CreateAlphaBitmap(Bitmap);

Region.SetBitmap(&AlphaBitmap);
Region.SetRgnCombineMode(L_RGN_SETNOT);
Region.SetRgnColor(RGB(0,
 0, 0) /* Black */);
Region.GetRgnArea(&uArea);

if (uArea != 0)
MessageBox(NULL, TEXT("The image
 has a useful alpha bitmap."), TEXT("Test"), MB_OK);
}


LBitmapBase::CreateFadedMask

#include "ltwrappr.h"

virtual L_INT LBitmapBase::CreateFadedMask(pMaskBitmap, uStructSize, nLength, nFadeRate, nStepSize, nInflate, uFlag, nMaxGray, crTransparent)

LBitmapBase * pMaskBitmap; | /* pointer to an LBitmapBase object */
L_UINT uStructSize; | /* size 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
pMaskBitmap | Pointer to an LBitmapBase object that contains a 24-bit bitmap in which the fade mask will be created.
uStructSize | Size in bytes, of the structure pointed to by pMaskBitmap. 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 that indicates the amount to expand the resulting bitmap. This parameter is used only if FADE_OUTER is set in uFlag.
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 LBitmapBase::FeatherAlphaBlend 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 LBitmapBase::FeatherAlphaBlend 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 filled with black.
b) | A portion in which the output is a combination of the destination and source bitmap.
c) | A portion in which the output comes from the source bitmap. This is called the Dump portion of the mask and it’s filled with white.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

For examples of fade masks created using various flags, refer to Using the LBitmapBase::CreateFadedMask 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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::FeatherAlphaBlend, LBitmapBase::AlphaBlend, Class Members
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Using Color Values in LEADTOOLS
 | Using the LBitmapBase::CreateFadedMask Function
 | Raster Image Functions: Processing an Image

Example

For an example, refer to LBitmapBase::FeatherAlphaBlend.


LBitmapBase::CreateLeadDC

#include "ltwrappr.h"

virtual HDC LBitmapBase::CreateLeadDC(void)

Provides a powerful set of graphics features by creating a Microsoft Windows device context, using the LBitmapBase object’s bitmap as the display surface.

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

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.

See Also

Elements: | LBitmapBase::DeleteLeadDC, Class Members
Topics: | Processing an Image
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap;
HDC hDC;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
hDC=MyBitmap.CreateLeadDC();

/*use the returned DC to draw to the bitmap*/

if(hDC) /*finished using the DC*/
MyBitmap.DeleteLeadDC(hDC);


LBitmapBase::CreatePaintPalette

#include "ltwrappr.h"

virtual HPALETTE LBitmapBase::CreatePaintPalette(hDC)

HDC hDC;

/* handle of a device context */

Creates a paint palette for the bitmap for the specified device context.

Parameter | Description
hDC | Handle of the Windows device context, to be used for creating the paint palette.

Returns

The new palette handle.

If the bitmap does not need a palette to be painted, this function returns NULL.

Comments

Use this function to create a paint palette for the bitmap, for the specified device context. This will update the internal palette for this bitmap with the newly created one. The return value is the handle of the created palette. You should not delete this handle because it will be used when painting the 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.

See Also

Elements: | LBitmapBase::SetPalette, LBitmapBase::GetPalette, LBitmapBase::DupPalette, LBitmapBase::GetFixedPalette
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For an example, refer to LBitmapBase::SetPalette.


LBitmapBase::DeleteLeadDC

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::DeleteLeadDC(hDC)

HDC hDC;

/* handle to a device context*/

Deletes the device context that was created using the LBitmapBase::CreateLeadDC function for the class object's bitmap.

Parameter | Description
hDC | Handle to a device context that was created using the LBitmapBase::CreateLeadDC function.

Returns

None

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.

See Also

Elements:

LBitmapBase::CreateLeadDC, Class Members

Example

For an example, refer to LBitmapBase::CreateLeadDC.


LBitmapBase::DitherLine

#include "ltwrappr.h"

virtual L_INT LBitmapBase::DitherLine(pLBufferSrc, pLBufferDst)

LBuffer L_FAR * pLBufferSrc; | /* pointer to an LBuffer object that contains the data to dither */
LBuffer L_FAR * pLBufferDst; | /* pointer to an LBuffer object that will receive the dithered data */

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
pLBufferSrc | Pointer to an LBuffer object that contains the data to dither.
pLBufferDst | Pointer to an LBuffer object that will receive the dithered data.

Returns

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

Comments

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.

This function uses the dithering method specified in the class object's bitmap handle. Therefore, it provides better 4- or 8-bit output than the LBuffer::ConvertBuffer function.

This function uses the palette that the LBitmapBase::StartDithering function specifies. The output of the LBitmapBase::DitherLine function is made up of 1-, 4-, or 8-bit indexes to the specified palette. LBitmapBase::StopDithering cleans up the allocated variables and buffers. For a description of how the functions relate to each other, refer to the LBitmapBase::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

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.

See Also

Elements: | LBitmapBase::StartDithering, LBitmapBase::StopDithering, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

For an example, refer to LBitmapBase::StartDithering.


LBitmapBase::DupPalette

#include "ltwrappr.h"

virtual HPALETTE LBitmapBase::DupPalette(hPalette=0)

HPALETTE hPalette;

/* handle of the palette to be duplicated */

Retrieves a copy of either the specified HPALETTE, or the bitmap's palette.

Parameter | Description
hPalette | Handle of the palette to be duplicated. If you want to get a copy of the bitmap's palette, pass NULL.

Returns

The duplicated palette handle. If you pass NULL for hPalette, and the bitmap does not have a palette, then the return value is NULL.

Comments

Use this function to retrieve a copy of either the specified HPALETTE, or the bitmap's palette. This function makes a copy of the specified palette, so you must delete it (using DeleteObject) when you are finished with it.

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.

See Also

Elements: | LBitmapBase::SetPalette, LBitmapBase::GetPalette, LBitmapBase::CreatePaintPalette, LBitmapBase::GetFixedPalette, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For an example, refer to LBitmapBase::SetPalette.


LBitmapBase::EnableAlwaysEndNotification

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::EnableAlwaysEndNotification(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to allow the calling of the LBitmapBase::EndChanging member function */

Enables or disables the calling of the LBitmapBase::EndChanging member function.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the calling of the LBitmapBase::EndChanging member function if the operation on the bitmap failed. Possible values are:
 | Value | Meaning
 | TRUE | The LBitmapBase::EndChanging() member function will be called even if the operation function returned an error code.
 | FALSE | The LBitmapBase::EndChanging() member function will not be called if the operation function fails.

Returns

The previous setting.

Comments

Call this function to enable or disable the calling of the LBitmapBase::EndChanging function if the operation on the bitmap failed. The EndChanging function is normally called only if the operation was successful. Calling EnableAlwaysEndNotification with bEnable = TRUE will cause the EndChanging() member function to be called even if the operation function returned an error code.

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.

See Also

Elements:

LBitmapBase::StartChanging, LBitmapBase::EndChanging, LBitmapBase::EnableChangeNotification, LBitmapBase::IsChangeNotificationEnabled, LBitmapBase::IsAlwaysEndNotification, Class Members

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);

if(MyBitmap.IsAlwaysEndNotification()==FALSE)
MyBitmap.EnableAlwaysEndNotification(TRUE);


LBitmapBase::EnableChangeNotification

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::EnableChangeNotification(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to enable change notifications */

Enables or disables the sending of change notifications.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the change notifications. Possible values are:
 | Value | Meaning
 | TRUE | Enable the change notifications.
 | FALSE | Disable the change notifications.

Returns

The previous setting.

Comments

Call this function to enable or disable the sending of change notifications. Disabling the change notifications will speed up your code because the notification functions will not be called. However, this will prevent you from having control over the different operations that are performed on the 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.

See Also

Elements:

LBitmapBase::StartChanging, LBitmapBase::EndChanging, LBitmapBase::IsChangeNotificationEnabled, LBitmapBase::EnableAlwaysEndNotification, LBitmapBase::IsAlwaysEndNotification, Class Members

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);

if(MyBitmap.IsChangeNotificationEnabled ()==FALSE)
MyBitmap.EnableChangeNotification(TRUE);


LBitmapBase::EnableFileName

#include "ltwrappr.h"

L_BOOL LBitmapBase::EnableFileName(bEnableFileName)

L_BOOL bEnableFileName;

/* flag that indicates whether to enable the file name */

Enables or disables use of the internal filename.

Parameter | Description
bEnableFileName | Flag that indicates whether to enable the file name. Possible values are:
 | Value | Meaning
 | TRUE | Enable the file name.
 | FALSE | Disable the file name.

Returns

The previous setting.

Comments

Call this function to enable or disable use of the internal filename. Enabling use of the internal filename will cause automatic transferring of the file name when using the LDialogBase and the LFile classes for loading and saving files.

The internal filename is used in two ways:

1) | If use of the internal filename is enabled when using LDialog and LFile classes, then setting or changing the file name in these classes will cause the changed filename to be transferred to the LBitmapBase object automatically.
2) | If use of the internal filename is not enabled then no automatic transferring of filename will be done the caller is responsible for maintaining the filename for the image.

The default setting is TRUE.

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.

See Also

Elements:

LBitmapBase::GetFileName, LBitmapBase::SetFileName, Class Members

Example

For an example, refer to LBitmapBase::IsFileNameEnabled.


LBitmapBase::EnableLocalSettings

#include "ltwrappr.h"

L_BOOL LBitmapBase::EnableLocalSettings(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable the local settings*/

Enables or disables the local display settings.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the local settings. Possible values are:
 | Value | Meaning
 | TRUE | Enable the local settings.
 | FALSE | Use the global settings.

Returns

The previous setting.

Comments

Use this function to enable or disable the local display settings for the class object. When local settings are enabled, painting the bitmap will use the local settings and the global settings will be restored after the paint operation. When local settings are disabled, painting the bitmap will use the global settings. The display settings include: intensity, contrast, gamma, and display mode.

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.

See Also

Elements:

LBitmapBase::IsLocalSettingsEnabled, LBitmapBase::GetPaintIntensity, LBitmapBase::GetPaintGamma, LBitmapBase::SetPaintGamma, LBitmapBase::GetPaintContrast, LBitmapBase::GetPaintContrast, LBitmapBase::SetPaintContrast, LBitmapBase::GetDisplayMode, LBitmapBase::SetDisplayMode, Class Members

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);

if(MyBitmap.IsLocalSettingsEnabled()==FALSE)
MyBitmap.EnableLocalSettings(TRUE);


LBitmapBase::EnablePlayBackTransparency

#include "ltwrappr.h"

L_BOOL LBitmapBase::EnablePlayBackTransparency(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable transparency */

Enables or disables the use of animation playback transparency.

Parameter | Description
bEnable | Flag that indicates whether to enable the use of transparency for the playback. Possible values are:
 | Value | Meaning
 | TRUE | Enable the use of transparency for the playback.
 | FALSE | Disable the use of transparency for the playback.

Returns

The previous setting.

Comments

Call this function to enable or disable the use of animation playback transparency.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.EnablePlayBackTransparency(TRUE);


LBitmapBase::EnablePlayBackWaitUserInput

#include "ltwrappr.h"

L_BOOL LBitmapBase::EnablePlayBackWaitUserInput(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable waiting for user input */

Enables or disables waiting for user input.

Parameter | Description
bEnable | Flag that indicates whether to enable waiting for user input during playback. Possible values are:
 | Value | Meaning
 | TRUE | Enable waiting for user input.
 | FALSE | Disable waiting for user input.

Returns

The previous setting.

Comments

Call this function to enable/disable waiting for user input for an animation playback.

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.

See Also

Elements:

LDialogBase::DialogHelpCallBack , Class Members

Example

L_VOID Test(LBitmapBase L_FAR* pBitmap)
{
if(pBitmap->IsPlayBackWaitUserInput()==FALSE)
pBitmap->EnablePlayBackWaitUserInput(TRUE);
}


LBitmapBase::EnableRedirectStatusCallBack

#include "ltwrappr.h"

virtualL_BOOL LBitmapBase::EnableRedirectStatusCallBack(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to enable redirecting the status callback function */

Enables or disables redirecting the status callback function to the bitmap object’s status callback function.

Parameter | Description
bEnable | Flag that indicates indicates whether to enable redirecting the status callback function. Possible values are:
 | Value | Meaning
 | TRUE | Enable redirecting status callback function.
 | FALSE | Disable redirecting status callback function.

Returns

The previous setting.

Comments

If redirecting the status callback function is enabled, calling a function of any mapped class will result in the status callback function of the bitmap object being called, instead of the status callback function of the mapped class. This only works if the status callback function of the mapped class is enabled.

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.

See Also

Elements:

Class Members

Example

L_VOID MyFunc(LBitmapBase& Bitmap)
{
if(Bitmap.IsRedirectStatusCallBackEnabled()==FALSE)
Bitmap.EnableRedirectStatusCallBack();
}


LBitmapBase::EnableUseLUT

#include "ltwrappr.h"

L_BOOL LBitmapBase::EnableUseLUT (bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable the LUT */

Enables or disables the use of LUT.

Parameter | Description
bEnable | Flag that indicates when the LUT is used. Possible values are
 | Value | Meaning
 | TRUE | The LUT is used in all image processing functions, including save. (default).
 | FALSE | The LUT is used only when painting. It is ignored when an image processing function is applied or when a file is saved.

Returns

The previous setting.

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.

See Also

Elements: | LBitmap::WindowLevelFillLUT, LBitmap::WindowLevelBitmap, Class Members
Topics: | Raster Image Functions: Palettes
 | Raster Image Functions: Displaying and Printing

Example

RGBQUAD L_HUGE* pLUT;
L_INT nRet;
L_INT nMin, nMax;
L_INT nLowBit, nHighBit;
LBitmap myBitmap;
L_INT nLUTLen = 0;

LSettings::UnlockSupport(L_SUPPORT_MEDICAL, L_KEY_MEDICAL);
nRet = myBitmap.Load(TEXT("c:\\16.jpg"),16);

myBitmap.GetMinMaxBits(&nLowBit,
 &nHighBit);
myBitmap.GetMinMaxVal(&nMin,
 &nMax);

/* allocate the lookup table */
nLUTLen = 1<<(nHighBit - nLowBit + 1);
pLUT = (RGBQUAD L_HUGE*)malloc(sizeof(RGBQUAD) * nLUTLen);

/* fill the LUT with a color gradient */
myBitmap.WindowLevelFillLUT((RGBQUAD
 L_HUGE*)pLUT,
nLUTLen,
RGB(255,0,0),
 /* RED */
RGB(0,0,255),
 /* BLUE */
nLowBit,
 /* Starting value */
nLUTLen,
 /* Ending value */
nLowBit,
 /* Bitmap's LowBit */
nHighBit,
 /* Bitmap's HighBit */
nMin,
 /* Bitmap's MinVal */
nMax,
 /* Bitmap's MaxVal */
0,
 /*nFactor*/
FILLLUT_INSIDE
 | FILLLUT_LINEAR); /* Fill Inside range */

myBitmap.GetHandle()->LUTLength
 = nLUTLen;
myBitmap.GetHandle()->pLUT = (RGBQUAD L_HUGE*)GlobalAllocPtr(GHND,sizeof(RGBQUAD)
 * nLUTLen);
memcpy(myBitmap.GetHandle()->pLUT,pLUT,sizeof(RGBQUAD) * nLUTLen);
myBitmap.EnableUseLUT(TRUE);
myBitmap.ColorRes(24,CRF_BYTEORDERBGR|CRF_FLOYDSTEINDITHERING);

/* free the table */
free(pLUT);

if(myBitmap.GetHandle()->pLUT)
{
GlobalFree(myBitmap.GetHandle()->pLUT);
myBitmap.GetHandle()->LUTLength = 0;
}


LBitmapBase::EndChanging

#include "ltwrappr.h"

virtual L_VOID LBitmapBase::EndChanging(nChangeType, nChangeCategory, nRetCode)

L_UINT nChangeType; | /* the type of change */
L_UINT nChangeCategory; | /* the change category */
L_INT nRetCode; | /* the function return code */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change that was done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nRetCode | The function return code.

Returns

None

Comments

This function is called by every function that affects the bitmap. You can override this function to be notified when the operation has completed changing the bitmap. This function is called after the changes to the bitmap have been made. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

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.

See Also

Elements:

LBitmapBase::StartChanging, LBitmapBase::EnableChangeNotification, LBitmapBase::IsChangeNotificationEnabled, LBitmapBase::EnableAlwaysEndNotification, LBitmapBase::IsAlwaysEndNotification, Class Members

Example

For an example, refer to LBitmapBase::StartChanging.


LBitmapBase::FeatherAlphaBlend

#include "ltwrappr.h"

virtual L_INT LBitmapBase::FeatherAlphaBlend (nXDst, nYDst, nWidth, nHeight, pBitmapSrc, nXSrc, nYSrc, pBitmapMask)

L_INT nXDst; | /* x coordinate */
L_INT nYDst; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
LBitmapBase * pBitmapSrc; | /* pointer to a bitmap handle */
L_INT nXSrc; | /* x coordinate */
L_INT nYSrc; | /* y coordinate */
LBitmapBase * pBitmapMask; | /* pointer to a bitmap handle */

Combines image data from the class object's bitmap and the pBitmapSrc bitmap, with feathering, by combining the two bitmaps with a variable opacity that depends on a fade mask. The class object's bitmap is considered the destination bitmap and it will be updated with the result of the operation. This function is available in the Raster Pro and above toolkits.

Parameter | Description
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 LBitmapBase::AlphaBlend function.

The LBitmapBase::FeatherAlphaBlend 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 LBItmapBase::CreateFadedMask.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

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

LTDIS
LTFIL
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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmapBase::Underlay, LBitmapBase::Combine, LBitmapBase::AlphaBlend, LBitmapBase::CreateFadedMask.
Topics: | Raster Image Functions: Combining Images
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(LBitmapBase & Bitmap, L_TCHAR * szFile1,
L_TCHAR * szFile2)
{
LBitmapBase BitmapSrc;
LBitmapBase BitmapMsk;
LBitmapRgn Region;
L_INT nXDst, nYDst, nWidth, nHeight;
RECT rect;

Bitmap.Load(szFile1);
BitmapSrc.Load(szFile2);

BitmapSrc.Size(2 * Bitmap.GetWidth() / 3,
2 * Bitmap.GetHeight() / 3,
SIZE_RESAMPLE);

nXDst = Bitmap.GetWidth() / 6;
nYDst = Bitmap.GetHeight() / 6;
nWidth = BitmapSrc.GetWidth();
nHeight = BitmapSrc.GetHeight();

SetRect(&rect, 0, 0, nWidth, nHeight);

Region.SetBitmap(&BitmapSrc);
Region.SetRgnRect(&rect);

BitmapSrc.CreateFadedMask(&BitmapMsk, sizeof(BITMAPHANDLE),
min(BitmapSrc.GetWidth() / 3,
BitmapSrc.GetHeight() / 3),
15, 3, 0,
FADE_DUMPFILL | FADE_NOTRANSPARENCY,
255, RGB(0, 0, 255));

Bitmap.FeatherAlphaBlend(nXDst, nYDst, nWidth, nHeight,
&BitmapSrc, 0, 0, &BitmapMsk);
}


LBitmapBase::Fill

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Fill(crFill=0)

COLORREF crFill;

/* fill color */

Fills the class object’s bitmap with the specified color.

Parameter | Description
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 toolkits, 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 LBitmapBase::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

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.

See Also

Elements: | LBitmapBase::Clear, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Modifying Intensity Values
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.Fill(RGB(255,200,0));


LBitmapBase::Flip

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Flip(void)

Flips the class object's bitmap from top to bottom.

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 LBase::EnableStatusCallBack.

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.

See Also

Elements: | LBitmapBase::Reverse, LBitmapBase::Rotate, LBitmapBase::RotateFine, LBitmapBase::Shear, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.Flip();


LBitmapBase::FlipViewPerspective

#include "ltwrappr.h"

virtual L_INT LBitmapBase::FlipViewPerspective()

Performs a fast flip operation by changing the bitmap's view perspective.

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 LBase::EnableStatusCallback.

This function is similar to LBitmapBase::RotateViewPerspective.

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.

See Also

Elements: | LBitmapBase::ChangeViewPerspective, LBitmapBase::GetViewPerspective, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

void LoadFlipViewPerspective(LBitmap * pBitmap)
{
/* Flip the bitmap */
pBitmap->FlipViewPerspective();
}


LBitmapBase::Free

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Free(void)

Frees the memory allocated for the bitmap data.

Returns

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

Comments

Call this function to free the memory allocated for the bitmap data. 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 the bitmap has a palette, it will be deleted too. After this function returns, the internal bitmap handle will be invalidated.

Note:

You do not have to call LBitmapBase::Free unless you explicitly want to free the memory. The class object will automatically free the bitmap when it is destroyed.

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.

See Also

Elements: | LBitmapBase::Allocate, LBitmapBase::Initialize, LBitmapBase::SetHandle, Class Members
Topics: | Raster Image Functions: Creating and Deleting Images

Example

LBitmapBase MyBitmap;
MyBitmap.SetFileName(TEXT("Image1.cmp"));
MyBitmap.Load();

if(MyBitmap.IsAllocated())
MyBitmap.Free();


LBitmapBase::GetBitsPerPixel

#include "ltwrappr.h"

L_INT LBitmapBase::GetBitsPerPixel(void)

Retrieves the bits per pixel for the class object’s bitmap.

Returns

The bits per pixel of the bitmap.

Comments

Use this function to retrieve the bits per pixel for the class object’s 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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_INT nBPP;

MyBitmap.Load(TEXT("image1.cmp"));
nBPP=MyBitmap.GetBitsPerPixel();


LBitmapBase::GetBytesPerLine

#include "ltwrappr.h"

L_INT LBitmapBase::GetBytesPerLine(void)

Retrieves the number of bytes per line of bitmap data.

Returns

The number of bytes per line of bitmap data.

Comments

Use this function to retrieve number of bytes per line of bitmap data.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_INT nBPL;

MyBitmap.Load(TEXT("image1.cmp"));
nBPL=MyBitmap.GetBytesPerLine();


LBitmapBase::GetColorCount

#include "ltwrappr.h"

virtual L_INT LBitmapBase::GetColorCount(puCount)

L_UINT32 L_FAR * puCount;

/* pointer top a variable to be updated */

Gets the number of unique colors in the class object's bitmap.

Parameter | Description
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

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LBitmapBase MyBitmap;
L_UINT32 uCount;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);

MyBitmap.GetColorCount(&uCount);


LBitmapBase::GetColorOrder

#include "ltwrappr.h"

L_INT LBitmapBase::GetColorOrder(void)

Retrieves the color order of the class object’s bitmap.

Returns

The color order of the bitmap data. Possible values are:

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

Comments

Use this function to retrieve the color order of the 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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_INT nOrder;

MyBitmap.Load(TEXT("image1.cmp"));
nOrder=MyBitmap.GetColorOrder();


LBitmapBase::GetColors

#include "ltwrappr.h"

virtual L_INT LBitmapBase::GetColors(nIndex, nCount, pPalette)

L_INT nIndex; | /* the index of the first color to be retrieved */
L_INT nCount; | /* the number of colors to retrieve*/
LPRGBQUAD pPalette; | /* pointer to an array of RGBQUAD structures that make up your palette */

Loads your palette with selected colors of a class object's bitmap.

Parameter | Description
nIndex | The index of the first color to be retrieved.
nCount | The number of colors to retrieve.
pPalette | Pointer to an array of RGBQUAD structures that will receive the colors.

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 LBitmapBase::PutColors.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LBitmapBase MyBitmap;
RGBQUAD Colors[256];

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(8); //load at 8 bit per pixel

MyBitmap.GetColors(0, 255, Colors) ;


LBitmapBase::GetDefaultDithering

#include "ltwrappr.h"

L_UINT LBitmapBase::GetDefaultDithering(void)

Retrieves the current dithering mode.

Returns

The current dithering mode. Possible 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.

Comments

Use this function to retrieve the current dithering mode. This is the local dithering mode for the class object.

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.

See Also

Elements: | LBitmapBase::SetDefaultDithering, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
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

LBitmapBase MyBitmap;
L_UINT uDitheringMethod;

MyBitmap.Load(TEXT("image1.cmp"));
uDitheringMethod=MyBitmap.GetDefaultDithering();


LBitmapBase::GetDisplayMode

#include "ltwrappr.h"

L_UINT32 LBitmapBase::GetDisplayMode(void)

Gets the painting control flags, which are set by the LBitmapBase::SetDisplayMode function.

Returns

The unsigned integer containing the painting control flags. Possible values are:

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 LBitmapBase::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 LPaint::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.

Comments

This will be the local display mode setting for the class object and is used when painting the 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.

See Also

Elements: | LBitmapBase::SetDisplayMode, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

LBitmapBase MyBitmap;
L_UINT32 uDMode;
MyBitmap.Load(TEXT("image1.cmp"),24);
uDMode=MyBitmap.GetDisplayMode();


LBitmapBase::GetDitheringMethod

#include "ltwrappr.h"

L_UINT LBitmapBase::GetDitheringMethod(void)

Gets the dithering method for the class object's bitmap.

Returns

The dithering method (referenced by some functions). For possible values, refer to the LBitmapSettings::DefaultDithering() function.

Comments

Call this function to get the dithering method for the class object's bitmap. This value can be different than the class object's default dithering method specified with LBitmapBase::SetDefaultDithering.

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.

See Also

Elements: | LBitmapBase::SetDitheringMethod, LBitmapSettings::DefaultDithering, Class Members
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

LBitmapBase MyBitmap;
L_UINT uDitheringMode;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

uDitheringMode=MyBitmap.GetDitheringMethod();


LBitmapBase::GetFileName

#include "ltwrappr.h"

L_INT LBitmapBase::GetFileName(pszBuffer, puBuffSize)

L_TCHAR L_FAR * pszBuffer; | /* buffer to be updated with the file name */
L_UINT L_FAR * puBuffSize; | /* the size of the buffer */

Gets the internal file name used by the bitmap object.

Parameter | Description
pszBuffer | The buffer to be updated with the file name. If you pass NULL then the required size will be returned in puBuffSize.
puBuffSize | Pointer to a variable to be updated with the required size of pszBuffer.

Returns

> 0 | Number of bytes copied to the buffer.
< 1 | An error occurred. Refer to Return Codes.

Comments

Call this function to get the internal file used by the bitmap object.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_TCHAR FileName[256];
L_UINT uSize=256;

memset(FileName,0,sizeof(FileName));

MyBitmap.GetFileName(FileName,&uSize);


LBitmapBase::GetFixedPalette

#include "ltwrappr.h"

virtual L_INT LBitmapBase::GetFixedPalette(pPalette, nBitsPerPixel)

LPRGBQUAD pPalette; | /* pointer to an array of RGBQUAD structures */
L_INT nBitsPerPixel; | /* bits per pixel */

Retrieves a LEAD fixed palette, based on the bits per pixel.

Parameter | Description
pPalette | Pointer to an array of RGBQUAD structures that will be filled with the LEAD fixed palette. This array must be 256 elements.
nBitsPerPixel | Number of bits per pixel. This value is used to determine the palette to retrieve.

Returns

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

Comments

Use this function to get the LEAD fixed palette for a specific bits per pixel. You can specify 0 bits per pixel to create an 8-bit grayscale palette.

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.

See Also

Elements: | LBitmapBase::SetPalette, LBitmapBase::GetPalette, LBitmapBase::DupPalette, LBitmapBase::CreatePaintPalette, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

RGBQUAD FixedPalette[256];
LBitmapBase MyBitmap;

if(MyBitmap.GetFixedPalette( FixedPalette, 8)==SUCCESS)
//do something with the returned palette


LBitmapBase::GetHandle

#include "ltwrappr.h"

pBITMAPHANDLE LBitmapBase::GetHandle(void)

Retrieves the internal LEAD bitmap handle for this LBitmapBase class object.

Returns

A pointer to a bitmap handle.

Comments

Use this function to retrieve the internal LEAD bitmap handle for this LBitmapBase class object. You can use this with any of the low level LEAD API functions that require a pBITMAPHANDLE.

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.

See Also

Elements

LBitmapBase::SetHandle, Class Members

Example

LBitmapBase MyBitmap;
pBITMAPHANDLE phBitmap;

MyBitmap.Load(TEXT("image1.cmp"));
phBitmap=MyBitmap.GetHandle();


LBitmapBase::GetHeight

#include "ltwrappr.h"

L_INT LBitmapBase::GetHeight(void)

Retrieves the height of the bitmap.

Returns

The height of the bitmap.

Comments

Use this function to retrieve the height of the bitmap. This will take into consideration the current view perspective of the 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.

See Also

Elements:

LBitmapBase::GetWidth, Class Members

Example

LBitmapBase MyBitmap;
L_INT nHeight;

MyBitmap.Load(TEXT("image1.cmp"));
nHeight=MyBitmap.GetHeight();


LBitmapBase::GetLoadStatus

#include "ltwrappr.h"

static L_INT LBitmapBase::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 LBitmapBase::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: LFile::LoadBitmap, LFile::LoadFile,
 LFile::LoadOffset,
 LFile::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.

See Also

Functions: | LFile::LoadFile, LFile::LoadBitmap, LFile::FeedLoad, LMemoryFile::LoadMemory, LFile::LoadOffset, LBitmapList::Load, LFile::LoadTile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

#define FILENAME "C:\\GeoTIFF.tif"// 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)
{
LBitmap Bitmap;
L_INT nRet = Bitmap.Load(FILENAME);
if(nRet == SUCCESS)
{
L_INT nLoadStatus = LBitmap::GetLoadStatus();
if(nLoadStatus == SUCCESS)
MessageBox(hWnd,
 TEXT("The image was loaded successfully and with no errors"),
 TEXT("SUCCESS"), MB_OK);
else
MessageBox(hWnd,
 TEXT("The image was loaded, but it might have corrupted areas"),
 TEXT("Warning!"), MB_OK);
Bitmap.Free();
}
else
MessageBox(hWnd, TEXT("loading
 failed!"), TEXT("ERROR"), MB_OK);
}


LBitmapBase::GetMemSize

#include "ltwrappr.h"

L_INT LBitmapBase::GetMemSize(void)

Retrieves the size of the memory allocated for the bitmap data.

Returns

The size of memory allocated for the bitmap data.

Comments

Use this function to retrieve the size of the memory allocated for the bitmap data.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_UINT32 uMemSize;

MyBitmap.Load(TEXT("image1.cmp"));
uMemSize=MyBitmap.GetMemSize();


LBitmapBase::GetPaintContrast

#include "ltwrappr.h"

L_INT LBitmapBase::GetPaintContrast(void)

Gets the current contrast value for the class object’s bitmap. This value is used in painting operations and is set by the LBitmapBase::SetPaintContrast function.

Returns

The current local paint contrast setting for the class object’s bitmap.

Comments

Use this function to get the current paint contrast for the class object’s bitmap. This is the local paint contrast setting for the class object’s 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.

See Also

Elements: | LBitmapBase::SetPaintContrast, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images

Example

LBitmapBase MyBitmap;
L_INT nContrast;

MyBitmap.Load(TEXT("image1.cmp"),24);
nContrast=MyBitmap.GetPaintContrast();


LBitmapBase::GetPaintGamma

#include "ltwrappr.h"

L_UINT LBitmapBase::GetPaintGamma(void)

Gets the current gamma correction value for the class object’s bitmap. This value is used in painting operations and is set by the LBitmapBase::SetPaintGamma function.

Returns

The value of the paint gamma used for painting the bitmap.

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

This is the local paint gamma setting for the class object and is used when painting the bitmap.

Setting the gamma correction that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

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.

See Also

Elements: | LBitmapBase::SetPaintGamma, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images

Example

LBitmapBase MyBitmap;
L_UINT uGamma;

MyBitmap.Load(TEXT("image1.cmp"),24);
uGamma=MyBitmap.GetPaintGamma();


LBitmapBase::GetPaintIntensity

#include "ltwrappr.h"

L_INT LBitmapBase::GetPaintIntensity(void)

Gets the current intensity value for the class object’s bitmap. This value is used in painting operations and is set by the LBitmapBase::SetPaintIntensity function.

Returns

The current intensity setting. Possible values are -1000 to +1000.

Comments

This is the local paint intensity setting for the class object and is used when painting the bitmap.

Setting the intensity value that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

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.

See Also

Elements: | LBitmapBase::SetPaintIntensity, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled
Topics: | Raster Image Functions: Displaying Images

Example

LBitmapBase MyBitmap;
L_INT nIntensity;

MyBitmap.Load(TEXT("image1.cmp"),24);
nIntensity=MyBitmap.GetPaintIntensity();


LBitmapBase::GetPalette

#include "ltwrappr.h"

HPALETTE LBitmapBase::GetPalette(void)

Retrieves the palette handle of the bitmap.

Returns

The palette handle of the bitmap.

Comments

Use this function to retrieve the palette handle of the 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.

See Also

Elements: | LBitmapBase::SetPalette, LBitmapBase::DupPalette, LBitmapBase::CreatePaintPalette, LBitmapBase::GetFixedPalette, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

LBitmapBase MyBitmap,Bitmap2;
HPALETTE hPalette;
HDC hDC=GetDC(0);

MyBitmap.Load(TEXT("image1.cmp"),8);
Bitmap2.Load(TEXT("image2.cmp"),8);

Bitmap2.CreatePaintPalette(hDC);
hPalette=Bitmap2.GetPalette();
hPalette=Bitmap2.DupPalette();

MyBitmap.SetPalette(hPalette);

ReleaseDC(0,hDC);


LBitmapBase::GetPixelColor

#include "ltwrappr.h"

virtual COLORREF LBitmapBase::GetPixelColor(nRow, nCol)

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

Returns the color of the specified pixel from the class object's bitmap.

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.

In the Document/Medical toolkits, 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 = GetPixelColor(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 LBitmapBase::PutPixelColor function to assign the returned value to another pixel.

This function always uses TOP_LEFT ViewPerspective coordinates to specify the pixel. Therefore, you do not have to 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

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.

See Also

Elements: | LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;
COLORREF Color;

MyBitmap.Load(TEXT("image1.cmp"),24);
Color=MyBitmap.GetPixelColor(10,10);
MyBitmap.PutPixelColor(20,20,Color);


LBitmapBase::GetPixelData

#include "ltwrappr.h"

virtual L_INT LBitmapBase::GetPixelData(pData, nRow, nCol, nBytes)

L_VOID *pData; | /* pointer to a buffer */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
L_INT nBytes; | /* size of the buffer */

Gets the data of the specified pixel. No transformations are performed on the pixel data.

Parameter | Description
pData | Pointer to a buffer to be updated with the pixel data. This buffer should be able to store nBytes bytes.
nRow | The row number of the pixel.
nCol | The column number of the pixel.
nBytes | 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: (LBitmapBase::GetBitsPerPixel + 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 nBytes is smaller than it should be. The minimum value for nSize is indicated in a formula above.

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.

See Also

Functions: | LBitmapBase::Access, LBitmapBase::Release, LBitmapBase::GetRow, LBitmapBase::PutRow, LBitmapBase::GetRowCol, LBitmapBase::PutRowCol, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

L_VOID SwapRGBtoBGR(LBitmapBase & Bitmap, L_TCHAR * pszFile, L_INT nRow,
L_INT nCol)
{
L_UINT uTempValue;

Bitmap.Load(pszFile);

if (Bitmap.GetBitsPerPixel() == 24 ||
Bitmap.GetBitsPerPixel() == 32)
{
L_UCHAR aPixel[4]; // Make it large enough for both bitmap types

Bitmap.GetPixelData(aPixel, nRow, nCol, sizeof(aPixel));

// Swap the red and blue values
uTempValue = aPixel[0];
aPixel[0] = aPixel[2];
aPixel[2] = (L_UCHAR) uTempValue;

// Put back the transformed pixel
Bitmap.PutPixelData(aPixel, nRow, nCol, sizeof(aPixel));
}
else if (Bitmap.GetBitsPerPixel() == 48 ||
Bitmap.GetBitsPerPixel() == 64)
{
L_UINT16 aPixel[4]; // Make it large enough for both bitmap types

Bitmap.GetPixelData(aPixel, nRow, nCol, sizeof(aPixel));

// Swap the red and blue values
uTempValue = aPixel[0];
aPixel[0] = aPixel[2];
aPixel[2] = (L_UINT16) uTempValue;

// Put back the transformed pixel
Bitmap.PutPixelData(aPixel, nRow, nCol, sizeof(aPixel));
}
else
MessageBox(NULL, TEXT("This example works only with "
"24-, 32-, 48- and 64-bit bitmaps!"),
TEXT("Testing"), MB_OK);
}


LBitmapBase::GetPlayBackBackGroundColor

#include "ltwrappr.h"

COLORREF LBitmapBase::GetPlayBackBackGroundColor(void)

Gets the background color for animation playback.

Returns

The background color for animation playback.

Comments

Call this function to get the background color for animation playback.

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.

See Also

Elements: | LBitmapBase::SetPlayBackBackGroundColor, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;
COLORREF Color;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

Color=MyBitmap.GetPlayBackBackGroundColor();


LBitmapBase::GetPlayBackDelay

#include "ltwrappr.h"

L_UINT32 LBitmapBase::GetPlayBackDelay(void)

Gets the animation playback delay in milliseconds (ms) for the class object's bitmap.

Returns

The animation playback delay in milliseconds(ms).

Comments

Call this function to get the animation playback delay in milliseconds (ms) for the class object's 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.

See Also

Elements: | LBitmapBase::SetPlayBackDelay, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_UINT32 uDelay;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

uDelay=MyBitmap.GetPlayBackDelay();


LBitmapBase::GetPlayBackDisposalMethod

#include "ltwrappr.h"

L_UINT LBitmapBase::GetPlayBackDisposalMethod(void)

Gets the animation playback disposal method.

Returns

Animation playback disposal method. For possible values, refer to LBitmapBase::SetPlayBackDisposalMethod

Comments

Call this function to get the animation playback disposal method.

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.

See Also

Elements: | LBitmapBase::SetPlayBackDisposalMethod, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_UINT uPBDM;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

uPBDM=MyBitmap.GetPlayBackDisposalMethod();


LBitmapBase::GetPlayBackLeft

#include "ltwrappr.h"

L_INT LBitmapBase::GetPlayBackLeft(void)

Gets the left offset for animation playback.

Returns

The left offset for animation playback.

Comments

Call this function to get the left offset for animation playback.

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.

See Also

Elements: | LBitmapBase::SetPlayBackLeft, LBitmapBase::GetPlayBackTop, LBitmapBase::SetPlayBackTop, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_INT nPBL;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

nPBL=MyBitmap.GetPlayBackLeft();


LBitmapBase::GetPlayBackTop

#include "ltwrappr.h"

L_INT LBitmapBase::GetPlayBackTop(void)

Gets the top offset for animation playback.

Returns

The top offset for animation playback.

Comments

Call this function to get the top offset for animation playback.

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.

See Also

Elements: | LBitmapBase::GetPlayBackLeft, LBitmapBase::SetPlayBackLeft, LBitmapBase::SetPlayBackTop, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_INT nPBT;
MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

nPBT=MyBitmap.GetPlayBackTop();


LBitmapBase::GetPlayBackTransparentColor

#include "ltwrappr.h"

COLORREF LBitmapBase::GetPlayBackTransparentColor(void)

Gets the color that is used as the transparent color for the playback operation.

Returns

The transparent color.

Comments

Call this function to get the color that is used as the transparent color for the playback operation.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;
COLORREF Color;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

Color=MyBitmap.GetPlayBackTransparentColor();


LBitmapBase::GetRects

#include "ltwrappr.h"

virtual L_VOID LBitmapBase::GetRects(prcSrc, prcClipSrc, prcDst, prcClipDst)

LPRECT prcSrc; | /* pointer to a RECT windows structure */
LPRECT prcClipSrc; | /* pointer to a RECT windows structure */
LPRECT prcDst; | /* pointer to a RECT windows structure */
LPRECT prcClipDst; | /* pointer to a RECT windows structure */

Retrieves the rectangles used when painting the class object’s bitmap.

Parameter | Description
prcSrc | Optional pointer to a RECT windows structure, that will receive the bitmap source rectangle.
prcClipSrc | Optional pointer to a RECT windows structure, that will receive the bitmap source clip rectangle.
prcDst | Optional pointer to a RECT windows structure, that will receive the bitmap destination rectangle.
prcClipDst | Optional pointer to a RECT windows structure, that will receive the bitmap destination clip rectangle.

Returns

None

Comments

Use this function to retrieve the rectangles used for the class object when painting the bitmap.

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.

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

Elements: | LBitmapBase::SetSrcRect, LBitmapBase::SetClipSrcRect, LBitmapBase::SetDstRect, LBitmapBase::SetClipDstRect, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

LBitmapBase MyBitmap;
RECT DstRct,rcTemp;

MyBitmap.Load(TEXT("image1.cmp"),24);

rcTemp.left=10;
rcTemp.top=10;
rcTemp.right=300;
rcTemp.bottom=300;

MyBitmap.SetSrcRect(&rcTemp);
rcTemp.left=20;
rcTemp.top=20;
rcTemp.right=200;
rcTemp.bottom=200;

MyBitmap.SetClipSrcRect(&rcTemp);
rcTemp.left=0;
rcTemp.top=0;
rcTemp.right=MyBitmap.GetWidth();
rcTemp.bottom=MyBitmap.GetHeight();

MyBitmap.SetDstRect(&rcTemp);
rcTemp.left=20;
rcTemp.top=20;
rcTemp.right=MyBitmap.GetWidth()-20;
rcTemp.bottom=MyBitmap.GetHeight()-30;

MyBitmap.SetClipDstRect(&rcTemp);

MyBitmap.GetRects(0,0,&DstRct,0);


LBitmapBase::GetRow

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::GetRow(pLBuffer, nRow)

LBuffer L_FAR * pLBuffer; | /* pointer to an LBuffer object */
L_INT nRow; | /* the number of the row to retrieve */

Copies image data from the class object's bitmap to the specified buffer.

Parameter | Description
pLBuffer | Pointer to an LBuffer object that will receive the retrieved row. You must allocate enough space in the buffer to hold the data. To get a full row, use the value returned by LBitmapBase::GetBitsPerPixel to allocate the buffer. Or, use an empty buffer to retrieve the full row.
 | 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 value returned by LBitmapBase::GetBitsPerPixel with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.GetBitsPerPixel() * NumberOfPixels) / 8;
 | if ((Bitmap.GetBitsPerPixel() * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */
nRow | The number of the row to retrieve. The first row is 0 and the last row is 1 less than the bitmap height.

Returns

>=1 | The number of bytes retrieved.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function copies image data from the class object's 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 LBitmapBase::Access to lock the memory before starting an operation that uses this function, then call LBitmapBase::Release when the operation is finished.

Use the LBitmapBase::GetBytesPerLine() to determine the byte count of each line. Color order is determined by the LBitmapBase::GetColorOrder() function. Locking the bitmap memory will speed up the processing. If you do not lock the bitmap memory it will be locked automatically and released automatically after getting the row data, but this will slow down the processing.

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowCol, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

/* Load the bitmap, at 24 bits per pixel */
LBitmapBase LeadBitmap;
LBuffer Buffer;
L_CHAR L_FAR * pBuff;

LeadBitmap.Load (TEXT("IMAGE3.CMP"));

/* get row number 5 of the bitmap */
LeadBitmap.Access();
LeadBitmap.GetRow(&Buffer,5) ;
/*process the row data*/

if(Buffer.GetSize())
{
pBuff=(L_CHAR L_FAR*)Buffer.Lock();

for(L_INT uByte = 0; uByte < LeadBitmap.GetBytesPerLine(); uByte++)
pBuff[uByte] ^= 0xFF;

Buffer.Unlock();
/*restore the row*/
LeadBitmap.PutRow(Buffer, 5);
LeadBitmap.Release();
}


LBitmapBase::GetRowCol

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::GetRowCol(pLBuffer, nRow, nCol)

LBuffer L_FAR * pLBuffer; | /* pointer to an LBuffer object */
L_INT nRow; | /* the row number */
L_INT nCol; | /* the column number */

Copies image data from the class object's bitmap to the specified buffer. The buffer will be filled with uncompressed data.

Parameter | Description
pLBuffer | Pointer to the LBuffer object that will receive the retrieved row. You must allocate enough space in the buffer to hold the data. To get a full row, use the value returned by LBitmapBase::GetBitsPerPixel to allocate the buffer. Or, use an empty buffer to retrieve the full row.
 | 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 value returned by LBitmapBase::GetBitsPerPixel with integer math to calculate the number of bytes needed for a particular number of pixels. For example:
 | NumberOfBytes = (Bitmap.GetBitsPerPixel() * NumberOfPixels) / 8;
 | if ((Bitmap.GetBitsPerPixel() * NumberOfPixels) % 8)
 | ++NumberOfBytes; /* Round up if necessary for a 1- or 4-bit image */
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 number of column from which to get the data. The first column offset is 0, and the last column offset is 1 less than the bitmap width.

Returns

>=1 | The number of bytes retrieved.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function copies image data from the class object's bitmap to a buffer that you specify. This function can be used to retrieve a partial row. 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 LBitmapBase::Access to lock the memory before starting an operation that uses this function, then call LBitmapBase::Release when the operation is finished.

Use the LBitmapBase::GetBytesPerLine() to determine the byte count of each line. Color order is determined by the LBitmapBase::GetColorOrder() function. Locking the bitmap memory will speed up the processing. If you do not lock the bitmap memory it will be locked automatically and released automatically after getting the row data, but this will slow down the processing.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

/* This example uses GetRowCol and PutRowCol to invert
the colors of a rectangle in the upper left part of the displayed image. */
LBitmapBase 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 */
LBuffer Buff;
L_UCHAR L_FAR *pBuf; /* Buffer to hold the row */
int i, n; /* Counters */
/* Load the bitmap, at 24 bits per pixel */
LeadBitmap.Load (TEXT("IMAGE3.CMP"), 24, ORDER_BGR);
/* This example does not work with rotated view perspectives */
if ( (LeadBitmap.GetViewPerspective() != TOP_LEFT) || (LeadBitmap.GetViewPerspective() != BOTTOM_LEFT) )
LeadBitmap.ChangeViewPerspective(TOP_LEFT );
/* Specify a rectangle in the top left part of the displayed image */
XOffset = LeadBitmap.GetWidth() / 8;
XSize = LeadBitmap.GetWidth() / 3;
YOffset = LeadBitmap.GetHeight() / 8;
YSize = LeadBitmap.GetHeight() / 3;

/* Adjust the YOffset if the view perspective is bottom left */
if (LeadBitmap.GetViewPerspective() == BOTTOM_LEFT)
{
YOffset = LeadBitmap.GetHeight()- YOffset - YSize;
}
/* Allocate the buffer */
Buff.Reallocate(XSize * 3);
pBuf = (L_UCHAR L_FAR *)Buff.Lock();
/* Invert the colors of pixels in the rectangle */
LeadBitmap.Access();
for(i=YOffset; i < (YOffset + YSize); i++)
{
LeadBitmap.GetRowCol(&Buff, i, XOffset);
for(n=0; n < (XSize * 3); n++)
pBuf[n] = pBuf[n] ^ 0xFF;
LeadBitmap.PutRowCol(Buff, i, XOffset);
}
LeadBitmap.Release();


LBitmapBase::GetRowColCompressed

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::GetRowColCompressed(pLRunBuffer, nRow, nCol, uWidth, pWorkBuffer=NULL)

LBuffer L_FAR * pLRunBuffer; | /* pointer to an LBuffer object */
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 */
LBuffer L_FAR * pWorkBuffer; | /* pointer to an optional work buffer */

Retrieves a row (or part of a row) of 1-bit compressed data from a class objects bitmap. This function is available in the Document/Medical toolkits only.

Parameter | Description
pLRunBuffer | Pointer to an LBuffer object that will receive the retrieved 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 number of column from which to get the data. 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.
pWorkBuffer | A pointer to an optional work buffer. You can also pass NULL. 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 value returned by LBitmapBase::GetBytesPerLine

Returns

> 0 | The number of pixels processed.
< 1 | An error occurred. Refer to Return Codes.

Comments

Retrieves a row (or part of a row) of 1-bit compressed data from a class objects bitmap that has been loaded in its compressed format.

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

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowCol, LBitmapBase::GetRowCompressed, Class Members
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. */
LBitmapBase 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 */

LBuffer RunBuffer; /* Handle to the pRunBuffer */
LBuffer WorkBuffer; /* Handle to the pWorkBuffer */
L_INT i; /* Counters */
/* Load the bitmap, at 1 bit per pixel */
LeadBitmap.File()->SetFileName(pszFilename);
LeadBitmap.File()->LoadFile(1,0,LOADFILE_COMPRESSED | LOADFILE_ALLOCATE | LOADFILE_STORE);

/* This example does not work with rotated view perspectives */
if ( (LeadBitmap.GetViewPerspective() != TOP_LEFT) || (LeadBitmap.GetViewPerspective() != BOTTOM_LEFT) )
LeadBitmap.ChangeViewPerspective ( TOP_LEFT );

/* Specify a rectangle in the middle right part of the displayed image */
XOffset = LeadBitmap.GetWidth() / 3;
XSize = LeadBitmap.GetWidth() * 2 / 3;
YOffset = LeadBitmap.GetHeight() / 3;
YSize = LeadBitmap.GetHeight() / 3;
/* Adjust the YOffset if the view perspective is bottom left */
if (LeadBitmap.GetViewPerspective() == BOTTOM_LEFT)
{
YOffset = LeadBitmap.GetHeight() - YOffset - YSize;
}

/* Allocate the buffers */
RunBuffer.Reallocate( (XSize + 3) * 2);
WorkBuffer.Reallocate(LeadBitmap.GetBytesPerLine());
LeadBitmap.Access();
for(i=YOffset; i < (YOffset + YSize); i++)
{
LeadBitmap.GetRowColCompressed(&RunBuffer, i, XOffset, XSize, &WorkBuffer);
LeadBitmap.PutRowColCompressed(RunBuffer, i, XOffset, XSize/ 2,&WorkBuffer);
}
LeadBitmap.Release();
}


LBitmapBase::GetRowCompressed

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::GetRowCompressed(pLRunBuffer, nRow, nLines=1, pWorkBuffer=NULL)

LBuffer L_FAR * pLRunBuffer; | /* pointer to an LBuffer object */
L_INT nRow; | /* number of the first row to retrieve */
L_INT nLines; | /* the number of rows to retrieve */
LBuffer L_FAR * pWorkBuffer; | /* pointer to an optional work buffer */

Retrieves one or more rows of 1-bit compressed data from a class object’s bitmap that has been loaded in its compressed format. This function is available in the Document/Medical toolkits only.

Parameter | Description
pLRunBuffer | Pointer to an LBuffer object that will receive the retrieved row(s).
nRow | The number of the row to retrieve. The first row is 0 and the last row is 1 less than the bitmap height.
nLines | The number of lines to retrieve.
pWorkBuffer | A pointer to an optional work buffer. You can also pass NULL. 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 value returned by LBitmapBase::GetBytesPerLine.

Returns

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

Comments

Retrieves a row (or part of a row) of 1-bit compressed data from a class objects bitmap that has been loaded in its compressed format.

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

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowCol, LBitmapBase::GetRowColCompressed, Class Members
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
rows, and the ability to process rows in buffer-to-buffer processing.
The result of the function is the first 50 lines are inverted. */
void TestLoad(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
LBitmapBase LeadBitmap; /* Bitmap handle for the image */
LBuffer Buffer;
LBuffer RunBuffer;
L_INT nRow = 0; /* first row to get */
L_INT nYSize = 50; /* # of rows to get */

/* Load the bitmap, as compressed */
LeadBitmap.File()->SetFileName(pszFilename);
LeadBitmap.File()->LoadFile(1,0,LOADFILE_COMPRESSED | LOADFILE_ALLOCATE | LOADFILE_STORE);

/* 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. GetViewPerspective() != TOP_LEFT)|| (LeadBitmap.GetViewPerspective() != BOTTOM_LEFT) )
LeadBitmap.ChangeViewPerspective (TOP_LEFT );

if (LeadBitmap.GetViewPerspective()== BOTTOM_LEFT)
nRow = LeadBitmap.GetHeight() - nRow - nYSize;
/* Allocate the buffers */
Buffer.Reallocate((((LeadBitmap.GetWidth() + 31) &~31)/ 8) * nYSize);
RunBuffer.Reallocate((L_UINT32)((LeadBitmap.GetWidth() + 3) * 2) * nYSize);
/* Access the bitmap */
LeadBitmap.Access();
/* Get the top nRow lines */
LeadBitmap.GetRowCompressed (&RunBuffer, nRow, nYSize,0);
LeadBitmap.PutRowCompressed (RunBuffer, nRow, nYSize,0);
LeadBitmap.Release();
}


LBitmapBase::GetViewPerspective

#include "ltwrappr.h"

L_INT LBitmapBase::GetViewPerspective(void)

Retrieves the current view perspective of the class object’s bitmap.

Returns

The current view perspective for the bitmap. Possible values are:

Constant | Meaning
TOP_LEFT | [1] Top-left of image is first in memory.
BOTTOM_LEFT | [4] Bottom-left of image is first in memory.
RIGHT_TOP | [6] (Document/Medical only) First row is the right side, first column is top side.
TOP_LEFT90 | [6] (Document/Medical only) Same as RIGHT_TOP, which is TOP_LEFT rotated clockwise by 90 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.

Comments

Use this function to retrieve the current view perspective of the 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.

See Also

Elements: | Class Members
Topics: | Accounting for View Perspective

Example

LBitmapBase MyBitmap;
L_INT nVP;

MyBitmap.Load(TEXT("image1.cmp"));
nVP=MyBitmap.GetViewPerspective();


LBitmapBase::GetWidth

#include "ltwrappr.h"

L_INT LBitmapBase::GetWidth(void)

Retrieves the width of the bitmap.

Returns

The width of the bitmap.

Comments

Use this function to retrieve the width of the bitmap. This will take into consideration the current view perspective of the 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.

See Also

Elements:

LBitmapBase::GetHeight, Class Members

Example

LBitmapBase MyBitmap;
L_INT nWidth;

MyBitmap.Load(TEXT("image1.cmp"));
nWidth=MyBitmap.GetWidth();


LBitmapBase::GetXResolution

#include "ltwrappr.h"

L_INT LBitmapBase::GetXResolution(void)

Retrieves the X resolution of the bitmap.

Returns

The X resolution of the bitmap.

Comments

Use this function to retrieve the X resolution of the 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.

See Also

Elements:

LBitmapBase::GetYResolution, Class Members

Example

LBitmapBase MyBitmap;
L_INT nXRes;

MyBitmap.Load(TEXT("image1.cmp"));
nXRes=MyBitmap.GetXResolution();


LBitmapBase::GetYResolution

#include "ltwrappr.h"

L_INT LBitmapBase::GetYResolution(void)

Retrieves the Y resolution of the class object’s bitmap.

Returns

The Y resolution of the bitmap.

Comments

Use this function to retrieve the Y resolution of the 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.

See Also

Elements:

LBitmapBase::GetXResolution, Class Members

Example

LBitmapBase MyBitmap;
L_INT nYRes;

MyBitmap.Load(TEXT("image1.cmp"));
nYRes=MyBitmap.GetYResolution();


LBitmapBase::GrayScale

#include "ltwrappr.h"

virtual L_INT LBitmapBase::GrayScale(nBitsPerPixel=8)

L_INT nBitsPerPixel;

/* number of bits per pixel */

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

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

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 LBase::EnableStatusCallBack.

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

Element: | LBitmapBase::IsGrayScale, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);
if(MyBitmap.IsGrayScale()==GRAY_NO)
MyBitmap.GrayScale(8);


LBitmapBase::HasRgn

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::HasRgn(void)

Determines whether the bitmap has a region.

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 LBitmap::Posterize) 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 LBitmapRgn::Free function.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

LBitmapBase MyBitmap;
RECT Rect={10,10,200,300};

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);
/*……create a region for the bitmap…..*/
/*……….*/
if(MyBitmap.HasRgn())
MyBitmap.Free();


LBitmapBase::Initialize

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Initialize(nWidth=0, nHeight=0, nBitsPerPixel=0)

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 class object’s bitmap handle.

Parameter | Description
nWidth | Width of the image in pixels.
nHeight | Height of the image in pixels.
nBitsPerPixel | Number of bits per pixel in the image. Possible 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.
 | 2 | For a 12-bit image.
 | 6 | For a 16-bit image.
 | 4 | For a 24-bit image.
 | 2 | For a 32-bit image.
 | 8 | For a 48-bit image.
 | 4 | 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 toolkits.

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. LBitmapBase::Create is usually a better choice.

This function must be called before using LBitmapBase::Allocate. 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 toolkits.
DitherMethod | Set by the LBitmapBase::SetDefaultDithering 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 | Set in the LOADFILEOPTION.
YResolution | Set in the LOADFILEOPTION.

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.

See Also

Elements: | LBitmapBase::Allocate, Class Members
Topics: | Raster Image Functions: Creating and Deleting Images

Example

For an example, refer to LBitmapBase::Allocate.


LBitmapBase::Is1BitCompressed

#include "ltwrappr.h"

L_BOOL LBitmapBase::Is1BitCompressed(void)

Determines whether the class object’s bitmap data is 1-bit compressed in memory.

Returns

TRUE | The bitmap is a 1-bit compressed bitmap in memory.
FALSE | The bitmap is not a 1-bit compressed bitmap in memory.

Comments

Use this function to check if the bitmap data is 1-bit compressed in memory.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_BOOL bU1BC;

MyBitmap.Load(TEXT("image1.cmp"),1);
bU1BC=MyBitmap.Is1BitCompressed();


LBitmapBase::IsAllocated

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsAllocated(void)

Determines whether this class object has an allocated bitmap.

Returns

TRUE | The bitmap is allocated.
FALSE | The bitmap is not allocated.

Comments

Use this function to check whether this class object has an allocated 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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Deleting Images

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"));
if(MyBitmap.IsAllocated())
MyBitmap.Free();


LBitmapBase::IsAlwaysEndNotification

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::IsAlwaysEndNotification(void)

Determines whether the calling of the LBitmapBase::EndChanging member function is enabled or disabled for failed bitmap operations.

Returns

TRUE | The calling of the LBitmapBase::EndChanging member function is enabled on operation failure.
FALSE | The calling of the LBitmapBase::EndChanging member function is disabled on operation failure.

Comments

Call this function to check if the calling of the LBitmapBase::EndChanging member function is enable or disable for failed bitmap operations.

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.

See Also

Elements:

LBitmapBase::StartChanging, LBitmapBase::EndChanging, LBitmapBase::EnableChangeNotification, LBitmapBase::IsChangeNotificationEnabled, LBitmapBase::EnableAlwaysEndNotification, Class Members

Example

For an example, refer to LBitmapBase::EnableAlwaysEndNotification.


LBitmapBase::IsBitmapListLocked

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsBitmapListLocked(void)

Determines whether the bitmap list is locked.

Returns

TRUE | The bitmap list is locked.
FALSE | The bitmap list is not locked.

Comments

Call this function to check if the bitmap list is locked. If this class object was created using the LBitmapList::GetItem, LBitmapList::GetFirstItem, LBitmapList::GetLastItem, LBitmapList::GetPreviousItem, or LBitmapList::GetNextItem functions, then the bitmap list will be locked until you restore the bitmap to the list using the LBitmapList::SetItem function.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
LBitmapList BmpList;

/*add items to BmpList*/

BmpList.GetItem(1,&MyBitmap, sizeof(BITMAPHANDLE)) ;
if(MyBitmap.IsBitmapListLocked())
BmpList.SetItem(1,&MyBitmap) ;


LBitmapBase::IsChangeNotificationEnabled

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::IsChangeNotificationEnabled(void)

Determines whether the change notifications are enabled or disabled.

Returns

TRUE | Change notifications are enabled.
FALSE | Change notifications are disabled.

Comments

Call this function to check if the change notifications are enabled or disabled for the class object.

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.

See Also

Elements:

LBitmapBase::StartChanging, LBitmapBase::EndChanging, LBitmapBase::EnableChangeNotification, LBitmapBase::EnableAlwaysEndNotification, LBitmapBase::IsAlwaysEndNotification, Class Members

Example

For an example, refer to LBitmapBase::EnableChangeNotification.


LBitmapBase::IsClipboardReady

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::IsClipboardReady(void);

Determines whether the Windows clipboard contains an image that can be copied using the LBitmapBase::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
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

Elements: | LBitmapBase::CopyFromClipboard(), LBitmapBase::CopyToClipboard, Class Members
Topics: | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to LBitmapBase::CopyFromClipboard.


LBitmapBase::IsFileNameEnabled

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsFileNameEnabled(void);

Determines whether the use of the internal file name is enabled or disabled.

Returns

TRUE | The file name is enabled.
FALSE | The file name is not enabled.

Comments

Call this function to check if the use of the internal file name is enabled or disabled.

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.

See Also

Elements:

LBitmapBase::EnableFileName, Class Members

Example

LBitmapBase MyBitmap;

if(MyBitmap.IsFileNameEnabled())
MyBitmap.EnableFileName(FALSE);


LBitmapBase::IsGrayScale

#include "ltwrappr.h"

virtual L_INT LBitmapBase::IsGrayScale(void)

Returns an indicator that shows the kind of grayscale palette, if any, that a bitmap has.

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.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

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.

See Also

Elements: | LBitmapBase::GrayScale, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

For an example, refer to LBitmapBase::GrayScale.


LBitmapBase::IsInterlaced

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsInterlaced(void)

Determines whether the bitmap is interlaced or not.

Returns

TRUE | The bitmap is interlaced.
FALSE | The bitmap is not interlaced.

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.

See Also

Elements:

Class Members

Example

L_VOID MyFunc(LBitmapBase& Bitmap)
{
if(Bitmap.IsInterlaced())
MessageBox(NULL,TEXT("Bitmap Interlaced"), TEXT("Bitmap Interlaced"),MB_OK);
}


LBitmapBase::IsLocalSettingsEnabled

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsLocalSettingsEnabled(void)

Determines whether the local settings for the class object are enabled or disabled.

Returns

TRUE | The local settings are enabled.
FALSE | The local settings are disabled.

Comments

Use this function to check if the local settings for the class object are enabled or disabled.

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.

See Also

Elements:

LBitmapBase::EnableLocalSettings, Class Members

Example

For an example, refer to LBitmapBase::EnableLocalSettings.


LBitmapBase::IsMemoryLocked

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsMemoryLocked(void)

Determines whether the bitmap memory data is locked.

Returns

TRUE | The bitmap data memory is locked.
FALSE | The bitmap data memory is not locked.

Comments

Use this function to check whether the bitmap memory data is locked or not.

The bitmap memory must be locked before you can access the image data contained in the class object’s 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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_BOOL bLocked;

MyBitmap.Load(TEXT("image1.cmp"));
bLocked=MyBitmap.IsMemoryLocked();


LBitmapBase::IsPixelsSigned

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsPixelsSigned(void)

Determines whether the pixel values in the bitmap are signed.

Returns

TRUE | The pixel values in the bitmap are signed.
FALSE | The pixel values in the bitmap are not signed.

Comments

Call this function to check if the pixel values in the bitmap are signed.

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.

See Also

Elements:

Class Members

Example

For an example, refer to LBitmapBase::ClearNegativePixels.


LBitmapBase::IsPlayBackTransparencyEnabled

#include "ltwrappr.h"

virtual L_BOOL LBitmapBase::IsPlayBackTransparencyEnabled(void)

Determines whether the animation playback uses transparency.

Returns

TRUE | The animation playback uses transparency.
FALSE | The animation playback does not use transparency.

Comments

Call this function to check if the animation playback uses transparency.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_BOOL bPBTE;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

bPBTE=MyBitmap.IsPlayBackTransparencyEnabled();


LBitmapBase::IsPlayBackWaitUserInput

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsPlayBackWaitUserInput(void)

Determines whether the animation playback waits for user input.

Returns

TRUE | The animation playback waits for user input.
FALSE | The animation playback does not wait for user input.

Comments

Call this function to check if the animation playback waits for user input.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;
L_BOOL bPBWUI;
MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

bPBWUI=MyBitmap.IsPlayBackWaitUserInput();


LBitmapBase::IsProgressive

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsProgressive(void)

Determines whether the bitmap object is being loaded from a progressive JPEG or CMP file.

Returns

TRUE | An image is being loaded from a progressive JPEG or progressive CMP file.
FALSE | An image is being loaded from another type of file.

Comments

Call this function to check if the bitmap object is being loaded from a progressive JPEG or CMP file.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_BOOL bProgressive;
MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

bProgressive=MyBitmap.IsProgressive();


LBitmapBase::IsRedirectStatusCallBackEnabled

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsRedirectStatusCallBackEnabled(void)

Determines whether redirecting the status callback function to the bitmap object’s status callback is enabled or disabled.

Returns

TRUE | Redirecting the status callback function is enabled.
FALSE | Redirecting the status callback function is disabled.

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.

See Also

Elements:

Class Members

Example

For an example, refer to LBitmapBase::EnableRedirectStatusCallBack.


LBitmapBase::IsSuperCompressed

#include "ltwrappr.h"

virtual L_INT LBitmapBase::IsSuperCompressed(L_VOID)

Determines whether the class object’s bitmap is a super compressed bitmap or not.

Returns

TRUE | The bitmap is a super compressed one.
FALSE | The bitmap is not a super compressed one.

Comments

A super compressed bitmap is one that is kept compressed in memory. For more information, refer to Super Compressed Bitmaps.

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.

See Also

Functions: | Class Members
Topics: | Super Compressed Bitmaps

Example

L_VOID TestFunction(LBitmapBase & Bitmap)
{
if (Bitmap.IsSuperCompressed())
MessageBox(NULL, TEXT("It's a super compressed bitmap!"),
TEXT("Testing"), MB_OK);
else
MessageBox(NULL, TEXT("It's not a super compressed bitmap!"),
TEXT("Testing"), MB_OK);
}


LBitmapBase::IsTiled

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsTiled(void)

Determines whether the class object’s bitmap is a tiled bitmap.

Returns

TRUE | The bitmap is tiled.
FALSE | The bitmap is not tiled.

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.

See Also

Functions: | LBitmapBase::GetHandle, LBitmapBase::GetViewPerspective, LBitmapBase::HasRgn, LBitmapBase::IsGrayScale, LBitmapBase::IsInterlaced, LBitmapBase::IsPixelsSigned, Class Members
Topics: | Getting or Setting Bitmap Information
 | Raster Image Functions: Getting or Setting Bitmap Information

Example

LBitmapBase MyBitmap;
L_BOOL bTiled;

MyBitmap.Load(TEXT("image1.cmp"),1);
bTiled=MyBitmap.IsTiled ();


LBitmapBase::IsUsingConventionalMemory

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsUsingConventionalMemory(void)

Determines whether the bitmap data memory is allocated using conventional memory.

Returns

TRUE | The bitmap data is allocated using conventional memory.
FALSE | The bitmap data is not allocated using conventional memory.

Comments

Use this function to check if the bitmap data memory is allocated using conventional memory.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_BOOL bUCM;

MyBitmap.Load(TEXT("image1.cmp"));
bUCM=MyBitmap.IsUsingConventionalMemory();


LBitmapBase::IsUsingDiskMemory

#include "ltwrappr.h"

L_BOOL LBitmapBase::IsUsingDiskMemory(void)

Determines whether the bitmap data memory is allocated using the virtual (hard-disk) memory.

Returns

TRUE | The bitmap data is allocated using virtual memory on the hard-disk.
FALSE | The bitmap data is not allocated using virtual memory on the hard-disk.

Comments

Use this function to check if the bitmap data memory is allocated using the virtual (hard-disk) memory.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;
L_BOOL bUDM;

MyBitmap.Load(TEXT("image1.cmp"));
bUDM=MyBitmap.IsUsingDiskMemory();


LBitmapBase::Load

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Load(nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LBitmapBase::Load(nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)

virtual L_INT LBitmapBase::Load(pszFileName, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LBitmapBase::Load(pszFileName, nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)

L_TCHAR L_FAR * pszFileName; | /* name of the file to load */
L_INT nBitsPerPixel; | /* resulting bitmap’s pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps */
L_INT nPage; | /* the page number of the first image to be loaded */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads a bitmap image from disk into the class object. The image file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
pszFileName | Character string containing the name of the file to load.
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant bitmap
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmap
 | 24 | 24 bits per pixel in the resultant bitmap
 | 32 | 32 bits per pixel in the resultant bitmap
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 64 bits per pixel in the resultant bitmap
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 toolkits.
 | 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 toolkits 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 toolkits only.
nPage | The page number (for multi-page files) that contains the first image to be loaded. If the file is not a multi-page file, pass 0.
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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical 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.

The class object will free the bitmap when it is destroyed. If you wish to free the bitmap, use LBitmapBase::Free.

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.
Note: | For information on loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

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.

See Also

Elements: | LFile::Compact, LBitmapBase::Save, LBitmapBase::SetFileName, Class Members, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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 is an example for LBitmapBase::Load(nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL):

void CVCloadSave11Dlg::OnLBitmapBase_Load_1()
{
LBitmapBase BitmapBase;
BitmapBase.SetFileName(TEXT("d:\\work\\images\\eagle.jpg"));
BitmapBase.Load(0,ORDER_BGR,
 NULL);
BitmapBase.Save(FILE_TIF,
 1, 0, NULL);
}

This is an example for LBitmapBase::Load(nBitsPerPixel, nOrder, nPage, pFileInfo=NULL):

void CVCloadSave11Dlg::OnBUTTONLBitmapBaseLoad2()
{
LBitmapBase BitmapBase;
BitmapBase.SetFileName
 (TEXT("d:\\work\\images\\eagle.jpg"));
BitmapBase.Load
 (0,ORDER_BGR, 1);
BitmapBase.Save
 (FILE_TIF, 2, 0, 1, SAVE_OVERWRITE);
}

This is an example for LBitmapBase::Load(pszFileName, nBitsPerPixel=0,
 nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL,
 pFileInfo=NULL):

void CVCloadSave11Dlg::OnBUTTONLBitmapBaseLoad3()
{
LBitmapBase BitmapBase;
BitmapBase.Load
 (TEXT("d:\\ltwin14x\\images\\image1.cmp"), 0,ORDER_BGR, NULL);
BitmapBase.Save(TEXT("d:\\work\\images\\temp.tif"),
 FILE_TIF, 1, 0,NULL);
}

This is an example for LBitmapBase::Load(pszFileName, nBitsPerPixel, nOrder, nPage, pFileInfo=NULL):

void CVCloadSave11Dlg::OnBUTTONLBitmapbaseLoad4()
{
LBitmapBase BitmapBase;
BitmapBase.Load(TEXT("d:\\ltwin14x\\images\\image2.cmp"),
 0,ORDER_BGR, 1);
BitmapBase.Save(TEXT("d:\\work\\images\\temp.tif"),
 FILE_TIF, 2, 0,1, SAVE_OVERWRITE);
}


LBitmapBase::LoadResize

#include "ltwrappr.h"

virtual L_INT LBitmapBase::LoadResize(pszFile, nDestWidth, nDestHeight, nDestBits, uFlags, nOrder, pLoadOptions, pFileInfo)

virtual L_INT LBitmapBase::LoadResize(nDestWidth, nDestHeight, nDestBits, uFlags, nOrder, pLoadOptions, pFileInfo)

L_TCHAR * pszFile; | /* name of the file to load */
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 the class object's 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.

Parameter | Description
pszFile | Character string containing the name of the file to load.
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).
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
pLoadOptions | Pointer to a LOADFILEOPTION structure that contains 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo 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.

See Also

Functions: | LBitmapBase::Save, LBitmapBase::SetFileName, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LBitmapWindow::CreatePanWnd, LFileSettings::GetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewport2D
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

/* The following samples load and resize an image to 400 pixels high.
The width of the bitmap is determined by the aspect ratio.
Bicubic interpolation is used in the resize.
The bitmap is loaded at the original bits per pixel. */

// This is an example for the first version of the function
L_INT LoadBitmapResized1(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
return Bitmap.LoadResize(pszFile , 0, 400, 0, SIZE_BICUBIC,
ORDER_BGR, NULL, NULL);
}

// This is an example for the second version of the function
L_INT LoadBitmapResized2(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
Bitmap.SetFileName (pszFile);
return Bitmap.LoadResize(0, 400, 0, SIZE_BICUBIC, ORDER_BGR,
NULL, NULL);
}


LBitmapBase::PointFromBitmap

#include "ltwrappr.h"

virtual L_INT LBitmapBase::PointFromBitmap(nViewPerspective, px, py)

L_INT nViewPerspective; | /* 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 class object's bitmap view perspective to the specified view perspective.

Parameter | Description
nViewPerspective | 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

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.

See Also

Elements: | LBitmapBase::PointToBitmap, Class Members
Topics: | Accounting for View Perspective

Example

LBitmapBase MyBitmap;
L_INT npx=20, npy=30;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.PointFromBitmap(BOTTOM_LEFT, &npx, &npy);


LBitmapBase::PointToBitmap

#include "ltwrappr.h"

virtual L_INT LBitmapBase::PointToBitmap(nViewPerspective, px, py)

L_INT nViewPerspective; | /* 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 class object's bitmap view perspective.

Parameter | Description
nViewPerspective | 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

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.

See Also

Elements: | LBitmapBase::PointToBitmap, Class Members
Topics: | Accounting for View Perspective

Example

LBitmapBase MyBitmap;
L_INT npx=20, npy=30;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.PointToBitmap(BOTTOM_LEFT, &npx, &npy);


LBitmapBase::PutColors

#include "ltwrappr.h"

virtual L_INT LBitmapBase::PutColors(nIndex, nCount, pPalette)

L_INT nIndex; | /* index of the first color to update */
L_INT nCount; | /* number of colors to update */
LPRGBQUAD pPalette; | /* pointer to an array of RGBQUAD structures that contains the color values */

Updates part or all of the bitmap handle's palette with colors from your palette.

Parameter | Description
nIndex | The index of the first color to update.
nCount | The number of colors to update.
pPalette | Pointer to an array of RGBQUAD structures that contains the color values.

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 LBitmapBase::GetColors.

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.

See Also

Elements: | LBitmapBase::GetColors, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

LBitmapBase MyBitmap,Bitmap2;
RGBQUAD Colors[256];

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);

Bitmap2.SetFileName(TEXT("image2.cmp"));
Bitmap2.Load();

MyBitmap.GetColors(0, 255, Colors);
Bitmap2.PutColors(0, 255, Colors);


LBitmapBase::PutPixelColor

#include "ltwrappr.h"

virtual L_INT LBitmapBase::PutPixelColor(nRow, nCol, crColor)

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 in the class object's bitmap.

Parameter | Description
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 toolkits, 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 LBitmapBase::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.

This function always uses TOP_LEFT ViewPerspective coordinates to specify the pixel. Therefore, you do not have to 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

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.

See Also

Elements: | LBitmapBase::GetPixelColor, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LBitmapBase::GetPixelColor.


LBitmapBase::PutPixelData

#include "ltwrappr.h"

virtual L_INT LBitmapBase::PutPixelData(pData, nRow, nCol, nBytes)

L_VOID * pData; | /* pointer to a buffer */
L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
L_INT nBytes; | /* size of the buffer */

Changes the data of the specified pixel. No transformations are performed on the pixel data.

Parameter | Description
pData | Pointer to a buffer that contains the pixel data to set. This buffer should be able to store nBytes bytes.
nRow | The row number of the pixel.
nCol | The column number of the pixel.
nBytes | 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: (LBitmapBase::GetBitsPerPixel + 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 LBitmapBase::GetPixelData.

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.

See Also

Functions: | LBitmapBase::GetPixelData, LBitmapBase::GetPixelColor, LBitmapBase::Access, LBitmapBase::Release, LBitmapBase::GetRow, LBitmapBase::PutRow, LBitmapBase::GetRowCol, LBitmapBase::PutRowCol, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values
 | Processing an Image

Example

For an example, refer to LBitmapBase::GetPixelData.


LBitmapBase::PutRow

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::PutRow(LBuff, nRow)

LBuffer& LBuff; | /* an LBuffer object */
L_INT nRow; | /* number of the row to update */

Copies a row of image data from an LBuffer object, to a bitmap. The data is copied exactly as it is stored in the buffer. The buffer contains uncompressed data.

Parameter | Description
LBuff | An LBuffer object that contains the row 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.

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 LBitmapBase::Access to lock the memory before starting an operation that uses this function, then call LBitmapBase::Release 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 LBitmapBase::GetColorOrder. This value can be either ORDER_RGB, ORDER_BGR, or ORDER_GRAY.

The LBuff parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowCol, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For an example, refer to LBitmapBase::GetRow.


LBitmapBase::PutRowCol

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::PutRowCol (LBuff, nRow, nCol)

LBuffer& LBuff; | /* an LBuffer object that contains the image data */
L_INT nRow; | /* number of the row to update */
L_INT nCol; | /* column offset within the row to update */

Copies data from a buffer into a class object’s bitmap, with an offset to the bitmap. The data is copied exactly as it is stored in the buffer. The buffer contains uncompressed data.

Parameter | Description
LBuff | An LBuffer object that contains 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.

Returns

>=1 | The number of bytes put.
< 1 | An error occurred. Refer to Return Codes.

Comments

Copies data from a buffer to the class object's bitmap, with an offset to the bitmap. The buffer to which contains uncompressed data.

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.

You must consider the bits per pixel of the bitmap when specifying the 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.To speed up the operation then lock the bitmap memory when you use this function alot. Normally, you can call LBitmapBase::Access to lock the memory before starting an operation that uses this function, then call LBitmapBase::Release 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 either ORDER_RGB or ORDER_BGR.

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For an example, refer to LBitmapBase::GetRowCol.


LBitmapBase::PutRowColCompressed

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::PutRowColCompressed(LRunBuffer, nRow, nCol, uWidth, pWorkBuffer=NULL)

LBuffer& LRunBuffer; | /* an LBuffer object */
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 */
LBuffer L_FAR * pWorkBuffer; | /* pointer to an optional work buffer */

Puts a row (or part of a row) of 1-bit compressed data from a buffer into a class object's bitmap that is maintained in its compressed format. This function is available in Document/Medical toolkits only.

Parameter | Description
LRunBuffer | An LBuffer object that contains the row data.
nRow | The number of the row in which to put the data. 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 be placed in the row.
pWorkBuffer | A pointer to an optional work buffer. You can also pass NULL. 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 value returned by LBitmapBase::GetBytesPerLine.

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.

Note:

The LRunBuffer parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::GetRow, LBitmapBase::GetRowCol, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to LBitmapBase::GetRowColCompressed.


LBitmapBase::PutRowCompressed

#include "ltwrappr.h"

virtual L_INT32 LBitmapBase::PutRowCompressed(LRunBuffer, nRow, nLines=1, pWorkBuffer=NULL)

LBuffer& LRunBuffer; | /* an LBuffer object */
L_INT nRow; | /* number of the first row to update */
L_INT nLines; | /* number of the rows to update */
LBuffer L_FAR * pWorkBuffer; | /* pointer to an optional work buffer */

Puts one or more rows of 1-bit compressed data from a buffer into a class object's bitmap that is maintained in its compressed format. This function is available in Document/Medical toolkits only.

Parameter | Description
LRunBuffer | An LBuffer object that contains the row data.
nRow | The number of the row in which to put the data. The first row is 0, and the last row is 1 less than the bitmap height.
nLines | The number of rows to update.
pWorkBuffer | A pointer to an optional work buffer. You can also pass NULL. 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 value returned by LBitmapBase::GetBytesPerLine.

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.

Note:

The LRunBuffer parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::GetRow, LBitmapBase::PutRowColCompressed, LBitmapBase::GetRowCol, LBitmapBase::GetRowColCompressed, Class Members
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to LBitmapBase::GetRowCompressed.


LBitmapBase::RectFromBitmap

#include "ltwrappr.h"

virtual L_INT LBitmapBase::RectFromBitmap(nViewPerspective, pRect)

L_INT nViewPerspective; | /* destination view perspective */
LPRECT pRect; | /* pointer to the RECT structure to be translated */

Translates a Windows RECT structure from the class object's bitmap view perspective to the specified view perspective.

Parameter | Description
nViewPerspective | Destination view perspective to which the rectangle coordinates should be translated.
pRect | 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

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.

See Also

Elements: | LBitmapBase::RectToBitmap, LBitmapBase::PointFromBitmap, LBitmapBase::PointToBitmap, Class Members
Topics: | Accounting for View Perspective

Example

LBitmapBase MyBitmap;
RECT Rect={10,10,100,200};

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.RectFromBitmap(BOTTOM_LEFT, &Rect);


LBitmapBase::RectToBitmap

#include "ltwrappr.h"

virtual L_INT LBitmapBase::RectToBitmap(nViewPerspective, pRect)

L_INT nViewPerspective; | /* source view perspective*/
LPRECT pRect; | /* 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
nViewPerspective | Source view perspective from which the rectangle coordinates should be translated.
pRect | 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

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.

See Also

Elements: | LBitmapBase::RectToBitmap, LBitmapBase::PointFromBitmap, LBitmapBase::PointToBitmap, Class Members
Topics: | Accounting for View Perspective

Example

LBitmapBase MyBitmap;
RECT Rect={10,10,100,200};

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.RectToBitmap(BOTTOM_LEFT, &Rect);


LBitmapBase::Release

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Release(void)

Unlocks the memory allocated for the bitmap data.

Returns

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

Comments

Call this function to unlock the memory allocated for the bitmap data.

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.

See Also

Elements: | LBitmapBase::IsMemoryLocked, LBitmapBase::Access, LBitmapBase::ChangeHeight, LBitmapBase::PutRow, LBitmapBase::PutRowCol, LBitmapBase::PutRowCompressed, LBitmapBase::PutRowColCompressed, Class Members
Topics: | Raster Image Functions: Getting and Setting Pixel Values

Example

For an example, refer to LBitmapBase::GetRow.


LBitmapBase::Resample

This function has been removed. You can achieve the same functionality by calling LBitmapBase::SizeBitmap and passing SIZE_RESAMPLE for uFlags.


LBitmapBase::Resize

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Resize(pLBitmapDst, uStructSize, uFlags)

LBitmapBase L_FAR * pLBitmapDst; | /* pointer to a LBitmapBase bitmap object to be updated*/
L_UINT uStructSize; | /* size of the BITMAPHANDLE structure */
L_UINT uFlags; | /* flags that control the resize behavior */

Resizes the class object's bitmap and places the resized bitmap in the destination class object.

Parameter | Description
pLBitmapDst | Pointer to a LBitmapBase bitmap object that will be updated with the resized bitmap.
uStructSize | Size of the BITMAPHANDLE structure used by the object. Pass sizeof(BITMAPHANDLE).
uFlags | Flags that control the behavior when resizing the bitmap. Use one of the following:
 | 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

This function will use the width and height specified in the destination class object for the resize operation.

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.

See Also

Elements: | LBitmapBase::Resample, LBitmapBase::Size, LBuffer::StartResize, LBuffer::Resize, LBuffer::StopResize, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

LBitmapBase MyBitmap, ResizeBitmap;
RGBQUAD Colors[256];

MyBitmap.Load(TEXT("image1.cmp"));
MyBitmap.GetColors(0, 255, Colors) ;
ResizeBitmap.Create(100,100,24,ORDER_BGR, Colors,TOP_LEFT,TYPE_CONV);
MyBitmap.Resize(&ResizeBitmap, sizeof(BITMAPHANDLE), SIZE_NORMAL); //this will resize MyBitmap and put the resized image in ResizeBitmap


LBitmapBase::RestoreGlobalSettings

#include "ltwrappr.h"

L_VOID LBitmapBase::RestoreGlobalSettings(void)

Restores the global settings.

Returns

None

Comments

Call this function to restore the global settings. This is a protected function, that you can call internally in your code. This will restore the global settings which include the paint intensity, paint contrast, paint gamma, and display flags. This is only used if the local settings for the bitmap object are enabled. This function is called internally after painting the 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.

See Also

Elements:

LBitmapBase::SetLocalSettings, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members

Example

For an example, refer to LBitmapBase::SetLocalSettings.


LBitmapBase::Reverse

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Reverse(void);

Reverses the class object's bitmap (left to right) to produce a mirror 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 LBase::EnableStatusCallBack.

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.

See Also

Elements: | LBitmapBase::Flip, LBitmapBase::Rotate, LBitmapBase::RotateFine, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.Reverse();


LBitmapBase::ReverseViewPerspective

#include "ltwrappr.h"

virtual L_INT LBitmapBase::ReverseViewPerspective()

Performs a fast reverse operation by changing the bitmap's view perspective.

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 LBase::EnableStatusCallback.

This function is similar to LBitmapBase::RotateViewPerspective.

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.

See Also

Elements: | LBitmapBase::ChangeViewPerspective, LBitmapBase::GetViewPerspective, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

void LoadReverseViewPerspective (LBitmap * pBitmap)
{
/* Flip the bitmap */
pBitmap-> ReverseViewPerspective ();
}


LBitmapBase::Rotate

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Rotate(nAngle, uFlags=ROTATE_RESIZE, crFill=0)

L_INT nAngle; | /* hundredths of degreesto rotate (+/-) */
L_UINT uFlags; | /* resize indicator */
COLORREF crFill; | /* background fill color */

Rotates the class object's bitmap by the number of degrees specified.

Parameter | Description
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 black 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 LBase::EnableStatusCallBack.

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 LBitmapBase::GrayScale(8) to change the bitmap into a proper grayscale bitmap.

12-bit and 16-bit grayscale bitmaps that don’t have a palette. Grayscale bitmaps can have a palette if they have been loaded from certain DICOM images or if the LBitmap::WindowLevel function has been called. Call LBitmapBase::GrayScale(12) or LBitmapBase::GrayScale(16) if LBitmapBase::Rotate doesn’t seem to do any interpolation during the rotation.

16-bit color images

24-bit, 32-bit, 48-bit and 64-bit color images

For the other images, LBitmapBase::Rotate ignores the resampling flags and the rotate is performed without interpolation.

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.

See Also

Elements: | LBitmapBase::RotateFine, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Using Color Values in LEADTOOLS
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
if(MyBitmap.IsAllocated())
MyBitmap.Rotate(4500,ROTATE_RESIZE, RGB(255, 0, 0));


LBitmapBase::RotateFine

This function has been removed. You can achieve the same functionality by calling LBitmapBase::Rotate.


LBitmapBase::RotateViewPerspective

#include "ltwrappr.h"

virtual L_INT LBitmapBase::RotateViewPerspective(nAngle)

L_INT nAngle;

/* degrees of rotation */

Rotates the class object's bitmap by changing its view perspective. This function is available in Document/Medical toolkits only.

Parameter | Description
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

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.

See Also

Elements: | LBitmapBase::ChangeViewPerspective, LBitmapBase::GetViewPerspective, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

LBitmapBase MyBitmap,Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
MyBitmap.RotateViewPerspective(90);


LBitmapBase::Save

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Save(nFormat, nBitsPerPixel, nQFactor, uFlags=SAVE_OVERWRITE, pSaveFileOption=NULL)

virtual L_INT LBitmapBase::Save(pszFile, nFormat, nBitsPerPixel, nQFactor, nPageNumber, uFlags)

virtual L_INT LBitmapBase::Save(pszFile, nFormat, nBitsPerPixel, nQFactor, uFlags=SAVE_OVERWRITE, pSaveFileOption=NULL)

virtual L_INT LBitmapBase::Save(nFormat, nBitsPerPixel, nQFactor, nPageNumber, uFlags)

L_TCHAR L_FAR * pszFile; | /* output file name*/
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* Resulting file's pixel depth. */
L_INT nQFactor; | /* quality factor */
L_INT nPageNumber; | /* the page number */
L_UINT uFlags; | /* flag that indicates how to save a new page */
pSAVEFIlEOPTION pSaveOptions | /* pointer to optional extended save options */

Saves the class object's bitmap image to a file in any of the supported compressed or uncompressed formats.

Parameter | Description
pszFile | Character string containing the output file name.
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.
nPageNumber | Represents a page number in a multipage file. This parameter is used only if the uFlags parameter is SAVE_REPLACE or SAVE_INSERT. If uFlag is SAVE_REPLACE, nPageNumber represents the number of the page to replace (the first page is page 1). If uFlags is SAVE_INSERT, nPageNumber represents the number of the page in front of which the new page will be inserted. For example, if nPageNumber is 1 and uFlags is SAVE_INSERT, then the page you save will become the first page in the file.
uFlags | Flag that indicates how to save a new page in a multipage file that supports insert and replace operations. Possible values are:
 | Value | Meaning
 | SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten. This is comparable to bMultipage being FALSE in earlier versions.
 | SAVE_APPEND | [1] or [-1] The page is appended if the file exists.
 | SAVE_REPLACE | [2] Replace the page specified in the nPage.
 | SAVE_INSERT | [3] Insert the new page before the page specified in the nPage.
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 image will be saved to the file specified by the last call to LBitmapBase::SetFileName or to the file last loaded by LBitmapBase::Load.

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

The following file formats support append operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

FlashPix

AWD

Winfax

GIF

The following file formats support replace operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

The following file formats support insert operations:

TIFF (most TIFF formats, including JTIF but excluding EXIF)

PCX

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Elements: | LFile::Compact, LBitmapBase::Load, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Maintaining File Comments and Tags
 | Raster Image Functions: 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 an example of each form of LBitmapBase::Save, refer to LBitmapBase::Load.


LBitmapBase::SetAlpha

#include "ltwrappr.h"

virtual L_INT LBitmapBase::SetAlpha(LBitmapAlpha)

LBitmapBase& LBitmapAlpha;

/* an LBitmap object */

Replaces the class object's existing alpha channel data or creates new alpha channel data in the class object's bitmap using the specified class object's bitmap.

Parameter | Description
LBitmapAlpha | A bitmap object that has an allocated bitmap to be set as the alpha channel for the calling object’s bitmap.

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 the LEADTOOLS region processing functions, lets you use the alpha channel to implement transparency.

Only 16- and 32-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 LBitmapBase::ColorRes, if necessary, before calling this function.)

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

Note:

The LBitmapAlpha parameter is passed by reference, and is a required parameter.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Elements: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmapBase::CreateAlphaBitmap, Class Members
Topics: | Defining and Using a Bitmap Region
 | Implementing Transparency
 | Saving a Region

Example

LBitmapBase MyBitmap,
 Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(32); //load
 at 32 bit per pixel

Bitmap2.CreateAlphaBitmap(MyBitmap);
MyBitmap.Load(TEXT("image2.cmp"),32);
 //load at 32 bit per pixel
MyBitmap.SetAlpha(Bitmap2);


LBitmapBase::SetClipDstRect

#include "ltwrappr.h"

virtual L_INT LBitmapBase::SetClipDstRect(prcClipDst)

LPRECT prcClipDst;

/* pointer to a RECT structure */

Sets the destination clip rectangle.

Parameter | Description
prcClipDst | Pointer to a RECT structure for the new bitmap destination clip rectangle.

Returns

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

Comments

Use this function to set the destination clip rectangle for the class object.

For more information on source rectangles, destination rectangles and clipping rectangles, refer to Setting Rectangles .

This function is not working while being called from the classes LBitmapWindow, LAnimationWindow, or LAnnotationWindow.

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.

See Also

Elements: | LBitmapBase::GetRects, LBitmapBase::SetSrcRect, LBitmapBase::SetClipSrcRect, LBitmapBase::SetDstRect, Class Members
Topics: | Setting Rectangles

Example

For an example, refer to LBitmapBase::GetRects.


LBitmapBase::SetClipSrcRect

#include "ltwrappr.h"

virtual L_INT LBitmapBase::SetClipSrcRect(prcClipSrc)

LPRECT prcClipSrc;

/* pointer to a RECT structure */

Sets the clip source rectangle.

Parameter | Description
prcClipSrc | Pointer to a RECT structure for the new bitmap source clip rectangle.

Returns

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

Comments

Use this function to set the clip source rectangle for the class object.

For more information on source rectangles, destination rectangles and clipping rectangles, refer to Setting Rectangles .

This function is not working while being called from the classes LBitmapWindow, LAnimationWindow, or LAnnotationWindow.

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.

See Also

Elements: | LBitmapBase::GetRects, LBitmapBase::SetSrcRect, LBitmapBase::SetDstRect, LBitmapBase::SetClipDstRect, Class Members
Topics: | Setting Rectangles

Example

For an example, refer to LBitmapBase::GetRects.


LBitmapBase::SetDataPointer

#include "l_bitmap.h"

virtual L_INT LBitmapBase::SetDataPointer(pData, dwSize)

L_CHAR L_HUGE *pData; | /* data pointer */
L_UINT32 dwSize; | /* size of the data buffer pointed to by pData */

Sets the data pointer for the bitmap to the specified data pointer pData.

Parameter | Description
pData | Data pointer used to set the 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 LBitmapBase::CreateBitmap, or allocated by LBitmapBase::Allocate, 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. LBitmapBase::Free 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.

See Also

Functions: | LBitmapBase::Allocate, LBitmapBase::Create
Topics: | Raster Image Functions: Creating and Deleting Images

Example

#define BITMAP_WIDTH 256
#define BITMAP_HEIGHT 256
L_VOID Example57(HWND hWnd)
{
HGLOBAL hGlobal1, hGlobal2;
L_UCHAR *pBuffer1, *pBuffer2;
LBitmapBase BitmapBase;

//pBuffer1 points to raw data with 256 shades of red
//pBuffer2 points to raw data with 256 shades of green
hGlobal1 = GlobalAlloc(GMEM_MOVEABLE, BITMAP_WIDTH * BITMAP_HEIGHT * 3);
pBuffer1 = (L_UCHAR*)GlobalLock(hGlobal1);

hGlobal2 = GlobalAlloc(GMEM_MOVEABLE, BITMAP_WIDTH * BITMAP_HEIGHT * 3);
pBuffer2 = (L_UCHAR*)GlobalLock(hGlobal2);

L_INT iCol, iRow, iCounter;

iCounter = 0;
for(iCol = 0; iCol < BITMAP_WIDTH; iCol++)
for (iRow=0; iRow < BITMAP_HEIGHT; iRow++)
{
pBuffer1[iCounter + 0] = 0; //Blue
pBuffer1[iCounter + 1] = 0; //Green
pBuffer1[iCounter + 2] = iCol; //Red

pBuffer2[iCounter + 0] = 0; //Blue
pBuffer2[iCounter + 1] = iCol; //Green
pBuffer2[iCounter + 2] = 0; //Red

iCounter = iCounter + 3;
}
// this sets the image to be pBuffer1
BitmapBase.Create(
BITMAP_WIDTH,
BITMAP_HEIGHT,
24,
ORDER_BGR,
NULL,
TOP_LEFT,
TYPE_USER,
(L_UCHAR L_FAR*)pBuffer1,
BITMAP_WIDTH * BITMAP_HEIGHT * 3);
BitmapBase.Save(TEXT("d:\\Test1.bmp"), FILE_BMP, 24,2,0,NULL);

BitmapBase.SetDataPointer(pBuffer2, BITMAP_WIDTH * BITMAP_HEIGHT * 3);
BitmapBase.Save(TEXT("d:\\Test2.bmp"), FILE_BMP, 24,2,0,NULL);
}


LBitmapBase::SetDisplayMode

#include "ltwrappr.h"

L_INT LBitmapBase::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 LBitmapBase::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 LBitmapBase::SetDisplayMode Function for descriptions of the flags.

Returns

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

Comments

This will be the local display mode setting for the class object and is used when painting the bitmap.

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:

MyBitmapBase::SetDisplayMode(DISPLAYMODE_FASTPAINT | DISPLAYMODE_DITHEREDPAINT, DISPLAYMODE_FASTPAINT );

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.

See Also

Elements: | LBitmapBase::GetDisplayMode, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetDisplayMode(DISPLAYMODE_SCALETOGRAY, DISPLAYMODE_SCALETOGRAY);


LBitmapBase::SetDefaultDithering

#include "ltwrappr.h"

L_INT LBitmapBase::SetDefaultDithering(uMethod)

L_UINT uMethod;

/* the dithering mode to set */

Specifies the default dithering method to use when converting an image from 32, 24, or 16 bits per pixel to 8 bits per pixel or fewer.

Parameter | Description
uMethod | The dithering mode to be set for the bitmap. This is the local dithering mode for the class object and will not affect the global dithering mode. The dithering mode will be set when painting the bitmap. Possible 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.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to set the default dithering mode for the class object. The local setting will be set when painting the bitmap.

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

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.

See Also

Elements: | LBitmapBase::GetDefaultDithering, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
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

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetDefaultDithering(CLUSTERED_DITHERING);


LBitmapBase::SetDitheringMethod

#include "ltwrappr.h"

L_VOID LBitmapBase::SetDitheringMethod(uDitheringMethod)

L_UINT uDitheringMethod;

/* the dithering method to be used for the bitmap object */

Sets the dithering method for the class object's bitmap.

Parameter | Description
uDitheringMethod | The dithering method to be used for the bitmap object. Possible 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

None

Comments

Call this function set the dithering method for the class object's bitmap. This value can be different from the class object's default dithering method specified with LBitmapBase::SetDefaultDithering.

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.

See Also

Elements: | LBitmapBase::SetDitheringMethod, LBitmapSettings::DefaultDithering, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetDitheringMethod(CLUSTERED_DITHERING);


LBitmapBase::SetDstRect

#include "ltwrappr.h"

virtual L_INT LBitmapBase::SetDstRect(prcDst)

LPRECT prcDst;

/* pointer to a RECT structure */

Sets the destination rectangle.

Parameter | Description
prcDst | Pointer to a RECT structure for the new bitmap destination rectangle.

Returns

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

Comments

Use this function to set the destination rectangle for the class object.

For more information on source rectangles, destination rectangles and clipping rectangles, refer to Setting Rectangles .

This function is not working while being called from the classes LBitmapWindow, LAnimationWindow, or LAnnotationWindow.

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.

See Also

Elements: | LBitmapBase::GetRects, LBitmapBase::SetSrcRect, LBitmapBase::SetClipSrcRect, LBitmapBase::SetClipDstRect, Class Members
Topics: | Setting Rectangles

Example

For an example, refer to LBitmapBase::GetRects.


LBitmapBase::SetFileName

#include "ltwrappr.h"

L_VOID LBitmapBase::SetFileName(pszFileName)

L_TCHAR L_FAR * pszFileName;

/* the file name */

Sets the internal file used by the class object for loading and saving images on disk.

Parameter | Description
pszFileName | Character string containing the name of the file to be associated with the class object.

Returns

None

Comments

Call this function to set the internal file used by the class object for loading and saving images on disk.

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.

See Also

Elements:

Class Members

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();


LBitmapBase::SetHandle

#include "ltwrappr.h"

L_INT LBitmapBase::SetHandle(pBitmapHandle, bFreePrev=TRUE)

pBITMAPHANDLE pBitmapHandle; | /* pointer to a LEAD bitmap handle */
L_BOOL bFreePrev; | /* flag that indicates whether to free the previous bitmap */

Attaches a new LEAD bitmap handle to the LBitmapBase class object.

Parameter | Description
pBitmapHandle | Pointer to a LEAD bitmap handle that describes the bitmap to be attached to this object. This pointer will be invalidated if the function is successful, you can pass NULL if you only want to detach the current bitmap handle from the object.
bFreePrev | Flag that indicates whether to free the previous bitmap handle before attaching the new one. Possible values are:
 | Value | Meaning
 | TRUE | Free the previous bitmap handle before attaching the new one.
 | FALSE | Do not free the previous bitmap handle before attaching the new one.

Returns

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

Comments

Use this function to attach a new LEAD bitmap handle to this LBitmapBase class object. This function will call the LBitmapBase::StartChanging and LBitmapBase::EndChanging member functions before and after setting the bitmap handle.

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.

See Also

Elements:

LBitmapBase::GetHandle, LBitmapBase::StartChanging, LBitmapBase::EndChanging, Class Members

Example

LBitmapBase MyBitmap;
BITMAPHANDLE SomeBitmapHandle;

L_InitBitmap(&SomeBitmapHandle, sizeof(SomeBitmapHandle),50, 50, 8);

MyBitmap.Load(TEXT("bitmap1.cmp"));
//1-free the bitmap
MyBitmap.SetHandle(0,TRUE);

MyBitmap.Load(TEXT("bitmap1.cmp"));
//2-Set another LEAD bitmap handle and free the previous one
MyBitmap.SetHandle(&SomeBitmapHandle,TRUE);

MyBitmap.Load(TEXT("bitmap1.cmp"));
//3-attach new bitmap without freeing the previous one
MyBitmap.SetHandle(&SomeBitmapHandle,FALSE);


LBitmapBase::SetLocalSettings

#include "ltwrappr.h"

L_VOID LBitmapBase::SetLocalSettings(void)

Sets the local settings for the bitmap object.

Returns

None

Comments

Call this function to set the local settings for the bitmap object. This is a protected function, that you can call internally in your code. This will set the local settings for the class object's bitmap which include the paint intensity, paint contrast, paint gamma, and display flags. This is only used if the local settings for the bitmap object are enabled. This function is called internally when painting the class object's 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.

See Also

Elements:

LBitmapBase::RestoreGlobalSettings, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members

Example

class MyBitmap: public LBitmapBase
{
public:
~MyBitmap();
MyBitmap();
} ;

MyBitmap::MyBitmap()
{
if(IsLocalSettingsEnabled())
SetLocalSettings();
}

MyBitmap::~MyBitmap()
{
if(IsLocalSettingsEnabled())
RestoreGlobalSettings ();
}


LBitmapBase::SetPaintContrast

#include "ltwrappr.h"

L_INT LBitmapBase::SetPaintContrast(nValue)

L_INT nValue;

/* amount of contrast change */

Sets the paint contrast value used by painting operations. This value can be retrieved using the LBitmapBase::GetPaintContrast function.

Parameter | Description
nValue | The 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

Use this function to set the value to be used for the paint contrast. This is the local paint contrast for the class object and is used when painting the 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.

See Also

Elements: | LBitmapBase::GetPaintContrast, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintContrast(50);


LBitmapBase::SetPaintGamma

#include "ltwrappr.h"

L_INT LBitmapBase::SetPaintGamma(uValue)

L_UINT uValue;

/* the gamma value */

Sets the current gamma correction value for the class object’s bitmap. This value isused by painting operations and can be retrieved using the LBitmapBase::GetPaintGamma function.

Parameter | Description
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

This is the local paint gamma for the class object and is used when painting the bitmap.

Setting the gamma correction that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

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.

See Also

Elements: | LBitmapBase::GetPaintGamma, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintGamma(150);


LBitmapBase::SetPaintIntensity

#include "ltwrappr.h"

L_INT LBitmapBase::SetPaintIntensity(nValue)

L_INT nValue;

/* the amount to change the intensity */

Sets the current intensity value of the class object’s bitmap. This value is used by painting operations and can be retrieved using the LBitmapBase::GetPaintIntensity function.

Parameter | Description
nValue | The 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

This will be the local paint intensity setting for the class object and is used when painting the bitmap.

Setting the intensity value that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

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.

See Also

Elements: | LBitmapBase::GetPaintIntensity, LBitmapBase::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast
 | Raster Image Functions: Changing Brightness and Contrast

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintIntensity(50);


LBitmapBase::SetPalette

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPalette(hPalette)

HPALETTE hPalette;

/* handle to a palette */

Sets a new palette for the bitmap.

Parameter | Description
hPalette | Handle to a Windows palette.

Returns

None

Comments

Use this function to set a new palette for the bitmap. This palette will be used in the painting functions of the LPaint class and any other functions that use palettes.

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.

See Also

Elements: | LBitmapBase::GetPalette, LBitmapBase::DupPalette, LBitmapBase::CreatePaintPalette, LBitmapBase::GetFixedPalette, Class Members, LPaint
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

LBitmapBase MyBitmap,Bitmap2;
HPALETTE hPalette;
HDC hDC=GetDC(0);

MyBitmap.Load(TEXT("image1.cmp"),8);
Bitmap2.Load(TEXT("image2.cmp"),8);

Bitmap2.CreatePaintPalette(hDC);
hPalette=Bitmap2.DupPalette();

MyBitmap.SetPalette(hPalette);

ReleaseDC(0,hDC);


LBitmapBase::SetPlayBackBackGroundColor

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackBackGroundColor(crBackGround)

COLORREF crBackGround;

/* the background color */

Sets the background color for animation playback.

Parameter | Description
crBackGround | Background color for animation playback.

Returns

None

Comments

Call this function to set the 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.

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.

See Also

Elements: | LBitmapBase::GetPlayBackBackGroundColor, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackBackGroundColor(RGB(255,0,0));


LBitmapBase::SetPlayBackDelay

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackDelay(uDelay)

L_UINT32 uDelay;

/* Animation playback delay in milliseconds (ms)*/

Sets the animation playback delay in milliseconds (ms) for the class object's bitmap.

Parameter | Description
uDelay | Animation playback delay in milliseconds (ms).

Returns

None

Comments

Call this function to set the animation playback delay in milliseconds (ms) for the class object's 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.

See Also

Elements: | LBitmapBase::GetPlayBackDelay, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackDelay(500);


LBitmapBase::SetPlayBackDisposalMethod

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackDisposalMethod(uMethod)

L_UINT uMethod;

/* the animation playback disposal method */

Sets the animation playback disposal method.

Parameter | Description
uMethod | Animation playback disposal method. Possible values are:
 | Value | Meaning
 | PLAYDISPOSE_NONE | [0] Do nothing.
 | LAYDISPOSE_LEAVE | [1] Leave the target bitmap as is.
 | LAYDISPOSE_RESTOREBACKGROUND | [2] Restore the background.
 | LAYDISPOSE_RESTOREPREVIOUS | [3] Restore the previous image.

Returns

None

Comments

Call this function to set the animation playback disposal method.

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.

See Also

Elements: | LBitmapBase::GetPlayBackDisposalMethod, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | mplementing Animation

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackDisposalMethod(PLAYDISPOSE_RESTOREPREVIOUS);


LBitmapBase::SetPlayBackLeft

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackLeft(nLeft)

L_INT nLeft;

/* the left offset */

Sets the left offset for animation playback.

Parameter | Description
nLeft | The left offset for animation playback.

Returns

None

Comments

Call this function to set the left offset for animation playback.

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.

See Also

Elements: | LBitmapBase::GetPlayBackLeft, LBitmapBase::GetPlayBackTop, LBitmapBase::SetPlayBackTop, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackLeft(10);


LBitmapBase::SetPlayBackTop

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackTop(nTop)

L_INT nTop;

/* the top offset */

Sets the top offset for animation playback.

Parameter | Description
nTop | The top offset for animation playback.

Returns

None

Comments

Call this function to set the top offset for animation playback.

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.

See Also

Elements: | LBitmapBase::GetPlayBackLeft, LBitmapBase::SetPlayBackLeft, LBitmapBase::GetPlayBackTop, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackTop(20);


LBitmapBase::SetPlayBackTransparentColor

#include "ltwrappr.h"

L_VOID LBitmapBase::SetPlayBackTransparentColor(crTransparent)

COLORREF crTransparent;

/* the transparent color */

Sets the color to be used as the transparent color for the playback operation.

Parameter | Description
crTransparent | The color to be used as the transparent color for the playback operation.

Returns

None

Comments

Call this function to set the color to be used as the transparent color for the playback operation.

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

MyBitmap.SetPlayBackTransparentColor(RGB(255,0,0));


LBitmapBase::SetSrcRect

#include "ltwrappr.h"

virtual L_INT LBitmapBase::SetSrcRect(prcSrc)

LPRECT prcSrc;

/* pointer to a RECT structure */

Sets the source rectangle for the class object.

Parameter | Description
prcSrc | Pointer to a RECT structure for the new bitmap source rectangle.

Returns

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

Comments

Use this function to set the source rectangle for the class object.

For more information on source rectangles, destination rectangles and clipping rectangles, refer to Setting Rectangles .

This function is not working while being called from the classes LBitmapWindow, LAnimationWindow, or LAnnotationWindow.

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.

See Also

Elements: | LBitmapBase::GetRects, LBitmapBase::SetClipSrcRect, LBitmapBase::SetDstRect, LBitmapBase::SetClipDstRect, Class Members
Topics: | Setting Rectangles

Example

For an example, refer to LBitmapBase::GetRects.


LBitmapBase::SetViewPerspective

#include "ltwrappr.h"

L_VOID LBitmapBase::SetViewPerspective(nViewPerspective)

L_INT nViewPerspective;

/* the view perspective value */

Sets the view perspective value for the bitmap object.

Parameter | Description
nViewPerspective | The view perspective value. Possible values are:
Value | Meaning
TOP_LEFT | [0] Top-left of image is first in memory.
BOTTOM_LEFT | [2] Bottom-left of image is first in memory.
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_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

None

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.

See Also

Elements:

Class Members

Example

L_VOID MyFunc(LBitmapBase& Bitmap)
{
Bitmap.SetViewPerspective(TOP_LEFT);
}


LBitmapBase::SetXResolution

#include "ltwrappr.h"

L_VOID LBitmapBase::SetXResolution(nXRes)

L_INT nXRes;

/* the horizontal resolution value */

Sets the horizontal resolution value for the bitmap.

Parameter | Description
nXRes | The horizontal resolution value for the bitmap.

Returns

None

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.

See Also

Elements:

Class Members

Example

L_VOID MyFunc(LBitmapBase& Bitmap)
{
if(Bitmap.GetXResolution()<150)
Bitmap.SetXResolution(150);

if(Bitmap.GetYResolution()<150)
Bitmap.SetYResolution(150);
}


LBitmapBase::SetYResolution

#include "ltwrappr.h"

L_VOID LBitmapBase::SetYResolution(nYRes)

L_INT nYRes;

/* the vertical resolution value */

Sets the vertical resolution value for the bitmap.

Parameter | Description
nYRes | The vertical resolution value for the bitmap.

Returns

None

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.

See Also

Elements:

Class Members

Example

For an example, refer to LBitmapBase::SetXResolution.


LBitmapBase::Shear

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Shear(nAngle, bHorizontal=TRUE, crFill=0)

L_INT nAngle; | /* angle of slant */
L_BOOL bHorizontal; | /* flag that indicates the direction of the shear*/
COLORREF crFill; | /* COLORREF value for the fill color */

Moves the corners of the class object's bitmap in the fashion of a parallelogram.

Parameter | Description
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).
bHorizontal | Flag that indicates the direction of the shear. Possible values are:
 | Value | Meaning
 | TRUE | Horizontal shear.
 | FALSE | 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 LBase::EnableStatusCallBack.

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.

See Also

Elements: | LBitmapBase::Rotate, LBitmapBase::RotateFine, LBitmapBase::Flip, LBitmapBase::Reverse, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Using Color Values in LEADTOOLS

Example

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();
MyBitmap.Shear(2200,FALSE, RGB(220,120,220));


LBitmapBase::Size

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Size(nWidth, nHeight, uFlags=SIZE_NORMAL)

L_INT nWidth; | /* new width of the bitmap in pixels */
L_INT nHeight; | /* new height of the bitmap in pixels */
L_UINT32 uFlags; | /* flag that indicates how to resize */

Resizes the class object's bitmap to a new width and height.

Parameter | Description
nWidth | New width of the bitmap in pixels.
nHeight | New height of the bitmap in pixels.
uFlags | Flag that indicates how to resize the bitmap. 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 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

Call this function to change the size of the class object's bitmap.

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 LBitmapBase::Resize function.

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallBack.

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.

See Also

Elements: | LBitmapBase::Resample, LBitmapBase::Resize, LBuffer::StartResize, LBuffer::Resize, LBuffer::StopResize, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Processing an Image
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap;

MyBitmap.Load(TEXT("Image1.cmp"));
MyBitmap.Size(100,100); /*change the size of the bitmap object to 100x100 */
MyBitmap.Free();


LBitmapBase::StartChanging

#include "ltwrappr.h"

virtual L_INT LBitmapBase::StartChanging(nChangeType, nChangeCategory)

L_UINT nChangeType; | /* type of change */
L_UINT nChangeCategory; | /* the change category */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change to be done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

Returns

SUCCESS | Continue the operation without interrupting it.
< 1 | An error occurred. Refer to Return Codes. This will halt the operation and stop it.

Comments

This function is called by every function that affects the bitmap. You can override this function to have control over the different operations that are done to the bitmap. This function is called before doing any changes to the bitmap. If you want to cancel the operation, you can return an error code that is less than SUCCESS. If you return SUCCESS, the operation will continue executing. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

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.

See Also

Elements:

LBitmapBase::EndChanging, LBitmapBase::EnableChangeNotification, LBitmapBase::IsChangeNotificationEnabled, LBitmapBase::EnableAlwaysEndNotification, LBitmapBase::IsAlwaysEndNotification, Class Members

Example

class MyBitmap: public LBitmapBase
{
private:
L_BOOL m_bChanged;
virtual L_INT StartChanging(L_UINT nChangeType,L_UINT nChangeCategory);
virtual L_VOID EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode);

};

L_INT MyBitmap::StartChanging(L_UINT nChangeType,L_UINT nChangeCategory)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
/*the image is to be flipped*/
break;
/*
case ….:
do other things
*/
}

return(LBitmapBase::StartChanging(nChangeType,nChangeCategory));
}

L_VOID MyBitmap::EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
if(nRetCode==SUCCESS)
m_bChanged=TRUE;
break;
/*
case ….:
do other things
*/
}

LBitmapBase::EndChanging(nChangeType,nChangeCategory,nRetCode);
}


LBitmapBase::StartDithering

#include "ltwrappr.h"

virtual L_INT LBitmapBase::StartDithering(pPalette, uColors)

LPRGBQUAD pPalette; | /* pointer to the palette*/
L_UINT uColors; | /* number of colors used in the palette*/

Initializes the buffered dithering of a class object's bitmap. The dithering is then carried out by the LBitmapBase::DitherLine function and a callback function that you supply. It is ended by the LBitmapBase::StopDithering function. (Dithering is the process of using error diffusion to reduce the number of colors in an image.)

Parameter | Description
pPalette | Pointer to the palette that the LBitmapBase::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 255.

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:

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.

See Also

Elements: | LBitmapBase::DitherLine, LBitmapBase::StopDithering, Class Members
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 */
LBitmapBase LeadBitmap, TmpBitmap; /* to hold the loaded image */
LBuffer InBuf, OutBuf;
RGBQUAD FixedPalette[256]; /* Fixed palette */
int i; /* Loop counter */

/* Load the input bitmap, at 24 bits per pixel */
TmpBitmap.Load (TEXT("IMAGE3.CMP"), 24, ORDER_BGR);
/* Create the new bitmap */
LeadBitmap.Create(TmpBitmap.GetWidth(),TmpBitmap.GetHeight(),
8, /* 8 bits per pixel */
0, /* Color order is not used */
NULL, /* Use the fixed palette */
TmpBitmap.GetViewPerspective());
/* Allocate the input buffer for 24-bit data */
InBuf.Reallocate(TmpBitmap.GetBytesPerLine());
/* Allocate the output buffer for 8-bit data */
OutBuf.Reallocate(TmpBitmap.GetBytesPerLine());
/* Get the LEAD fixed palette for an 8-bit image */
TmpBitmap.GetFixedPalette(FixedPalette, 8);
/* Set the dithering method */
TmpBitmap.SetDitheringMethod ( STEVENSON_ARCE_DITHERING);
/* Initialize the dithering process */
TmpBitmap.StartDithering(FixedPalette, 256);
/* Use DitherLine to process each row in the bitmap */
LeadBitmap.Access();
TmpBitmap.Access();
for(i=0; i < TmpBitmap.GetHeight(); i++)
{
TmpBitmap.GetRow(&InBuf, i);
TmpBitmap.DitherLine(&InBuf, &OutBuf);
LeadBitmap.PutRow(OutBuf, i);
}
TmpBitmap.Release();
LeadBitmap.Release();

/* End the dithering process */
TmpBitmap.StopDithering();


LBitmapBase::StopDithering

#include "ltwrappr.h"

virtual L_INT LBitmapBase::StopDithering(void)

Cleans up all data variables and buffers allocated by the LBitmapBase::StartDithering and LBitmapBase::DitherLine functions. This function resets all internal variables to their default settings.

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 LBitmapBase::StartDithering.

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.

See Also

Elements: | LBitmapBase::StartDithering, LBitmapBase::DitherLine, Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

For an example, refr to LBitmapBase::StartDithering.


LBitmapBase::TranslateColor

#include "ltwrappr.h"

virtual COLORREF LBitmapBase::TranslateColor(LBitmapSrc, crColor)

LBitmapBase& LBitmapSrc; | /* the source bitmap object */
COLORREF crColor; | /* the color in the source bitmap */

Translates the specified color in the source class object's bitmap, and returns the nearest matching color in the calling object's bitmap.

Parameter | Description
LBitmapSrc | The source bitmap object.
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 LBitmapBase::GetPixelColor.

Returns

The COLORREF value or the palette index of the nearest matching color in calling object's bitmap. If the calling object's 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.

Note:

The LBitmapSrc paramater is passed by reference, and is a required parameter.

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.

See Also

Elements: | Class Members
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

LBitmapBase MyBitmap, Bitmap2;
MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(32); //load at 32 bit per pixel

COLORREF Color=MyBitmap.GetPixelColor(100,200);
Bitmap2.Load(TEXT("image2.cmp"));

Color=MyBitmap.TranslateColor(Bitmap2, Color);


LBitmapBase::Trim

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Trim(nCol, nRow, uWidth, uHeight)

virtual L_INT LBitmapBase::Trim(prcTrim)

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) */
LPRECT prcTrim; | /* pointer to a RECT structure */

Trims the class object's bitmap, resulting in a new 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
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).
prcTrim | Pointer to a RECT structure that contains information about the rctangle to keep.

Returns

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

Comments

Use this function instead of LBitmapBase::CopyRect 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

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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations

Example

This is an example for LBitmapBase::Trim(nCol, nRow, uWidth, uHeight):

LBitmapBase MyBitmap;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);
MyBitmap.Trim(10,15,100,200);

This is an example for LBitmapBase::Trim(RECT* prcTrim):

LBitmapBase MyBitmap;
RECT Rect={10,10,200,300};

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load(24);
MyBitmap.Trim(&Rect);


LBitmapBase::Underlay

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Underlay(LUnderlayBmp, uFlags=UB_TILE)

LBitmapBase& LUnderlayBmp; | /* an LBitmapBase object */
L_UINT uFlags; | /* flag that indicates the positioning of the underlying image */

Combines the source object's bitmap with the calling objects bitmap 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
LUnderlayBmp | The LBitmapBase object. This object’s bitmap will be used as an underlay for the calling object's bitmap.
uFlags | Flag that indicates how the underlying image is to be positioned. Possible values are:
 | Value | Meaning
 | UB_TILE | [0x00]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 LBase::EnableStatusCallBack.

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

Note: The lUnderlayBmp parameter is passed by reference, and is a required parameter.

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.

See Also

Elements: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::Clouds, LBitmap::ColoredBalls, LBitmap::DiffuseGlow, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::HalfTonePattern, LBitmap::MaskConvolution, LBitmap::MosaicTiles, LBitmap::Offset, LBitmap::Perspective, LBitmap::PlasmaFilter, LBitmap::Pointillist, LBitmap::RomanMosaic, LBitmap::Vignette, LBitmap::ZigZag, LBitmapBase::Combine, Class Members
Topics: | Raster Image Functions: Copying Images
 | Processing an Image
 | Applying Artistic Effects
 | Raster Image Functions: Processing an Image

Example

LBitmapBase MyBitmap,Bitmap2;

MyBitmap.SetFileName(TEXT("image1.cmp"));
MyBitmap.Load();

Bitmap2.SetFileName(TEXT("underlay.cmp"));
Bitmap2.Load();

MyBitmap.Underlay(Bitmap2, UB_TILE);


LBitmapList::LBitmapList

#include "ltwrappr.h"

L_VOID LBitmapList::LBitmapList(L_VOID)

L_VOID LBitmapList::LBitmapList(pBitmapList)

LBitmapList L_FAR * pBitmapList;

/* pointer to an LBitmapList object */

Constructs and initializes the member variables of an LBitmapList object.

Parameter | Description
pBitmapList | Pointer to a bitmap list object to be used for initializing the object.

Returns

None

Comments

LBitmapList::LBitmapList() is the default constructor for the LBitmapList class.

LBitmapList::LBitmapList(pBitmapList) constructor will initialize the class object's bitmap list from the passed object's bitmap list, and then invalidate the passed object.

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:

LBitmapList::~LBitmapList, Class Members

Example

This is an example for LBitmapList::LBitmapList():

L_VOID ConstructorSample()
{
LBitmapList bmpList;
// call create to have a valid LBitmapList object
bmpList.Create();
}

This is an example for LBitmapList::LBitmapList(pBitmapList):

L_VOID SecondConstructorSamples(HWND hWnd)
{
LBitmapList FirstList;
// call create to make the list valid
FirstList.Create();
//... load FirstList with data
LBitmapList SecondList(&FirstList);
}


LBitmapList::~LBitmapList

#include "ltwrappr.h"

virtual L_VOID LBitmapList::~LBitmapList(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None.

Comments

This is the destructor for the LBitmapList class.

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:

LBitmapList::LBitmapList, Class Members

Example

L_VOID DestructorSample(HWND hWnd)
{
// distructor will be called when bmpList variable is out of scope
LBitmapList bmpList;
// call create to have a valid LBitmapList object
bmpList.Create();
}


LBitmapList::ColorResItems

#include "ltwrappr.h"

virtual L_INT LBitmapList::ColorResItems(nBitsPerPixel, uFlags, pPalette=NULL, hPalette=NULL, uColors=0)

L_INT nBitsPerPixel; | /* number of bits per pixel */
L_UINT32 uFlags; | /* flag that indicates processing options */
LPRGBQUAD pPalette; | /* custom palette */
HPALETTE hPalette; | /* custom palette handle to use */
L_UINT uColors; | /* number of colors in the palette */

Converts all bitmaps in a class object's bitmap list from any bits-per-pixel to any bits-per-pixel. You can use this function to create an optimized palette for all bitmaps in the bitmap list.

Parameter | Description
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_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 LBitmapSettings::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_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.
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 palettein 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.

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: | Class Members
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

/* 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. */
L_VOID TestList(HWND hWnd, LBitmapList *pBitmapList, LPRGBQUAD TransparentColor)
{
HDC hdc; /* Device context of the current window */
L_UINT i; /* Loop counter */
L_UINT uCount; /* Number of bitmaps in the list */
LBitmap LeadBitmap; /* Bitmap handle for the target bitmap */
LBitmap TmpBitmap; /* Temporary bitmap for manipulating the list */
HPALETTE hpalPaint; /* Paint palette handle */

/* Change the hue of each bitmap in the list,
and restore the transparent color as the last color in the palette */
uCount = pBitmapList->GetItemsCount ();
for (i = 0; i < uCount; ++i)
{
pBitmapList->GetItem (i, &TmpBitmap,sizeof(TmpBitmap));
TmpBitmap.ChangeHue(i * 10);
TmpBitmap.PutColors(255, 1, TransparentColor);
pBitmapList->SetItem (i, &TmpBitmap);
}
/* Get an optimized palette for the whole list */
pBitmapList->ColorResItems (8, CRF_NODITHERING|CRF_OPTIMIZEDPALETTE, NULL, 0);

/* Update the paint palette that is used for playback */
pBitmapList->GetItem (0, &TmpBitmap,sizeof(TmpBitmap));
hdc = GetDC (hWnd);
hpalPaint = TmpBitmap.CreatePaintPalette (hdc);
ReleaseDC (hWnd, hdc);
/* Update the target bitmap's background color, based on the new palette */
LeadBitmap.SetPlayBackBackGroundColor (TmpBitmap.TranslateColor (LeadBitmap, LeadBitmap.GetPlayBackBackGroundColor ()));
/* Copy the new palette to the target bitmap */
LeadBitmap.SetPalette (TmpBitmap.DupPalette ());

}


LBitmapList::CopyItems

#include "ltwrappr.h"

virtual L_INT LBitmapList::CopyItems(LBitmapListSrc, uIndex, uCount)

LBitmapList& LBitmapListSrc; | /* an LBitmapList object */
L_UINT uIndex; | /* index of the first bitmap to copy */
L_UINT uCount; | /* number of bitmaps to copy */

Creates a new bitmap list in the class object by copying the specified bitmaps from an existing bitmap list in the source object. Bitmap handles and image data are copied.

Parameter | Description
LBitmapListSrc | Reference to the bitmap list object from which to copy the bitmaps.
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

If the calling object currently has a created bitmap list, this function will return an error.

The LBitmapListSrc parameter is passed by reference, and is a required parameter.

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: | Class Members
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. */
L_VOID TestCopyList(LBitmapList *pBitmapList)
{
LBitmapList NewList;
/* Copy all but the first two bitmaps of the incoming list */
NewList.CopyItems (*pBitmapList, 2, (L_UINT) -1);
// the list (pBitmapList) is copied in the NewList
//...
return;
}


LBitmapList::Create

#include "ltwrappr.h"

virtual L_INT LBitmapList::Create(L_VOID)

Creates a new bitmap list for the class object.

Returns

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

Comments

The class object must contain a valid bitmap list before you can use functions to insert, remove, or otherwise access bitmap list items.

You can create a bitmap list for the class object by doing one of the following:

calling LBitmapList::Create

calling the constructor LBitmapList(LBitmapList L_FAR* pBitmapList)

using the = operator

using LBitmapList::Load

calling LBitmapList::CopyItems

calling LBitmapList::SetBitmapList

calling LBitmapList::SetHandle.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

LBitmapBase LeadBitmap;

void TestFunction(HWND hWnd, L_TCHAR L_FAR* szFilename)
{
LBitmapList BmpList ; /* Bitmap list */
LPlayBack PlayBack ;
LBitmapBase TmpBitmap ; /* Temporary bitmap for building the list */
LAnimationWindow Animation ;
L_INT nMax = 160; /* Maximum width or height for bitmaps in the list */
HDC hdc; /* Device context of the current window */
RGBQUAD TmpPalette[1]; /* Palette to define the transparent color */
L_INT i; /* Loop counter */
L_UINT uState;
RECT rcUpdate,rcDisplay;
HPALETTE hPalette, hpalPaint;

/* Reduce memory requirements, if necessary. Only small bitmaps play smoothly. */
if (LeadBitmap.GetWidth()>nMax)
LeadBitmap. Resize (&LeadBitmap, sizeof(BITMAPHANDLE), SIZE_RESAMPLE);
else
if (LeadBitmap. GetHeight ()>nMax)
LeadBitmap.Resize(&LeadBitmap, sizeof(BITMAPHANDLE), SIZE_RESAMPLE);
/* Dither to an optimized palette, leaving the last color blank to use later for transparency */

LeadBitmap. ColorRes (8,CRF_FLOYDSTEINDITHERING|CRF_OPTIMIZEDPALETTE|CRF_IDENTITYPALETTE,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;
LeadBitmap.PutColors(255,1,TmpPalette);
/* Create the paint palette */
hdc = ::GetDC(hWnd);
hpalPaint = LeadBitmap. CreatePaintPalette (hdc);
::ReleaseDC(hWnd, hdc);

/* Set the playback flags that will apply to all bitmaps in the list */
LeadBitmap. EnablePlayBackWaitUserInput (FALSE);
LeadBitmap. EnablePlayBackTransparency (TRUE);
LeadBitmap. SetPlayBackLeft (0);
LeadBitmap. SetPlayBackTop (0);
LeadBitmap. SetPlayBackDelay (10);
LeadBitmap. SetPlayBackTransparentColor (PALETTEINDEX(255));
LeadBitmap. SetPlayBackDisposalMethod (PLAYDISPOSE_RESTOREBACKGROUND);
/* Create and populate the bitmap list */
BmpList.Create();
for (i = 0; i <= 36; ++ i)
{
TmpBitmap=LeadBitmap;
/* Rotate, using the transparent color as the fill color */
TmpBitmap. Rotate (1000*i,FALSE,PALETTEINDEX(255));
BmpList. InsertItem (&TmpBitmap);
}
/* Set the background color for the animation playback */
LeadBitmap. SetPlayBackBackGroundColor (RGB(0,0,255));
TmpBitmap=LeadBitmap;

/* Use the client area as the display rectangle */
::GetClientRect(hWnd,&rcDisplay);
/* Create and run the playback */
PlayBack.Create(&LeadBitmap,&BmpList);
do
{
uState=PlayBack.Process();
switch(uState)
{
case PLAYSTATE_POSTRENDER:
GetUpdateRect(hWnd, &rcUpdate,TRUE);
hdc = ::GetDC(hWnd);
if (hpalPaint)
{
hPalette = ::SelectPalette (hdc, hpalPaint, TRUE);
::RealizePalette(hdc);
}
PlayBack. GetBitmap ()->SetClipSrcRect(&rcUpdate);
PlayBack.GetBitmap()->SetDstRect(&rcDisplay);
PlayBack.GetBitmap()->SetClipDstRect(&rcDisplay);

PlayBack.GetBitmap()->Paint()->SetDC(hdc);
PlayBack.GetBitmap()->Paint()->PaintDC();
if(hpalPaint)
SelectPalette(hdc,hPalette,TRUE);
::ReleaseDC(hWnd, hdc);
break;
}
} while(uState != PLAYSTATE_END);

/* Clean up */
PlayBack. Destroy (0);
LeadBitmap=TmpBitmap;
return;
}


LBitmapList::DeleteItems

#include "ltwrappr.h"

virtual L_INT LBitmapList::DeleteItems(uIndex, uCount=1)

L_UINT uIndex; | /* index of the first bitmap to delete */
L_UINT uCount; | /* number of bitmaps to delete */

Deletes a set of bitmaps from the class object's bitmap list.

Parameter | Description
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

This removes the bitmaps from the class object's bitmap list and frees the bitmaps.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID DeleteItemsSamples(HWND hWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap;
L_TCHAR szDummyBuffer[50];
L_INT nCount;

BitmapList.Create ();
// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// Delete all items
BitmapList.DeleteItems (0, BitmapList.GetItemsCount ());
nCount = BitmapList.GetItemsCount ();
wsprintf(szDummyBuffer, TEXT("List contains %d items."), nCount);
MessageBox(hWnd, szDummyBuffer, TEXT("LBitmapList"), MB_OK);
}


LBitmapList::Destroy

#include "ltwrappr.h"

virtual L_INT LBitmapList::Destroy(L_VOID)

Destroys the existing bitmap list and free all items.

Returns

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

Comments

If you do not call this function, the bitmap list will be destroyed when the class object's destructor is called.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetCurrentIndex.


LBitmapList::GetBackgroundColor

#include "ltwrappr.h"

COLORREF LBitmapList::GetBackgroundColor(L_VOID)

Gets the global background color.

Returns

The global background color.

Comments

GlobalBackgroundColor is the background color of images in a multipage GIF file. This is used only if LBitmapList::HasGlobalBackground returns TRUE.

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: | Class Members
Topics: | Using Color Values in LEADTOOLS

Example

L_VOID TestGetGlobalBackground(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_BOOL bGlobalBackground;
COLORREF crBackground;

BitmapList.Load (pszFileName);
bGlobalBackground = BitmapList.HasGlobalBackground ();
if(bGlobalBackground ==TRUE)
crBackground = BitmapList.GetBackgroundColor ();
//...
}


LBitmapList::GetCurrentIndex

#include "ltwrappr.h"

L_UINT LBitmapList::GetCurrentIndex(L_VOID)

Gets the current index for the bitmap list object.

Returns

The current index for the bitmap list object.

Comments

The current index controls which item is returned when calling LBitmapList::GetNextItem and LBitmapList::GetPreviousItem.

Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.

Note: If the list is empty, this function will return 0.

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: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

L_VOID BitmapListSamples(HWND hWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap;

L_TCHAR szDummyBuffer[50];
L_UINT uCurrentIndex;

BitmapList.Create ();
// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// Set list to second item
BitmapList.SetCurrentIndex(2);
// get the current index
uCurrentIndex = BitmapList.GetCurrentIndex ();
wsprintf(szDummyBuffer, TEXT("This is item number %d in list."), uCurrentIndex);
MessageBox(hWnd, szDummyBuffer, TEXT("LBitmapList"), MB_OK);
// destroy bitmaplist
BitmapList.Destroy ();
}


LBitmapList::GetFirstItem

#include "ltwrappr.h"

L_INT LBitmapList::GetFirstItem(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Gets the first item of the bitmap list object.

Parameter | Description
pLBitmap | Pointer to an allocated bitmap object that will receive the first item of the bitmap list.

Returns

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

Comments

This function updates the current index to the first item in the list.

The bitmap handle that this function gets and attaches to the passed LBitmapBase object, is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.

You should not free the bitmap. Instead, use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

In order to use this function, you must first allocate an LBitmapBase object (or an object derived from LBitmapBase). Pass the address of the LBitmapBase object, and it will be filled with the item from the bitmap list.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID BitmapListSamples(HWND hWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap, PaintBitmap;
HDC hDC;
RECT rcClientRect;

// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.Create ();
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// Set the DC and the Destination rectangle
GetClientRect(hWnd, &rcClientRect);
hDC = GetDC(hWnd);
PaintBitmap.Paint()->SetDC(hDC);
PaintBitmap.SetDstRect(&rcClientRect);

// Get first item in the list
BitmapList.GetFirstItem(&PaintBitmap);
PaintBitmap.Paint()->PaintDC();
MessageBox(hWnd, TEXT("This is the first image in list.\nPress OK to display next item in List"), TEXT("LBitmapList"), MB_OK);
// Get next item in the list
BitmapList.GetNextItem (&PaintBitmap);
PaintBitmap.Paint()->PaintDC();
MessageBox(hWnd, TEXT("This is the first image in list.\nPress OK to display last item in List"), TEXT("LBitmapList"), MB_OK);
// Get last item in the list
BitmapList.GetLastItem (&PaintBitmap);
PaintBitmap.Paint()->PaintDC();
MessageBox(hWnd, TEXT("This is the last image in list.\nPress OK to display previous item in List"), TEXT("LBitmapList"), MB_OK);
// Get previous item in the list
BitmapList.GetPreviousItem (&PaintBitmap);
PaintBitmap.Paint()->PaintDC();
// destroy the list
BitmapList.Destroy ();
ReleaseDC(hWnd, hDC);

}


LBitmapList::GetGlobalHeight

#include "ltwrappr.h"

L_INT LBitmapList::GetGlobalHeight(L_VOID)

Gets the global height for the class object's bitmap list items.

Returns

The global height for the bitmap list items.

Comments

GlobalHeight is the height of images in a multipage GIF file.

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:

Class Members

Example

L_VOID TestGetHeight(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_INT nHeight;

BitmapList.Load (pszFileName);
nHeight = BitmapList.GetGlobalHeight ();
//...
}


LBitmapList::GetGlobalLoop

#include "ltwrappr.h"

L_UINT LBitmapList::GetGlobalLoop(L_VOID)

Gets the value of the global loop for the class object's bitmap list.

Returns

The value of the global loop for the bitmap list.

Comments

GlobalLoop is the loop count when playing an animation. 0 means continuous looping.

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:

Class Members

Example

L_VOID TestGlobalLoop(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_BOOL bHasGlobalLoop;
L_UINT uGlobalLoop;

BitmapList.Load (pszFileName);
bHasGlobalLoop = BitmapList.HasGlobalLoop ();
if(bHasGlobalLoop ==TRUE)
uGlobalLoop = BitmapList.GetGlobalLoop ();
//...
}


LBitmapList::GetGlobalWidth

#include "ltwrappr.h"

L_INT LBitmapList::GetGlobalWidth(L_VOID)

Gets the global width for the class object's bitmap list items.

Returns

The global width for the bitmap list items.

Comments

GlobalWidth is the width of images in a multipage GIF file.

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:

Class Members

Example

L_VOID TestGetWidth(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_INT nWidth;

BitmapList.Load (pszFileName);
nWidth = BitmapList.GetGlobalWidth ();
//...
}


LBitmapList::GetHandle

#include "ltwrappr.h"

HBITMAPLIST LBitmapList::GetHandle(L_VOID)

Gets the internal handle of the class object's bitmap list.

Returns

The internal handle of the bitmap list.

Comments

You can use this handle to allow another LBitmapList object to reference the same bitmap list. You can also use this handle is direct calls to the LEADTOOLS API functions that take HBITMAPLIST as a parameter.

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:

Class Members

Example

For an example, refer to LBitmapList::SetHandle.


LBitmapList::GetItem

#include "ltwrappr.h"

virtual L_INT LBitmapList::GetItem(uIndex, pLBitmap, uStructSize, bReflectIndex=TRUE)

L_UINT uIndex; | /* position of the bitmap in the list */
LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pLBitmap. */
L_BOOL bReflectIndex; | /* flag that indicates whether to set the current index to the passed index */

Gets an LBitmapBase object that references a bitmap in the class object's bitmap list.

Parameter | Description
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.
pLBitmap | Pointer to the bitmap object that will reference the bitmap in the list.
uStructSize | Size in bytes, of the structure pointed to by pLBitmap. Use sizeof(BITMAPHANDLE).
bReflectIndex | Flag that indicates whether to set the current index to the passed index. Possible values are:
 | Value | Meaning
 | TRUE | Set the class object’s current index to the passed index.
 | FALSE | Do not set the class object’s current index to the passed index.

Returns

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

Comments

The bitmap handle that this function gets and attaches to the passed LBitmapBase object is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.

You should not free the bitmap. Instead, use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID TestGetItem(HWND hWnd)
{
LBitmapList BitmapList;
LBitmap Bitmap;
L_INT nCount, i;

BitmapList.Create ();
// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

nCount = BitmapList.GetItemsCount ();
/* Change the hue of each bitmap in the list,
and restore the transparent color as the last color in the palette */
for (i = 0; i < nCount; ++i)
{
BitmapList.GetItem (i, &Bitmap, sizeof(BITMAPHANDLE));
Bitmap.ChangeHue(i * 10);
BitmapList.SetItem (i, &Bitmap);
}
//...
}


LBitmapList::GetItemsCount

#include "ltwrappr.h"

virtual L_UINT LBitmapList::GetItemsCount(L_VOID)

Gets the number of bitmaps in the class object's bitmap list.

Returns

The number of items in the bitmap list object.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::DeleteItems.


LBitmapList::GetLastItem

#include "ltwrappr.h"

L_INT LBitmapList::GetLastItem(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Gets the last item of the bitmap list object.

Parameter | Description
pLBitmap | Pointer to an allocated bitmap object that will receive the last item of the bitmap list.

Returns

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

Comments

This function updates the current index to the last item in the list.

The bitmap handle that this function gets and attaches to the passed LBitmapBase object is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.

You should not free the bitmap. Instead, use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

In order to use this function, you must first allocate an LBitmapBase object (or an object derived from LBitmapBase). Pass the address of the LBitmapBase object, and it will be filled with the item from the bitmap list.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetFirstItem.


LBitmapList::GetNextItem

#include "ltwrappr.h"

L_INT LBitmapList::GetNextItem(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Gets the next item of the bitmap list object.

Parameter | Description
pLBitmap | Pointer to an allocated bitmap object that will receive the next item of a bitmap list.

Returns

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

Comments

This function will retrieve the bitmap list item that succeeds the item at the current index, and increment the current index if successful. If there is no next item (the current index = the last item in the list) this function fills pLBitmap with the last item.

You can get the current index by calling LBitmapList::GetCurrentIndex.

The bitmap handle that this function gets and attaches to the passed LBitmapBase object is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.

You should not free the bitmap. Instead, use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

In order to use this function, you must first allocate an LBitmapBase object (or an object derived from LBitmapBase). Pass the address of the LBitmapBase object, and it will be filled with the item from the bitmap list.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetFirstItem.


LBitmapList::GetPalette

#include "ltwrappr.h"

LPRGBQUAD LBitmapList::GetPalette(L_VOID)

Gets a pointer to the global palette for the bitmap list items.

Returns

A pointer to the global palette for the bitmap list items.

GlobalPalette is the palette for images in a multipage GIF file.

This is used only if LBitmapList::HasGlobalPalette returns TRUE.

Comments

You should not attempt to free the memory pointed to by the pointer that this function returns.

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: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

L_VOID TestGetPalette(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
RGBQUAD *pPalette;

BitmapList.Load (pszFileName);
pPalette = BitmapList.GetPalette ();
//...
}


LBitmapList::GetPreviousItem

#include "ltwrappr.h"

L_INT LBitmapList::GetPreviousItem(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Gets the previous item of the bitmap list object.

Parameter | Description
pLBitmap | Pointer to an allocated bitmap object that will receive the previous item of a bitmap list.

Returns

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

Comments

This function will retrieve the bitmap list item that preceeds the item at the current index, and decrement the current index if successful. If there is no previous item (the current index = the first item in the list) this function fills pLBitmap with the first item.

You can get the current index by calling LBitmapList::GetCurrentIndex.

The bitmap handle that this function gets and attaches to the passed LBitmapBase object is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.

You should not free the bitmap. Instead, use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

In order to use this function, you must first allocate an LBitmapBase object (or an object derived from LBitmapBase). Pass the address of the LBitmapBase object, and it will be filled with the item from the bitmap list.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetFirstItem.


LBitmapList::GetViewPerspective

#include "ltwrappr.h"

L_INT LBitmapList::GetViewPerspective(L_VOID)

Gets the view perspective for the class object's bitmap list items.

Returns

The view perspective for the bitmap list items.

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: | Class Members
Topics: | Accounting for View Perspective

Example

L_VOID TestViewPerspective(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_INT nViewPerspective;

BitmapList.Load (pszFileName);
nViewPerspective = BitmapList.GetViewPerspective();
//...
}


LBitmapList::HasGlobalBackground

#include "ltwrappr.h"

L_BOOL LBitmapList::HasGlobalBackground(L_VOID)

Determines whether the class object's bitmap list has a global background color.

Returns

TRUE | The bitmap list has a global background color.
FALSE | The bitmap list does not have a global background color.

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:

Class Members

Example

L_VOID TestHasGlobalBackground(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
L_BOOL bGlobalBackground;

BitmapList.Load (pszFileName);
bGlobalBackground = BitmapList.HasGlobalBackground ();
//...
}


LBitmapList::HasGlobalLoop

#include "ltwrappr.h"

L_BOOL LBitmapList::HasGlobalLoop(L_VOID)

Determines whether the bitmap list has a global loop.

Returns

TRUE | The bitmap list has a global loop.
FALSE | The bitmap list does not have a global loop.

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:

Class Members

Example

For an example, refer to LBitmapList::GetGlobalLoop.


LBitmapList::HasGlobalPalette

#include "ltwrappr.h"

L_BOOL LBitmapList::HasGlobalPalette(L_VOID)

Determines whether the bitmap list has a global palette.

Returns

TRUE | The bitmap list has a global palette.
FALSE | The bitmap list does not have a global palette.

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:

Class Members

Example

L_VOID TestHasPalette(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
RGBQUAD *pPalette;
L_BOOL bHasPallete ;

BitmapList.Load (pszFileName);
bHasPallete = BitmapList.HasGlobalPalette ();
if(bHasPallete)
pPalette = BitmapList.GetPalette ();
//...
}


LBitmapList::InsertItem

#include "ltwrappr.h"

virtual L_INT LBitmapList::InsertItem(pLBitmap, uIndex=(L_UINT)-1);

LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
L_UINT uIndex; | /* position of the bitmap in the list */

Inserts the specified LBitmapBase object's associated bitmap into the class object's bitmap list, or appends the bitmap to the end of the bitmap list.

Parameter | Description
pLBitmap | Pointer to the bitmap object to insert.
uIndex | Position of the bitmap in the list. 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.

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, it is not a copy. Therefore, you should not free the bitmap that you pass in, but should instead manage the memory using the related bitmap list functions (LBitmapList::DeleteItems and LBitmapList::Destroy). This function will invalidate the passed LBitmapBase object before it returns. In order to reuse the LBitmapBase object, you must reinitialize it.

You cannot use this function to update a bitmap list while it is being used in an animation playback. Refer to the LPlayBack::Append function for more information.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetFirstItem.


LBitmapList::IsCreated

#include "ltwrappr.h"

virtual L_BOOL LBitmapList::IsCreated(L_VOID)

Determines whether a bitmap list has been created.

Returns

TRUE | A bitmap list has been created.
FALSE | A bitmap list has not been created.

Comments

The class object must contain a created bitmap list before you can use functions to insert, remove, or otherwise access bitmap list items.

You can create a bitmap list for the class object by doing one of the following:

calling LBitmapList::Create

calling the constructor LBitmapList(LBitmapList L_FAR* pBitmapList)

using the = operator

using LBitmapList::Load

calling LBitmapList::CopyItems

calling LBitmapList::SetBitmapList

calling LBitmapList::SetHandle.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID IsCreatedSamples(HWND hWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap;
L_BOOL bIsCreated;

BitmapList.Create ();
// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// get the internal handle
bIsCreated = BitmapList.IsCreated ();
if(bIsCreated == TRUE)
MessageBox(hWnd, TEXT("List created successfully"), TEXT("LBitmapList"), MB_OK);

// destroy the list
BitmapList.Destroy ();
}


LBitmapList::Load

#include "ltwrappr.h"

virtual L_INT LBitmapList::Load(lpszFile, nBitsTo=0, nColorOrder=ORDER_BGRORGRAY, pLoadOption=NULL, pFileInfo=NULL)

L_TCHAR L_FAR * lpszFile; | /* name of the file to load */
L_INT nBitsTo; | /* resulting pixel depth of bitmaps in the list */
L_INT nColorOrder; | /* the color order */
pLOADFIlEOPTION pLoadOption | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Creates a bitmap list in the class object and loads bitmaps from a multipage file into the list.

Parameter | Description
lpszFile | Character string containing the name of the file to load.
nBitsTo | Resulting pixel depth of bitmaps in the list. Possible values are:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant 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. Possible values are:
 | 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 toolkits only.
 | 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 toolkits 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 toolkits only.
pLoadOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

SUCCESS_ABORT | The method was successful, but one or more pages could not be loaded. This bitmap list contains the pages which could 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 Document/Medical toolkits only.

Note: More options are available in the LOADFILEOPTION structure.

Note: For information on 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.

See Also

Functions: | Class Members, LBitmapBase::GetLoadStatus, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::Save.


LBitmapList::operator[]

#include "ltwrappr.h"

LBitmapBase & LBitmapList::operator[](nIndex)

L_UINT nIndex;

/* the index of the item to access */

Use this operator to access the bitmap list as an array. nIndex specifies the index of the bitmap list item you wish to access.

Parameter | Description
nIndex | The index of the item to access.

Returns

Reference to the requested bitmap list item.

Comments

The bitmap handle this function gets and attaches to the returned LBitmapBase object is a copy of the bitmap handle stored internally in the list. You can use this to modify the bitmap list item directly.

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:

Class Members

Example

L_VOID MyFunction()
{
LBitmapList MyBitmapList;
MyBitmapList.Load(TEXT("eye.gif")) ;

for (L_UINT i=0;i<MyBitmapList.GetItemsCount();i++)
{
MyBitmapList[i].Flip();
}
}


LBitmapList::RemoveItem

#include "ltwrappr.h"

virtual L_INT LBitmapList::RemoveItem(uIndex, pRemovedBitmap)

L_UINT uIndex; | /* position of the bitmap in the list */
LBitmapBase L_FAR * pRemovedBitmap; | /* pointer to an LBitmapBase object */

Removes a bitmap from the list.

Parameter | Description
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.
pRemovedBitmap | Pointer to the bitmap object that references the removed bitmap. You can use this object 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 bitmap list and free the bitmap, you should use LBitmapList::DeleteItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID RemoveItemSamples(HWND hWnd)
{
LBitmapList BitmapList;
LBitmapBase Bitmap, PaintBitmap;
HDC hDC;
RECT rcClientRect;

// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.Create ();
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// Set the DC and the Destination rectangle
GetClientRect(hWnd, &rcClientRect);
hDC = GetDC(hWnd);
PaintBitmap.Paint()->SetDC(hDC);
PaintBitmap.SetDstRect(&rcClientRect);

// Remove an item and paint the removed item
BitmapList.RemoveItem (2, &PaintBitmap);
PaintBitmap.Paint()->PaintDC();

ReleaseDC(hWnd, hDC);
}


LBitmapList::Save

#include "ltwrappr.h"

virtual L_INT LBitmapList::Save(lpszFile, nFormat, nBits, nQFactor, pSaveFileOption=NULL)

L_TCHAR L_FAR * lpszFile; | /* output file name */
L_INT nFormat; | /* output file format */
L_INT nBits; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves the class object's bitmap list in a multi-page file.

Parameter | Description
lpszFile | Character string containing the output file name.
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 closest BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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.
pSaveFileOption | 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.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID TestLoadBitmapList(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList;
LBitmap Bitmap;
L_INT nCount, i;

BitmapList.Load (pszFileName);
nCount = BitmapList.GetItemsCount ();
/* Change the hue of each bitmap in the list,
and restore the transparent color as the last color in the palette */
for (i = 0; i < nCount; ++i)
{
BitmapList.GetItem (i, &Bitmap, sizeof(BITMAPHANDLE));
Bitmap.ChangeHue(i * 10);
BitmapList.SetItem (i, &Bitmap);
}
//...
BitmapList.Save (pszFileName, FILE_GIF, 8, 0, NULL);
}


LBitmapList::SetBitmapList

#include "ltwrappr.h"

L_VOID LBitmapList::SetBitmapList(pBitmapList)

LBitmapList L_FAR * pBitmapList;

/* pointer to an LBitmapList object */

Initializes the class object's bitmap list with the bitmap list from another LBitmapList object.

Parameter | Description
pBitmapList | Pointer to a bitmap list.

Returns

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

Comments

If the class object already has a created bitmap list when this function is called, the bitmap list will be destroyed before it is set to the passed object's bitmap list.

This function will invalidate the passed object before returning.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID TestSetBitmapList(L_TCHAR L_FAR * pszFileName)
{
LBitmapList BitmapList, NewBitmapList;

BitmapList.Load (pszFileName);
// Initialize the NewBitmapList object with the loaded one
NewBitmapList.SetBitmapList (&BitmapList);
//...
}


LBitmapList::SetCurrentIndex

#include "ltwrappr.h"

L_INT LBitmapList::SetCurrentIndex(uIndex)

L_UINT uIndex;

/* the current index to set */

Sets the current index for the bitmap list object.

Parameter | Description
uIndex | The current index to set for the bitmap list object.

Returns

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

Comments

The current index controls which item is returned when calling LBitmapList::GetNextItem and LBitmapList::GetPreviousItem.

Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9.

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:

Class Members

Example

For an example, refer to LBitmapList::GetCurrentIndex.


LBitmapList::SetHandle

#include "ltwrappr.h"

L_VOID LBitmapList::SetHandle(hList, pBListInfo=NULL, bFree=TRUE)

HBITMAPLIST hList; | /* the handle to the bitmap list to be set */
LPBLISTINFO pBListInfo; | /* pointer to a structure */
L_BOOL bFree; | /* flag that indicates whether to destroy the old bitmap list */

Sets a new bitmap list handle for the bitmap list object.

Parameter | Description
hList | The handle to the bitmap list to be set.
pBListInfo | Optional pointer to a structure of type BLISTINFO that holds additional information about the passed bitmap list handle.
bFree | Flag that indicates whether to destroy the old bitmap list. Possible values are:
 | Value | Meaning
 | TRUE | Destroy the old bitmap list.
 | FALSE | Do not destroy the old bitmap list.

Returns

None

Comments

Pass FALSE for bFree if the class object is referencing another object's bitmap list.

In this case, the owner of the bitmap list should free it when it is no longer needed.

If an LBitmapList object is referencing another object's bitmap list, you can use this function to set the object's internal handle to NULL so it will not attempt to free the bitmap list when its destructor is called.

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:

Class Members

Example

L_VOID BitmapListSamples(HWND )
{
LBitmapList BitmapList, SecondBitmapList;
LBitmapBase Bitmap;
HBITMAPLIST hBitmapList;

BitmapList.Create ();
// load three images and insert them in the list
Bitmap.Load(TEXT("image1.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image2.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);
Bitmap.Load(TEXT("image3.cmp"), 0,ORDER_BGR);
BitmapList.InsertItem (&Bitmap);

// get the internal handle
hBitmapList = BitmapList.GetHandle ();
// this will invalidate the original bitmaplist
// You have to set the handle of the first list to NULL
// so that when the SecondBitmapList is out of scope it will
// destroy the object
BitmapList.SetHandle (NULL, NULL, FALSE);
// Attach the list to the second LBitmapList object
SecondBitmapList.SetHandle (hBitmapList);
}


LBitmapList::SetItem

#include "ltwrappr.h"

virtual L_INT LBitmapList::SetItem(uIndex, pLBitmap, bReflectIndex=TRUE, puSetIndex=NULL)

L_UINT uIndex; | /* position of the bitmap in the list */
LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
L_BOOL bReflectIndex; | /* flag that indicates whether to set the class object's current index to the passed index */
L_UINT L_FAR * puSetIndex; | /* pointer to a variable to be updated */

Overwrites the internal bitmap handle of a bitmap in a list. Use this function with LBitmapList::GetItem to manipulate a bitmap in a list.

Parameter | Description
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.
pLBitmap | Pointer to the bitmap object that will overwrite the internal bitmap handle in the list.
bReflectIndex | Flag that indicates whether to set the class object's current index to the passed index. Possible values are:
 | Value | Meaning
 | TRUE | Set the class object's current index to the passed index.
 | FALSE | Do not set the class object's current index to the passed index.
puSetIndex | Optional pointer to a variable to be updated with the index where the bitmap is set.

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 LBitmapList::GetItem to get a copy of the internal handle, then do the image processing, then update the internal handle using LBitmapList::SetItem.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

You cannot set a bitmap that belongs to another bitmap list. Also, if the bitmap to be set is an item of the LBitmapList object, then it will be set at the same index specified when getting the bitmap.

The passed bitmap object will be invalidated after this operation.

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: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LBitmapList::GetItem.


LBitmapRgn::LBitmapRgn

#include "ltwrappr.h"

L_VOID LBitmapRgn::LBitmapRgn(void)

L_VOID LBitmapRgn::LBitmapRgn(pLBitmap, uCombineMode = L_RGN_SET)

LBitmapBase L_FAR * pLBitmap; | /* pointer to the LBitmapBase object */
L_UINT uCombineMode; | /* flag that indicates the action to take with the bitmap region */

Constructs an LBitmapRgn object.

Parameter | Description
pLBitmap | Pointer to the LBitmapBase object to be associated with the new LBitmapRgn object. All region functions will operate on the LBitmapBase object's bitmap.
uCombineMode | Flag that indicates the action to take with the bitmap region. For a list of possible values refer to Creating a Bitmap Region.

Returns

None

Comments

LBitmapRgn::LBitmapRgn(void) constructs an LBitmapRgn object.

LBitmapRgn::LBitmapRgn(pLBitmap, uCombineMode = L_RGN_SET) constructs an LBitmapRgn object and initializes it with the specified LBitmapBase object's bitmap and region, if one is defined. The uCombineMode parameter becomes the class object's region combine mode for any functions that set a 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.

See Also

Elements:

LBitmapRgn::~LBitmapRgn, Class Members

Example

This is an example for LBitmapRgn::LBitmapRgn(void):

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LBitmapRgn MyRgn;
//…
}

This is an example for LBitmapRgn::LBitmapRgn(pLBitmap, uCombineMode):

L_VOID TestFunction()
{
LBitmapBase LeadBitmap ;
LBitmapRgn *pMyRgn;

LeadBitmap.Load(TEXT("Image3.cmp"), 8, ORDER_BGR);
pMyRgn = new LBitmapRgn(&LeadBitmap,L_RGN_ANDNOTBITMAP);

// do process here
// ...

// call destructor for LBitmapRgn
delete pMyRgn ;
//…
}


LBitmapRgn::~LBitmapRgn

#include "ltwrappr.h"

virtual L_VOID LBitmapRgn::~LBitmapRgn(void)

Destroys the object and frees any resources associated with the object.

Returns

None

Comments

This is the destructor for the LBitmapRgn class.

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

Elements:

LBitmapRgn::LBitmapRgn, Class Members

Example

For an example, refer to LBitmapRgn::LBitmapRgn().


LBitmapRgn::BitmapHasRgn

#include "ltwrappr.h"

virtual L_BOOL LBitmapRgn::BitmapHasRgn(void)

Determines whether the associated class object's associated bitmap has a region.

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 LBitmap::Posterize) 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.

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

Elements: | LBitmapRgn::GetRgnArea, LBitmapRgn::IsPtInRgn, Class Members
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 LBitmapRgn::GetRgnBounds.


LBitmapRgn::CreateMaskFromBitmapRgn

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::CreateMaskFromBitmapRgn(pLBitmapMask)

LBitmapBase L_FAR * pLBitmapMask;

/* pointer to an LBitmapBase object */

Creates a 1-bit mask image from the region in the associated :LBitmapBase class object's bitmap.

Parameter | Description
pLBitmapMask | Pointer to an LBitmapBase object that will be updated with the mask bitmap.

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.

See Also

Elements: | LBitmapBase::CreateAlphaBitmap, LBitmapBase::SetAlpha, LBitmapRgn::SetRgnFromMask, Class Members
Topics: | Defining and Using a Bitmap Region
 | Implementing Transparency
 | Saving a Region

Example

For an example, refer to LBitmapRgn::SetRgnPolygon.


LBitmapRgn::CurveToBezier

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::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 GDI 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 GDI 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.

Note: It is not necessary to have a bitmap associated with the class object to use the 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.

See Also

Functions: | LBItmapRgn::SetRgnCurve, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Converting Curves

Example

L_VOID DrawCurve(HDC hDC, pCURVE pCurve)
{
L_INT nBezierPointsCount;
POINT * pBezierPoints;
LBitmapRgn Region;
int nPrevROP2;

// Determine the required number of POINT structures
Region.CurveToBezier(pCurve, &nBezierPointsCount, NULL);

pBezierPoints = new POINT[nBezierPointsCount];

// Get the Bezier points
Region.CurveToBezier(pCurve, &nBezierPointsCount, pBezierPoints);

nPrevROP2 = SetROP2(hDC, R2_NOT);

// Draw the curve
PolyBezier(hDC, pBezierPoints, nBezierPointsCount);

SetROP2(hDC, nPrevROP2);

delete [] pBezierPoints;
}


LBitmapRgn::Free

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::Free(void);

Removes the region from the associated class object's bitmap and frees any resources associated with that 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.

See Also

Elements: | Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap(200,300,ORDER_BGR);
LBitmapRgn Region(&MyBitmap);

if(Region.BitmapHasRgn())
Region.Free();

//…
}


LBitmapRgn::GetClipSegments

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::GetClipSegments(nRow, pSegmentBuffer, puSegmentCount)

L_INT nRow; | /* number of the row */
L_UINT * pSegmentBuffer; | /* pointer to a buffer */
L_UINT * puSegmentCount; | /* pointer to a variable to be updated */

Gets the segments contained in the region for a particular row.

Parameter | Description
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 height of the class object's associated bitmap.
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 filled values in the pSegmentBuffer.

Returns

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

Comments

To use this function, first call LBitmapRgn::SetRgnXForm with pXform set to NULL, and then use LBitmapRgn::GetRgnBounds to get the boundaries of the class object’s associated bitmap. 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 and puSegmentCount will be filled with the value 4. 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 LBitmapRgn::GetClipSegmentsMax. 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.

See Also

Functions: | LBitmapRgn::GetClipSegmentsMax, LBitmapRgn::GetRgnBounds, LBitmapRgn::SetRgnXForm, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

The following example sets the pixels of the first row inside a region to black.

L_VOID ClearFirstRow(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
LBitmapRgn Region;
L_UINT uSegments;
L_UINT * pSegments;
RECT rcRegion, rcClip;

Bitmap.Load(pszFile);
Region.SetBitmap(&Bitmap);
SetRect(&rcRegion,
Bitmap.GetWidth() / 4,
Bitmap.GetHeight() / 4,
3 * Bitmap.GetWidth() / 4,
3 * Bitmap.GetHeight() / 4);

Region.SetRgnRect(&rcRegion);

// Get the maximum number of elements in a row, so we
// know how big the array of segments should be.
Region.GetClipSegmentsMax(&uSegments);

// Allocate an array large enough to store the maximum
// number of segments. Note that LBitmapRgn::GetClipSegmentsMax
// 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 we know the first row
Region.SetRgnXForm(NULL);
Region.GetRgnBounds(&rcClip);

// Get the segments for the first row
Region.GetClipSegments(rcClip.top, pSegments, &uSegments);

// Do something with the segments:
// To keep this example simple, we will set
// the pixels in the segments to 0.
for (L_UINT i = 0; i < uSegments; i+=2)
for (L_UINT j = pSegments[i]; j < pSegments[i + 1]; j++)
Bitmap.PutPixelColor(rcClip.top, j, 0);

// Free the segments array
GlobalFreePtr(pSegments);
}


LBitmapRgn::GetClipSegmentsMax

#include "ltwrappr.h"

virtual L_INT32 LBitmapRgn::GetClipSegmentsMax(puMaxSegments)

L_UINT * puMaxSegments;

/* pointer to a variable to be updated */

Gets the number of elements required to hold the clip segments for any row in the class object's associated bitmap. Use this function in conjunction with LBitmapRgn::GetClipSegments.

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

See Also

Functions: | LBitmapRgn::GetClipSegments, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

For an example, refer to LBitmapRgn::GetClipSegments.


LBitmapRgn::GetRgnArea

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::GetRgnArea(puArea)

L_UINT32 L_FAR * puArea;

/* address of the variable to be updated */

Gets the total number of pixels in the associated class object's bitmap region.

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

See Also

Elements: | LBitmapRgn::BitmapHasRgn, LBitmapRgn::Free, LBitmapRgn::IsPtInRgn, Class Members
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 LBitmapRgn::GetRgnBounds.


LBitmapRgn::GetRgnBounds

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::GetRgnBounds(pRect)

LPRECT pRect;

/* address of the RECT structure to be updated */

Gets the bounding rectangle of the associated class object's bitmap region.

Parameter | Description
pRect | Address of the RECT variable to updated with the bounding rectangle.

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.

See Also

Elements: | LBitmapRgn::Offset, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

L_VOID TestFunction(HWND hWnd)
{
L_UINT32 dwArea ;
LBitmapBase MyBitmap(200,300,ORDER_BGR);
RECT rc, Rect={10,10,350,400};
MyBitmap.Load(TEXT("image1.cmp"));
LBitmapRgn Region(&MyBitmap);

Region.SetRgnRoundRect(&Rect,30,40); //set the round rect as a region
Region.GetRgnBounds(&rc);

// Get the number of pixels in the region
Region.GetRgnArea( &dwArea);

if (Region.BitmapHasRgn() == FALSE)
MessageBox(hWnd, TEXT("Bitmap has region"), TEXT("Region Error"), MB_OK);
}


LBitmapRgn::GetRgnCombineMode

#include "ltwrappr.h"

L_UINT LBitmapRgn::GetRgnCombineMode(void)

Gets the class object's region combination mode, which is used by the region functions.

Returns

The bitmap region combination mode. For descriptions of the possible values, 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.

See Also

Elements: | LBitmapRgn::SetRgnCombineMode, Class Members
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 LBitmapRgn::SetRgnPolygon.


LBitmapRgn::GetRgnHandle

#include "ltwrappr.h"

virtual HRGN LBitmapRgn::GetRgnHandle(void);

Creates a Windows region that is a snapshot of the associated class object's bitmap region.

Returns

The Windows region handle used by the class object's bitmap region.

Comments

If you want to assign a region from one bitmap to another, you must use the LBitmapRgn::GetRgnHandle function to get region from the first bitmap; then use the LBitmapRgn::SetRgnHandle 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:

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

See Also

Elements: | LBitmapRgn::SetRgnHandle, Class Members
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 LBitmapRgn::SetRgnPolygon.


LBitmapRgn::GetRgnXForm

#include "ltwrappr.h"

L_BOOL LBitmapRgn::GetRgnXForm(pXform)

pRGNXFORM pXform;

/* pointer to a region transform structure of type RGNXFORM */

Retrieves the region transform that is used by the region functions.

Parameter | Description
pXform | Pointer to a region transform structure of type RGNXFORM. This will be updated with the transform information.

Returns

TRUE | There is a valid region transform.
FALSE | There is not a region transform for the object.

Comments

Call this function to retrieve the region transform that is used by the region functions.

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

Elements: | LBitmapRgn::SetRgnXForm, Class Members
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 LBitmapRgn::SetRgnPolygon.


LBitmapRgn::HolesRemovalRgn

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::HolesRemovalRgn ()

Removes all the holes in a region. This function is available in the Document/Medical Toolkits.

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.

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.

See Also

Functions: | LBitmap::IntensityDetect, LBitmap::SpatialFilter, LBitmap::BinaryFilter, LBitmap::MaxFilter, LBitmap::MinFilter, LBitmapRgn::SetRgnMagicWand, LBitmap::Smooth, LBitmap::BorderRemove, LBitmap::InvertedText, LBitmap::DotRemove, LBitmap::HolePunchRemove
Topics: | Working with the Existing Bitmap Region
 | Raster Image Functions: Creating and Using a Region
 | Color Halftones and Halftone Images

Example

/* This example applies the holes removal filter */

void MyTestFunction(LBitmapRgn * LRgnWnd)

{

// you must use LBitmapRgn::SetRgnMagicWand

// before calling this function.

LRgnWnd->HolesRemovalRgn();

}


LBitmapRgn::IsPtInRgn

#include "ltwrappr.h"

virtual L_BOOL LBitmapRgn::IsPtInRgn(nRow, nCol)

virtual L_BOOL LBitmapRgn::IsPtInRgn(pPoint)

L_INT nRow; | /* row number of the pixel */
L_INT nCol; | /* column number of the pixel */
LPPOINT pPoint; | /* pointer to a structure of type POINT */

Determines whether the specified pixel is in the associated class object's bitmap region.

Parameter | Description
nRow | The row number of the pixel.
nCol | The column number of the pixel.
pPoint | Pointer to a structure of type POINT to be tested.

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.

See Also

Elements: | LBitmapRgn::BitmapHasRgn , LBitmapRgn::Free , LBitmapRgn::GetRgnArea, Class Members
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 LBitmapRgn::SetRgnRoundRect.


LBitmapRgn::IsValid

#include "ltwrappr.h"

virtual L_BOOL LBitmapRgn::IsValid(void)

Determines whether the region object is valid.

Returns

TRUE | The region object is ready to be used.
FALSE | The region object is not ready to be used.

Comments

Before you can use any of the region functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LBitmapRgn object, the object is considered invalid.

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

Elements:

LBitmapRgn::SetBitmap, Class Members

Example

For an example, refer to LBitmapRgn::SetRgnEllipse.


LBitmapRgn::Offset

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::Offset(nRowOffset, nColOffset)

L_INT nRowOffset; | /* number of rows to move the region */
L_INT nColOffset; | /* number of columns to move the region */

Moves the associated class object's bitmap region by the specified number of rows and columns. The move does not affect the pixels in the region.

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

See Also

Elements: | LBitmapRgn::GetRgnBounds, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap(200,300,ORDER_BGR);
LBitmapRgn Region(&MyBitmap);

if(Region.BitmapHasRgn())
Region.Offset(20,40);

//…
}


LBitmapRgn::ResizeRgn

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::ResizeRgn(uInflate, uFlag, bAsFrame)

L_UINT uInflate; | /* number of pixels by which to resize the region */
L_UINT uFlag; | /* flag */
L_BOOL bAsFrame; | /* flag */

Resizes the region defined in the class object's bitmap by the specified number of pixels.

Parameter | Description
uInflate | 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

LTDIS
LTFIL
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: | LBitmapBase::Resize, LBuffer::Resize, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
LBitmapRgn Region;
RECT rect = { Bitmap.GetWidth() / 4, Bitmap.GetHeight() / 4,
Bitmap.GetWidth() / 2, Bitmap.GetHeight() / 2 };

Bitmap.Load(szFile);
Region.SetBitmap(&Bitmap);
Region.SetRgnRect(&rect);

Bitmap.Invert();

Region.ResizeRgn(20, RGN_CONTRACT, FALSE);

Bitmap.Invert();
}


LBitmapRgn::SetBitmap

#include "ltwrappr.h"

virtual L_VOID LBitmapRgn::SetBitmap(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Sets an LBitmapBase object (or any object derived from LBitmapBase) to be used by the region functions.

Parameter | Description
pLBitmap | Pointer to an LBitmapBase object to be used by the region functions.

Returns

None

Comments

Before you can use any of the region functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LBitmapRgn object, the object is considered invalid.

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

Elements:

LBitmapRgn::IsValid, Class Members

Example

For an example, refer to LBitmapRgn::SetRgnPolygon.


LBitmapRgn::SetRgnBorder

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnBorder(x, y, crBorderColor, crLowerTolerance, crUpperTolerance)

L_INT x; | /* x coordinate */
L_INT y; | /* y coordinate */
COLORREF crBorderColor; | /* border color */
COLORREF crLowerTolerance; | /* lower tolerance values */
COLORREF crUpperTolerance; | /* upper tolerance values */

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

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.

To set the method used when combining the new and existing regions, call LBitmapRgn::SetRgnCombineMode. To determine the current method used when combining regions, call LBitmapRgn::GetRgnCombineMode.

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.

See Also

Functions: | LBitmapRgn::SetRgnMagicWand, LBitmapRgn::SetRgnCombineMode, LBitmapRgn::GetRgnCombineMode, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange
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(LBitmap * plBitmap, HWND hWnd, L_INT x, L_INT
 y, COLORREF crBorder)
{
L_INT nRet;
RGNXFORM Xform;
HDC hDC=NULL;
LPaint LeadPaint ;
LBitmapRgn LeadRegion(plBitmap);

plBitmap->PointToBitmap(TOP_LEFT,
 &x, &y);
if(plBitmap->HasRgn())
{
plBitmap->Region()->SetRgnCombineMode(L_RGN_OR);
nRet = plBitmap->Region()->SetRgnBorder(x, y,crBorder, (20,30,15),(15,30,10));
}
else
{
plBitmap->Region()->SetRgnCombineMode(L_RGN_SET);
nRet = plBitmap->Region()->SetRgnBorder(x, y,crBorder, (20,30,15),(15,30,10));
}

if(nRet == SUCCESS)
{
if(plBitmap->HasRgn())
{
ReleaseDC(hWnd, hDC);
LeadRegion.GetRgnXForm(&Xform);
Xform.uViewPerspective
 = TOP_LEFT;
Xform.nXScalarNum=1;
Xform.nXScalarDen=1;
Xform.nYScalarNum=1;
Xform.nYScalarDen=1;
Xform.nXOffset=0;
Xform.nYOffset=0;

hDC =GetDC(hWnd);
LeadPaint.SetDC(hDC) ;
LeadPaint. FrameRgn(L_FRAME_MOVING0,&Xform)
 ;

ReleaseDC(hWnd, hDC);
}
else
MessageBox(hWnd,
 TEXT("no rgn"), TEXT("error"), MB_OK);
}
return;
}


LBitmapRgn::SetRgnColor

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnColor(crColor)

COLORREF crColor;

/* color to use for the region */

Creates or updates the associated class object's bitmap region by adding a region that consists of all the pixels of a specified color.

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

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. | Set L_RGN_SETNOT for the CombineMode using LBitmapRgn::SetRgnCombineMode function, then call the LBitmapRgn::SetRgnColor function, with the transparent color in the crColor parameter.
2. | Call the LPaint::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.

See Also

Elements: | LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
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

L_VOID TestFunction()
{
LBitmapBase MyBitmap(200,300,ORDER_BGR);

MyBitmap.Load(TEXT("image1.cmp"));
LBitmapRgn Region(&MyBitmap);

Region.SetRgnColor(RGB(255,0,0));
 //set the red color as a region
}


LBitmapRgn::SetRgnColorHSVRange

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnColorHSVRange(hsvLower, hsvUpper)

HSVREF hsvLower; | /* minimum HSV color value */
HSVREF hsvUpper; | /* maximum HSV color value */

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

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, LBitmapRgn::SetRgnColorHSVRange could be used to set a region of all green colors including:

RGB(0,1,0) |  |
RGB(0,2,0) | RGB(1,2,1) |
RGB(0,3,0) | RGB(1,3,1) | RGB(2,3,2)
... | ... | ...
RGB(0,255,0) | RGB(1,255,1) | RGB(2,255,2)

The diagram below shows how S and V affect the color green (H = 85)

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.

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: | LBitmap::RemapHue, LBitmapRgn::SetRgnColorRGBRange, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a 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 SetHSVRgnExample(LBitmapRgn& rgn)
{
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 = rgn.SetRgnColorHSVRange(hsvLo,hsvHi);
return nRet;
}


LBitmapRgn::SetRgnColorRGBRange

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnColorRGBRange(crLower, crUpper)

COLORREF crLower; | /* minimum RGB color value */
COLORREF crUpper; | /* maximum RGB color value */

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
crLower | COLORREF value 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 value 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.

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 LBitmapRgn::SetRgnColorHSVRange.

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.

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: | LBitmap::RemapHue, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect
Topics: | Raster Image Functions: Creating and Using a Region
 | Working with the Existing Bitmap Region
 | 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 SetRGBRgnExample(LBitmapRgn& rgn)
{
COLORREF rgbLo, rgbHi;
L_INT nRet;

rgbLo = RGB(1,0,0);
rgbHi = RGB(255,0,0);

nRet = rgn.SetRgnColorRGBRange(rgbLo,rgbHi);
return nRet;
}


LBitmapRgn::SetRgnCombineMode

#include "ltwrappr.h"

L_UINT LBitmapRgn::SetRgnCombineMode(uCombineMode)

L_UINT uCombineMode;

/* the new region combination mode */

Sets the class object's region combination mode, which is used by the region functions.

Parameter | Description
uCombineMode | The new region combination mode. For descriptions of the possible values, refer to Creating a Bitmap Region.

Returns

The previous region combine mode setting.

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

Elements: | LBitmapRgn::GetRgnCombineMode, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Creating a Bitmap Region

Example

For an example, refer to LBitmapRgn::SetRgnPolygon.


LBitmapRgn::SetRgnCurve

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnCurve(pCurve)

pCURVE pCurve;

/* pointer to a structure */

Creates or updates the region of the class object's associated bitmap by adding a curved region.

Parameter | Description
pCurve | Pointer to the CURVE structure that specifies the curve region. The structure is specified using device context coordinates, and LEADTOOLS translates the coordinates using the values specified in the LBitmapRgn::SetRgnXForm parameter.

Returns

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

Comments

To update an existing region, use the LBitmapRgn::SetRgnCombineMode function to 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.

See Also

Functions: | LBitmapRgn::CurveToBezier, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
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

L_VOID InvertCurvedRegion(LBitmap & Bitmap)
{
CURVE curve;
POINT pt[5];
L_INT nWidth = Bitmap.GetWidth();
L_INT nHeight = Bitmap.GetHeight();
LBitmapRgn Region;

pt[0].x = nWidth / 4;
pt[0].y = nHeight / 4;
pt[1].x = nWidth / 4;
pt[1].y = 3 * nHeight / 4;
pt[2].x = 3 * nWidth / 4;
pt[2].y = 3 * nHeight / 4;
pt[3].x = nWidth / 2;
pt[3].y = nHeight / 2;
pt[4].x = 3 * nWidth / 4;
pt[4].y = nHeight / 4;

curve.uStructSize=sizeof(CURVE);
curve.nType = CURVE_STANDARD;
curve.nPointCount = sizeof(pt) / sizeof(pt[0]);
curve.pPoints = pt;
curve.uFillMode = L_POLY_WINDING;
curve.dTension = 0.5;
curve.nClose = CURVE_CLOSE;
curve.nReserved = 0;

Region.SetBitmap(&Bitmap);

Region.SetRgnCurve(&curve);

Bitmap.Invert();

Region.Free();
}


LBitmapRgn::SetRgnEllipse

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnEllipse(pRect)

LPRECT pRect;

/* pointer to the bounding rectangle of the region */

Creates or updates the associated class object's bitmap region by adding an elliptical region.

Parameter | Description
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 set using LBitmapRgn::SetRgnXForm.

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.

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

Elements: | LBitmapRgn::SetRgnColor, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap(200,300,ORDER_BGR);
RECT Rect={10,10,50,200};
MyBitmap.Load(TEXT("image1.cmp"));
LBitmapRgn Region(&MyBitmap);

// check if the bitmap region is valid or not
if (Region.IsValid()
 == FALSE)
Region.SetBitmap(&MyBitmap)
 ;

Region.SetRgnEllipse(&Rect);
 //set the ellipse as a region

//…
}


LBitmapRgn::SetRgnFromMask

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnFromMask(LBitmapMask)

LBitmapBase& LBitmapMask;

/* the LBitmapBase object to be used as a mask */

Creates or updates the associated class object's bitmap region by adding a region that consists of all the white pixels in a 1-bit mask image.

Parameter | Description
LBitmapMask | The 1-bit black-and-white bitmap object used as a mask.

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.

The LBitmapMask parameter is passed by reference and is a required parameter.

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

Elements: | LBitmapBase::CreateAlphaBitmap, LBitmapBase::SetAlpha, LBitmapRgn::CreateMaskFromBitmapRgn, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Defining and Using a Bitmap Region
 | Saving a Region

Example

For an example, refer to LBitmapRgn::SetRgnPolygon.


LBitmapRgn::SetRgnHandle

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnHandle(hRgn)

HRGN hRgn;

/* handle to the Windows region */

Creates or updates the associated class object's bitmap region by adding a region that is specified by a Windows region handle.

Parameter | Description
hRgn | Handle to the Windows region.

Returns

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

Comments

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 LBitmapRgn::GetRgnHandle function to get region from the first bitmap; then use the LBitmapRgn::SetRgnHandle 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.

See Also

Elements: | LBitmapRgn::GetRgnHandle, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
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 an example, refer to LBitmapRgn::SetRgnPolygon.


LBitmapRgn::SetRgnMagicWand

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnMagicWand(x, y, uTolerance, crLowerTolerance, crUpperTolerance)

L_INT x; | /* x coordinate */
L_INT y; | /* y coordinate */
COLORREF crLowerTolerance; | /* lower tolerance values */
COLORREF crUpperTolerance; | /* upper tolerance values */

Sets a region in the associated class object's bitmap based on the color found at point x, y in the region.

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

Returns

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

Comments

For color bitmaps:

If the value at pixel (x, y) is (125, 125, 125) and crLowerTolerance is (20, 30, 15) the lower stopping point is (105, 95, 110). If crUpperTolerance is (10, 25, 20), then the upper stopping point is (135, 150, 145). Pixels with values of (105, 95, 110) up to (135, 150, 145) will be included in the region.

For gray scale bitmaps:

The minimum channel tolerance value of crLowerTolerance will be used to set the lower stopping point, and the value of crUpperTolerance will be used to set the upper stopping point. For example, if the value of the pixel at (x, y) is (125, 125, 125) and crLowerTolerance is (20,30,15), the smallest value of the triplet (15) will be used to create the lower stopping point of (110,110,110). If crUpperTolerance is (10,25,20), the smallest value of that triplet (10) will be used to create the upper stopping point of (135,135,135).

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.

To set the method used when combining the new and existing regions, call LBitmapRgn::SetRgnCombineMode. To determine the current method used when combining regions, call LBitmapRgn::GetRgnCombineMode.

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.

See Also

Functions: | LBitmapRgn::SetRgnBorder, LBitmapRgn::SetRgnCombineMode, LBitmapRgn::GetRgnCombineMode, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange
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 MyTestFunction(LBitmapBase L_FAR *pBitmap, HWND hWnd,
 L_INT x, L_INT y)
{
LPaint LeadPaint ;
LBitmapRgn LeadRegion(pBitmap);
RGNXFORM Xform;
HDC hDC=NULL;

pBitmap->PointToBitmap(TOP_LEFT,
 &x, &y);
LeadRegion.SetRgnMagicWand(x,
 y, (20,30,15),(15,30,10));

LeadRegion.GetRgnXForm(&Xform);
Xform.uViewPerspective = TOP_LEFT;

hDC = GetDC(hWnd);
LeadPaint.SetDC(hDC)
 ;
LeadPaint.
 FrameRgn(L_FRAME_MOVING0,&Xform) ;

ReleaseDC(hWnd, hDC);
}


LBitmapRgn::SetRgnPolygon

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnPolygon(pPoints, uPoints, uFillMode=L_POLY_WINDING)

POINT L_FAR * pPoints; | /* pointer to an array of POINT structures */
L_UINT uPoints; | /* number of points in the array */
L_UINT uFillMode; | /* flag that indicates how to handle complex crossing lines */

Creates or updates the associated class object's bitmap region by adding a polygonal region.

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

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.

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

Elements: | LBitmapRgn::SetRgnColor, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnRoundRect, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

L_VOID TestFunction(HWND hWnd)
{
RGNXFORM XFormBtmp; // Structure for transforming display
 coordinates
RECT rClientArea; // Client area of the current window
L_INT nRet = 0;
LBitmapRgn lBmpRgn ;
LBitmapBase lBmpBase ;
LBitmapBase lBmpMask ;
HRGN hRgn ;
POINT PolyPt[5]; // Array of points that defines the
 polygon
POINT L_FAR *pPolyPt = PolyPt; // Pointer to the array
 of points

// Get the client area of the current window
GetClientRect(hWnd,&rClientArea);

// Load a bitmap
nRet = lBmpBase.Load(TEXT("IMAGE1.CMP"),
 32, ORDER_BGR);

if (nRet == SUCCESS)
{
lBmpRgn.SetBitmap(&lBmpBase)
 ;

L_UINT uCombineMode = lBmpRgn.GetRgnCombineMode() ;
uCombineMode |= L_RGN_OR ;

lBmpRgn.SetRgnCombineMode(uCombineMode)
 ;

lBmpRgn.SetRgnColor(RGB(0,0,0))
 ;

// create mask region from bitmap
nRet = lBmpRgn.CreateMaskFromBitmapRgn(&lBmpMask,
 sizeof(lBmpMask)) ;

if (nRet == SUCCESS)
// set region from
 mask bitmap
lBmpRgn.SetRgnFromMask(lBmpMask)
 ;

// get the region transform used with
 region function
lBmpRgn.GetRgnXForm(&XFormBtmp)
 ;

/* Set RGNXFORM fields, assuming that
 the display rectangle is the same
as the client area of the current window
 */
XFormBtmp.uViewPerspective = TOP_LEFT;
XFormBtmp.nXScalarNum = lBmpBase.GetWidth();
XFormBtmp.nXScalarDen = rClientArea.right;
XFormBtmp.nYScalarNum = lBmpBase.GetHeight()
 ;
XFormBtmp.nYScalarDen = rClientArea.bottom;
XFormBtmp.nXOffset = 0;
XFormBtmp.nYOffset = 0;

// set the region transform to be used
 in region functions
lBmpRgn.SetRgnXForm(&XFormBtmp)
 ;

// 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;

// Create a polygonal region
lBmpRgn.SetRgnPolygon(
 pPolyPt, 5, L_POLY_ALTERNATE);

// Save the first polygonal region
hRgn = lBmpRgn.GetRgnHandle();

// Free the region
lBmpRgn.Free();

// Add the saved region to the new
 one
lBmpRgn.SetRgnHandle(hRgn);

/*
...
...
...
*/

// Delete the HRGN object
DeleteObject(hRgn);
}
}


LBitmapRgn::SetRgnRect

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnRect(pRect)

LPRECT pRect;

/* pointer to the windows RECT structure */

Creates or updates the associated class object's bitmap region by adding a rectangular region.

Parameter | Description
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 set using LBitmapRgn::SetRgnXForm.

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.

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

Elements: | LBitmapRgn::SetRgnColor, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRoundRect, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap(200,300,ORDER_BGR);
RECT Rect={10,10,50,200};
MyBitmap.Load(TEXT("image1.cmp"));
LBitmapRgn Region(&MyBitmap);

Region.SetRgnRect(&Rect);
 //set the rect as a region

//…
}


LBitmapRgn::SetRgnRoundRect

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::SetRgnRoundRect(pRect, nWidthEllipse, nHeightEllipse)

LPRECT 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 */

Creates or updates the associated class object's bitmap region by adding a rounded rectangular region.

Parameter | Description
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 set using LBitmapRgn::SetRgnXForm.
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 set using LBitmapRgn::SetRgnXForm.
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 set using LBitmapRgn::SetRgnXForm.

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.

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.

See Also

Elements: | LBitmapRgn::SetRgnColor, LBitmapRgn::SetRgnEllipse, LBitmapRgn::SetRgnPolygon, LBitmapRgn::SetRgnRect, LBitmapRgn::SetRgnColorHSVRange, LBitmapRgn::SetRgnColorRGBRange, Class Members
Topics: | Raster Image Functions: Creating and Using a Region
 | Raster Image Functions: Region Processing
 | Defining and Using a Bitmap Region
 | Saving a Region

Example

L_VOID TestFunction(HWND hWnd)
{
POINT pointRgn ;
LBitmapBase MyBitmap(200,300,ORDER_BGR);
RECT Rect={10,10,350,400};
MyBitmap.Load(TEXT("image1.cmp"));
LBitmapRgn Region(&MyBitmap);

Region.SetRgnRoundRect(&Rect,30,40);
 //set the round rect as a region

// check if this point in region or not
if (Region.IsPtInRgn(150,200)
 == TRUE)
MessageBox(hWnd, TEXT("Point in
 region"), TEXT("Region"), MB_OK );
else
MessageBox(hWnd, TEXT("Point is
 not in region"), TEXT("Region"), MB_OK );

// set x & y in pointRgn structure
pointRgn.x = 100 ;
pointRgn.y = 100 ;
// check if this point in region or not
if (Region.IsPtInRgn(&pointRgn)
 == TRUE)
MessageBox(hWnd, TEXT("Point in
 region"), TEXT("Region"), MB_OK );
else
MessageBox(hWnd, TEXT("Point is
 not in region"), TEXT("Region"), MB_OK );
}


LBitmapRgn::SetRgnXForm

#include "ltwrappr.h"

L_INT LBitmapRgn::SetRgnXForm(pXform)

pRGNXFORM pXform;

/* the new region transform */

Sets the region transform to be used by the region functions.

Parameter | Description
pXform | The new region transform to be used by the region functions. Pass NULL to use the default region transformation.

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 default settings for the region transform are:

the Scalar fields default to 1.

the Offset fields default to 0.

the View Perspective field defaults to the associated class object’s bitmap 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.

See Also

Elements: | LBitmapRgn::GetRgnXForm, Class Members
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 LBitmapRgn::SetRgnPolygon.


LBitmapSettings::LBitmapSettings

#include "ltwrappr.h"

L_VOID LBitmapSettings::LBitmapSettings(void)

Constructs and initializes the member variables of the LBitmapSettings object.

Returns

None

Comments

This is the constructor for the LBitmapSettings class.

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:

LBitmapSettings::~LBitmapSettings, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LBitmapSettings bitmapSettings;

//…
}


LBitmapSettings::~LBitmapSettings

#include "ltwrappr.h"

virtual LBitmapSettings::~LBitmapSettings(void)

Destroys the class object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LBitmapSettings class.

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:

LBitmapSettings::LBitmapSettings, Class Members

Example

L_VOID TestFunction()
{
// destructor will be called when this variable is out of scope
LBitmapSettings bitmapSettings;

//…
}


LBitmapSettings::CreateUserMatchTable

#include "ltwrappr.h"

static L_UINT L_FAR * LBitmapSettings::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 LBitmapBase::ColorRes 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 LBitmapBase::ColorRes 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 LBitmapSettings::CreateUserMatchTable to create the table.
2. | Call LBitmapSettings::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 LBitmapBase::ColorRes with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call LBitmapSettings::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

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: | LBitmapBase::ColorRes, LBitmapSettings::DefaultDithering, LBitmapSettings::SetUserMatchTable, LBitmapSettings::FreeUserMatchTable
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions
 | Raster Image Functions: Palettes

Example

L_VOID BitmapSettingsSample(HWND hWnd)
{
LBitmap LeadBitmap, ColorResBitmap;
L_UINT L_FAR * pMatchTable; /* Pointer to the user match table */
RECT rcClientRect;
HDC hDC;
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 = LBitmapSettings::CreateUserMatchTable(Rainbow, 64);
LBitmapSettings::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. */
// get DC
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Load(TEXT("image1.cmp"), 24, ORDER_BGR);
LeadBitmap.ColorRes(8,
CRF_FLOYDSTEINDITHERING|CRF_USERPALETTE|CRF_FASTMATCHPALETTE,
Rainbow, 64);

/* Free the user match table when it is no longer needed */
LBitmapSettings::FreeUserMatchTable(pMatchTable);

/* Get the new palette as the current paint palette */
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
// Paint the image
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
return;
}


LBitmapSettings::DefaultDithering

#include "ltwrappr.h"

static L_INT LBitmapSettings::DefaultDithering(uMethod)

L_UINT uMethod;

/* the 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. Possible 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

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: | LBitmapBase::ColorRes, LBitmapSettings::CreateUserMatchTable, LBitmapSettings::SetUserMatchTable, LBitmapSettings::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 Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images

Example

L_VOID MyFunc(HWND hWnd)
{
LBitmapSettings bitmapSettings;
LBitmap LeadBitmap;

// Set the default dithering
LBitmapSettings::DefaultDithering(NO_DITHERING);

// Load the bitmap at 8 bits per pixel
LeadBitmap.Load(TEXT("image1.cmp"), 8, ORDER_BGR);
// Update the paint palette
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
}


LBitmapSettings::FreeUserMatchTable

#include "ltwrappr.h"

static L_INT LBitmapSettings::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.
< 0 | An error occurred. Refer to Return Codes.

Comments

This function is used with other functions in the following sequence:

1. | Call LBitmapSettings::CreateUserMatchTable to create the table.
2. | Call LBitmapSettings::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 LBitmapBase::ColorRes with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call LBitmapSettings::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

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: | LBitmapBase::ColorRes, LBitmapSettings::DefaultDithering, LBitmapSettings::CreateUserMatchTable, LBitmapSettings::SetUserMatchTable, Class Members
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 LBitmapSettings::CreateUserMatchTable.


LBitmapSettings::GetDisplayMode

#include "ltwrappr.h"

static L_UINT32 LBitmapSettings::GetDisplayMode(L_VOID);

Gets the painting control flags, which are set by the LBitmapSettings::SetDisplayMode function.

Returns

The unsigned integer containing the painting control flags.

Comments

Possible values for the display mode are:

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 LBitmapBase::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 LPaint::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.

See Also

Functions: | LBitmapSettings::SetDisplayMode, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

L_VOID MyFunction(HWND hWnd)
{
if (LBitmapSettings::GetDisplayMode()
 == DISPLAYMODE_SCALETOGRAY)
{
MessageBox (NULL, TEXT("Already
 using scale-to-gray"), TEXT("Notice"), MB_OK);
}
else if (LBitmapSettings::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
 */
LBitmapSettings::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;
}


LBitmapSettings::SetDisplayMode

#include "ltwrappr.h"

static L_UINT32 LBitmapSettings::SetDisplayMode(uFlagPos, uFlagSet)

L_UINT32 uFlagPos; | /* flag */
L_UINT32 uFlagSet; | /* flags 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 LBitmapSettings::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 LBitmapSettings::SetDisplayMode Function for descriptions of the flags.

Returns

None

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:

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

See Also

Functions: | LBitmapSettings::GetDisplayMode
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

For an example, refer to LBitmapSettings::GetDisplayMode.


LBitmapSettings::SetUserMatchTable

#include "ltwrappr.h"

static L_UINT L_FAR * LBitmapSettings::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 LBitmapSettings::CreateUserMatchTable to create the table.
2. | Call LBitmapSettings::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 LBitmapBase::ColorRes with the CRF_USERPALETTE and CRF_FASTMATCHPALETTE options.
4. | Call LBitmapSettings::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

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: | LBitmapBase::ColorRes, LBitmapSettings::DefaultDithering, LBitmapSettings::CreateUserMatchTable, LBitmapSettings::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 LBitmapSettings::CreateUserMatchTable.


LBitmapWindow::LBitmapWindow

#include "ltwrappr.h"

L_VOID LBitmapWindow::LBitmapWindow(void)

L_VOID LBitmapWindow::LBitmapWindow(hWndParent, nID, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0, nCx=200, nCy=200)

HWND hWndParent; | /* handle to the parent window */
L_INT nID; | /* control’s id */
DWORD dwStyle; | /* the control’s style */
L_INT x; | /* x position */
L_INT y; | /* y position */
L_INT nCx; | /* width of the bitmap window */
L_INT nCy; | /* height of the bitmap window */

Constructs and initializes the different member variables of the LBitmapWindow object.

Parameter | Description
hWndParent | Handle of the parent window.
nID | The control’s ID.
dwStyle | Specifies the control's style. Apply any combination of Window styles and LEAD window styles. For more information on Windows styles, refer to your compiler’s help file. For more information on LEAD window styles, refer to Bitmap Window LEAD specific styles.
x | The starting x position.
y | The starting y position.
nCx | The width of the bitmap window.
nCy | The height of the bitmap window.

Returns

None

Comments

LBitmapWindow::LBitmapWindow() is a constructor for the LBitmapWindow object.

LBitmapWindow::LBitmapWindow(hWndParent, nID, dwStyle, x, y, nCX, nCY) creates the bitmap window control using the specified options. This will fill in the m_hWnd data member with the handle to the new window.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::~LBitmapWindow, Class Members

Example

This is an example for LBitmapWindow::LBitmapWindow():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LBitmapWindow MyLBitmapWindow;

//…
}

This is an example for LBitmapWindow::LBitmapWindow(hWndParent, nID, dwStyle, x, y, nCX, nCY):

L_VOID MyFunction(HWND hParentWnd)
{
// this will call the constructor and will initialize the bitmap window with the specified parameters.

/*initialize hParentWnd with the handle of the parent window*/
LBitmapWindow MyLBitmapWindow(hParentWnd,15,WS_VISIBLE,0,0,100,100);

//…
}


LBitmapWindow::~LBitmapWindow

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::~LBitmapWindow(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LBitmapWindow class.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::LBitmapWindow, Class Members

Example

L_VOID MyFucntion()
{
// this will call the default constructor and destructor when it is out of scope
LBitmapWindow MyLBitmapWindow;

//…
}


LBitmapWindow::AddZoomView

#include "ltwrappr.h"

L_INT LBitmapWindow::AddZoomView(pZoomViewProps)

pZOOMVIEWPROPS pZoomViewProps;

/* pointer to a ZOOMVIEWPROPS structure */

Creates a new Zoom View and associates it with the bitmap window control. This function is available in the Document/Medical Toolkits.

Parameter | Description
pZoomViewProps | Pointer to the ZOOMVIEWPROPS structure that contains the Zoom View settings to be created for the class object.

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

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

For more information on the Zoom View options, refer to the ZOOMVIEWPROPS structure.

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.

See Also

Functions: | LBitmapWindow::HasZoomView, LBitmapWindow::GetZoomViewProps, LBitmapWindow::UpdateZoomView, LBitmapWindow::DestroyZoomView, LBitmapWindow::GetZoomViewsCount, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

void CDemoView::OnAddZoomView()
{
ZOOMVIEWPROPS ZoomViewProps;
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.bCallouts = TRUE;
ZoomViewProps.bForceDst = FALSE;
ZoomViewProps.crCallout = RGB(255,0,0);
ZoomViewProps.nCalloutPenStyle = 1;

ZoomViewProps.crZoomViewBorder = RGB(0,255,0);
ZoomViewProps.uZoomViewBorderStyle = ZOOMVIEWBORDERSTYLE_3D;
ZoomViewProps.nZoomViewPenStyle = 1;
ZoomViewProps.crSrcBorder = RGB(0,0,255);
ZoomViewProps.uSrcBorderStyle = 2;
ZoomViewProps.nSrcPenStyle = 0;
ZoomViewProps.bEnabled = TRUE;

m_LAniWnd.AddZoomView(&ZoomViewProps);

m_LAniWnd.EnableHiliteZoomView(!m_LAniWnd.IsHiliteZoomViewEnabled());

m_LAniWnd.SetToolType (TOOL_ZOOMVIEW);
m_LAniWnd.EnableDoubleBuffer (TRUE);
}

void CDemoView::OnDestoyZoomView()
{
L_UINT uCount,i;
if(m_LAniWnd.HasZoomView ())
{
uCount = m_LAniWnd.GetZoomViewsCount ();

for(i=0; i < uCount;++i)
{
m_LAniWnd.DestroyZoomView (uCount-i-1);
}
}
}


LBitmapWindow::CancelRgn

#include "ltwrappr.h"

L_VOID LBitmapWindow::CancelRgn(void)

Cancels the current region.

Returns

None

Comments

This will destroy any existing region (floater bitmap).

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members, Floaters and Regions in the LbitmapWindow Class

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::CopyFromClipboard

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::CopyFromClipboard(hWnd)

HWND hWnd;

/* handle to the active window. */

Copies image data from the clipboard to a specified bitmap. The image on the clipboard must be a DIB, DDB, or a WMF.

Parameter | Description
hWnd | Handle to the active window.

Returns

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

Comments

If the bitmap window object already has an allocated bitmap, then the bitmap that is pasted from the clipboard will be pasted as a floater for the displayed bitmap. If the bitmap window does not have an allocated bitmap, then the bitmap that is pasted from the clipboard will become the main displayed image.

The class object’s 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 LBitmapBase::ColorRes.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction(LBitmapWindow& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsClipboardReady())
MyBitmap.CopyFromClipboard(hWnd);
}


LBitmapWindow::CopyToClipboard

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::CopyToClipboard(hWnd, uFlags=COPY2CB_EMPTY|COPY2CB_DIB|COPY2CB_DDB|COPY2CB_PALETTE)

HWND hWnd; | /* handle to the active window that owns the clipboard */
L_UINT uFlags; | /* flag that indicates how image data is placed on the clipboard */

Copies the class object's bitmap to the clipboard.

Parameter | Description
hWnd | Handle to the active window that owns the clipboard.
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.
 | Note: Specifying the above flags will cause the copied image to be copied, with its region if it has one
 | COPY2CB_FLOATER | [0x8000] Copy the floater bitmap, if one exists.

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 class object’s bitmap.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction(LBitmapWindow& MyBitmap,HWND hWnd)
{
if(MyBitmap.IsAllocated())
MyBitmap.CopyToClipboard(hWnd);
}


LBitmapWindow::CreatePanWnd

#include "ltwrappr.h"

HWND LBitmapWindow::CreatePanWnd(ulDisplayFlags, x, y, nCx, nCy, pszClassName, hIcon, hCursor, bSysMenu)

L_UINT32 ulDisplayFlags; | /* flags that determine how the image is painted in the Pan Window */
L_INT x; | /* x coordinate of the Pan Window */
L_INT y; | /* y coordinate of the Pan Window */
L_INT nCx; | /* width of the Pan Window */
L_INT nCy; | /* height of the Pan Window */
L_TCHAR L_FAR * pszClassName; | /* registered window class name */
HICON hIcon; | /* icon handle */
HCURSOR hCursor; | /* cursor handle */
L_BOOL bSysMenu; | /* flag that indicates whether the Pan Window will have a system menu */

Creates a Pan Window for the bitmap window.

Parameter | Description
ulDisplayFlags | Flags that determine how the image is painted in the Pan Window. For values, refer to Flags for the Flags for the LBitmapSettings::SetDisplayMode Function.
x | X coordinate for the origin of the Pan Window.
y | Y coordinate for the origin of the Pan Window.
nCx | Width of the Pan Window.
nCy | Height of the Pan Window.
pszClassName | The registered window class name to be used in creating the Pan Window.
hIcon | The icon handle used for creating Pan Window.
hCursor | The cursor handle used for creating Pan Window.
bSysMenu | Flag that indicates whether the Pan Window will have a system menu. Possible values are:
 | Value | Meaning
 | TRUE | The Pan Window will have a system menu.
 | FALSE | The Pan Window will not have a system menu.

Returns

!= NULL | The function was successful and the returned value is the window handle for the created control.
NULL | An error occurred, and the window could not be created.

Comments

If you call this function for a class object that already has a created Pan Window associated with it, the function will destroy the existing Pan Window and create a new one with the specified settings.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

class LUserBWnd : public LBitmapWindow
{
public:
LUserBWnd() ;
virtual ~LUserBWnd() ;

virtual L_VOID PanWndCallBack(L_UINT uFlag,LPRECT rcPan);
virtual LRESULT MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
virtual L_BOOL OnFileDropped(L_TCHAR L_FAR* pszFile,L_UINT uFileNumber,L_UINT uFilesCount);
virtual L_VOID OnDraw(HDC hdc,RECT& Rect);
virtual L_VOID OnZoom(L_UINT uZoomPercent);
virtual L_VOID PaintNotification(L_INT nPass, L_INT uType);
};

LUserBWnd::LUserBWnd()
{
}

LUserBWnd::~LUserBWnd()
{
}

L_VOID LUserBWnd::PanWndCallBack(L_UINT uFlag,LPRECT rcPan)
{
// user can set his code for each message
switch (uFlag)
{
case PANWIN_CREATED:
// user code
return;
case PANWIN_UPDATED:
// user code
return;
case PANWIN_DESTROYED:
// user code
return;
case PANWIN_MOVED:
// user code
return;
}
}

LRESULT LUserBWnd::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch (uMsg)
{
case WM_CLOSE:
break ;
};

return LBitmapWindow::MsgProcCallBack(hWnd,uMsg,wParam,lParam);
}
L_BOOL LUserBWnd::OnFileDropped(L_TCHAR L_FAR* pszFile, L_UINT uFileNumber, L_UINT uFilesCount)
{
SetFileName(pszFile);
if (Load() == SUCCESS)
return FALSE; //if loading the file succeeded then stop enumerating files

return TRUE;
}

L_VOID LUserBWnd::OnDraw(HDC hdc,RECT& Rect)
{
Rectangle( hdc,10,10, 50,50);
}

L_VOID LUserBWnd::OnZoom(L_UINT uZoomPercent)
{
L_TCHAR szBuffer[50];
wsprintf(szBuffer,TEXT("Zoom Percent = %u\n"),uZoomPercent) ;
::MessageBox( m_hWnd, szBuffer, TEXT("Zoom Percent"), MB_OK) ;
}

L_VOID LUserBWnd::PaintNotification(L_INT nPass, L_INT nType)
{
L_TCHAR szBuffer[50];
wsprintf(szBuffer,TEXT("Pass Number = %d\nType Effect No. = %d\n"), nPass, nType) ;
::MessageBox( m_hWnd, szBuffer, TEXT("Effect Information"), MB_OK) ;
}

L_INT BitmapWindowSamples(HWND hWndParent)
{
LUserBWnd UserBitmapWindow;
HWND hWnd ;

UserBitmapWindow.SetFileName(TEXT("image1.cmp"));
if (UserBitmapWindow.Load(0, ORDER_BGR) == SUCCESS)
{
hWnd = UserBitmapWindow.CreateWnd( hWndParent) ;
if (hWnd == NULL)
return 0 ;

UserBitmapWindow.HandlePalette(WM_QUERYNEWPALETTE,0,0);
UserBitmapWindow.Repaint();

L_UINT32 ulDisplayFlags = UserBitmapWindow.GetDisplayMode() ;
UserBitmapWindow.CreatePanWnd(ulDisplayFlags, 0, 0, 150, 150,
TEXT("PAN_WIN"), NULL, NULL, TRUE) ;

hWnd = UserBitmapWindow.GetPanWnd() ;

if (hWnd != NULL)
UserBitmapWindow.UpdatePanWnd( ulDisplayFlags, RGB(255,0,0),TEXT("Pan Window ")) ;

//... do any operation on window

UserBitmapWindow.Flip();

if (UserBitmapWindow.IsPanWndCreated() == TRUE)
UserBitmapWindow.UpdatePanWnd( ulDisplayFlags, RGB(255,255,255),TEXT("Pan Window ")) ;

MessageBox(hWndParent, TEXT("Pan Window was created successfully.\n press OK to destroy it"), TEXT("BitmapWindowSamples"), MB_OK);
hWnd = UserBitmapWindow.GetPanWnd() ;
if (hWnd != NULL)
// after you finish, destroy PanWindow
UserBitmapWindow.DestroyPanWnd() ;

hWnd = UserBitmapWindow.GetBitmapWnd() ;
if (hWnd != NULL)
{
L_FLOAT fZoomFactor ;
L_UINT uPercent ;

UserBitmapWindow.ZoomIn() ;

// set zoom factor with initialize value
UserBitmapWindow.SetZoomFactor() ;

// set zoom percent
UserBitmapWindow.SetZoomPercent(100);

UserBitmapWindow.ZoomIn() ;

// get current zoom factor
fZoomFactor = UserBitmapWindow.GetZoomFactor() ;
fZoomFactor += 0.50 ;

// set new zoom factor
UserBitmapWindow.SetZoomFactor(fZoomFactor) ;

uPercent = UserBitmapWindow.GetZoomPercent();
uPercent += 50 ;

// set new zoom percent
UserBitmapWindow.SetZoomPercent(uPercent);

UserBitmapWindow.ZoomOut();

// Drag Files ...
if (UserBitmapWindow.IsDragAcceptFilesEnabled() == FALSE)
UserBitmapWindow.EnableDragAcceptFiles(TRUE) ;
}
}
return SUCCESS ;
}


LBitmapWindow::CreateWnd

#include "ltwrappr.h"

HWND LBitmapWindow::CreateWnd(hWndParent, nID=0, dwStyle=WS_VISIBLE|L_BS_CENTER|L_BS_PROCESSKEYBOARD, x=0, y=0, nCx=200, nCy=200)

HWND hWndParent; | /* handle of the parent window */
L_INT nID; | /* the control’s ID */
DWORD dwStyle; | /* control’s style */
L_INT x; | /* x coordinate for the window */
L_INT y; | /* y coordinate for the window */
L_INT nCx; | /* width of the window */
L_INT nCy | /* height of the window */

Creates the bitmap window control using the specified parameters.

Parameter | Description
hWndParent | Handle of the parent window.
nID | The control’s ID.
dwStyle | The style of the window control. Apply any combination of window styles and LEAD window styles. For more information on Windows styles, refer to your compiler’s help file. For more information on LEAD window styles, refer to Bitmap Window LEAD specific styles.
x | X coordinate for the origin of the bitmap window.
y | Y coordinate for the origin of the bitmap window.
nCx | The width of the bitmap window.
nCy | The height of the bitmap window.

Returns

!= NULL | The function was successful and the returned value is the window handle for the created control.
NULL | An error occurred, and the window could not be created.

Comments

This function causes the class object to create the control window using the specified parameters.

This will fill in the m_hWnd data member with the handle to the new window.

If you call this function for a class object that already has a created window, the function will simply return m_hWnd.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_INT BitmapWindowSamples1(HWND hWnd)
{
// this will call the constructor and will initialize the bitmap window with the specified parameters.

HWND BitmapHwnd;
//initialize hParentWnd with the handle of the parent window
LBitmapWindow *myLBitmapWindow = new LBitmapWindow;

myLBitmapWindow->SetFileName(TEXT("image1.cmp"));
if (myLBitmapWindow->Load() == SUCCESS)
{
BitmapHwnd = myLBitmapWindow->CreateWnd(hWnd,15);
if (BitmapHwnd == NULL)
return FAILURE;
}
return SUCCESS;
}


LBitmapWindow::DestroyPanWnd

#include "ltwrappr.h"

L_INT LBitmapWindow::DestroyPanWnd(void)

Destroys the Pan Window and frees all resources associated with it.

Returns

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

Comments

You can call this function to destroy the class object's associated Pan Window.

Note: if you do not call this function, the class object will call it for you when object is destroyed.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::DestroyZoomView

#include "ltwrappr.h"

L_INT LBitmapWindow::DestroyZoomView(uIndex)

L_UINT uIndex;

/* index of the zoomed view to be destroyed*/

Destroys the specified Zoom View, and releases all resources associated with it. This function is available in the Document/Medical Toolkits.

Parameter | Description
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

To attach a Zoom View to a window, call the LBitmapWindow::AddZoomView function.

When a Zoom View is no longer needed, call the LBitmapWindow::DestroyZoomView function to stop the specified Zoom View procedure and to detach it from the window handle.

If you need to destroy all the zoomed views that are attached to a specified window, destroy them from the last Zoom View to the first Zoom View. For example, if you have 5 Zoom Views associated with the specified window you need to do the following:

L_UINT uCount,i;
if(m_LAniWnd.HasZoomView ())
{
uCount = m_LAniWnd.GetZoomViewsCount ();

for(i=0; i < uCount;++i)
{
m_LAniWnd.DestroyZoomView(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.

See Also

Functions: | LBitmapWindow::HasZoomView, LBitmapWindow::AddZoomView, LBitmapWindow::UpdateZoomView, LBitmapWindow::GetZoomViewProps, LBitmapWindow::GetZoomViewsCount, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

For an example, refer to LBitmapWindow::AddZoomView.


LBitmapWindow::EnableAutoPaint

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableAutoPaint(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable bitmap window painting */

Enables or disables bitmap window painting.

Parameter | Description
bEnable | Flag that indicates whether to bitmap window painting. Possible values are:
 | Value | Meaning
 | TRUE | Enable bitmap window painting.
 | FALSE | Disable bitmap window painting.

Returns

The previous state.

Comments

This setting is enabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::EnableAutoScroll

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableAutoScroll(bAutoScroll)

L_BOOL bAutoScroll;

/* flag that indicates whether to enable auto scrolling */

Enables or disables automatic scrolling of the displayed bitmap.

Parameter | Description
bAutoScroll | Flag that indicates whether to enable auto scrolling of the bitmap displayed by the bitmap window. Possible values are:
 | Value | Meaning
 | TRUE | Enable auto scrolling.
 | FALSE | Disable auto scrolling.

Returns

The previous state.

Comments

When auto scrolling is enabled, the class object's window will display scrollbars when necessary, and automatically handle scrolling the bitmap based on scroll messages generated for those scrollbars.

This setting is enabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::EnableCenterOnZoom

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableCenterOnZoom(bCenter)

L_BOOL bCenter;

/* flag that indicates whether to enable ceentering on zoom */

Enables or disables centering on zoom for the class object's window.

Parameter | Description
bCenter | Flag that indicates whether to enable or disable center on zoom. Possible values are:
 | Value | Meaning
 | TRUE | Enable center on zoom.
 | FALSE | Disable center on zoom.

Returns

The previous state.

Comments

This setting is enabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::IsCenterOnZoomEnabled.


LBitmapWindow::EnableDoubleBuffer

#include "ltwrappr.h"

virtual L_BOOL LBitmapWindow::EnableDoubleBuffer(bEnable)

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
bEnable | Value that specifies whether to enable double buffering. Possible values are:
 | Value | Meaning
 | TRUE | Enable double buffering.
 | FALSE | Disable double buffering.

Returns

The previous setting.

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 LDoubleBuffer::Begin.

For more information, see the topic Minimizing Flicker with Double Buffering.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

LBitmapWindow m_LBitmapWnd;
L_BOOL bOldStatus;
if(!m_LBitmapWnd.IsDoubleBufferEnabled())
bOldStatus = m_LBitmapWnd.EnableDoubleBuffer(TRUE);


LBitmapWindow::EnableDragAcceptFiles

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableDragAcceptFiles(bDragAcceptFiles)

L_BOOL bDragAcceptFiles;

/* flag that indicates whether to enable drag and drop */

Enables or disables dragging and dropping files for the class object's window.

Parameter | Description
bDragAcceptFiles | Flag that indicates whether to enable or disable drag and drop. Possible values are:
 | Value | Meaning
 | TRUE | Enable drag and drop.
 | FALSE | Disable drag and drop.

Returns

The previous state.

Comments

This setting is enabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::EnableDrawGradient

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableDrawGradient(bEnable)

L_BOOL bEnable;

/* flag that indicates whether gradient drawing is enabled */

Enables or disables drawing gradients.

Parameter | Description
bEnable | Flag that indicates whether gradient drawing is enabled. Possible values are:
 | Value | Meaning
 | TRUE | Enable gradient drawing.
 | FALSE | Disable gradient drawing.

Returns

The previous state.

Comments

When drawing gradients is enabled, the control will draw a gradient into its client area using the current gradient parameters.

This setting is disabled by default.

Note: If both patterns and gradients are enabled, the drawing of gradients will override the drawing of patterns.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::EnableDrawPattern

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableDrawPattern(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable pattern drawing */

Enables or disables pattern drawing.

Parameter | Description
bEnable | Flag that indicates whether to enable pattern drawing. Possible values are:
 | Value | Meaning
 | TRUE | Enable pattern drawing.
 | FALSE | Disable pattern drawing.

Returns

The previous state.

Comments

When drawing patterns is enabled, the control will draw a pattern into its client area using the current pattern parameters.

This setting is disabled by default.

Note: If both patterns and gradients are enabled, the drawing of gradients will override the drawing of patterns.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::EnableKeyBoard

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableKeyBoard(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable keyboard processing */

Enables or disables keyboard processing for the bitmap window control.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable keyboard processing. Possible values are:
 | Value | Meaning
 | TRUE | Enable keyboard processing.
 | FALSE | Disable keyboard processing.

Returns

The previous setting.

Comments

When keyboard processing is enabled for the class object, the object will automatically process certain keys. For a list of these keys, refer to LBitmapWindow Keys.

This is enabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::IsKeyBoardEnabled.


LBitmapWindow::EnableLocalSettings

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnableLocalSettings(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable the local settings*/

Enables or disables the local display settings.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the local settings. Possible values are:
 | Value | Meaning
 | TRUE | Enable the local settings.
 | FALSE | Use the global settings.

Returns

The previous setting.

Comments

Use this function to enable or disable the local display settings for the class object. When local settings are enabled, painting the bitmap will use the local settings and the global settings will be restored after the paint operation. When local settings are disabled, painting the bitmap will use the global settings. The display settings include: intensity, contrast, gamma, and display mode.

This will also enable the local settings for the floater bitmap if the bitmap window has a floater bitmap.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);

if(MyBitmap.IsLocalSettingsEnabled()==FALSE)
MyBitmap.EnableLocalSettings(TRUE);


LBitmapWindow::EnablePaintEffect

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnablePaintEffect(bEnable)

L_BOOL bEnable;

/* flag that indicates whether to enable the use of paint effects */

Enables or disables the use of paint effects.

Parameter | Description
bEnable | Flag that indicates whether to enable or disable the use of paint effects. Possible values are:
 | Value | Meaning
 | TRUE | Enable the use of paint effects.
 | FALSE | disable the use of paint effects.

Returns

The previous state.

Comments

When painting effects are enabled, anytime the class object paints an image, it will be painted with the current paint effect options set by:

LBitmapWindow::SetPaintEffect

LBitmapWindow::SetMaxEffectPasses

LBitmapWindow::SetROP3

This setting is disabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::EnablePaintSizeUseDPI

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnablePaintSizeUseDPI(bPaintSizeUseDPI)

L_BOOL bPaintSizeUseDPI;

/* flag that indicates whether to paint the bitmap using the DPI settings */

Enables or disables bitmap painting using the DPI settings.

Parameter | Description
bPaintSizeUseDPI | Flag that indicates whether to paint the bitmap using the DPI settings. Possible values are:
 | Value | Meaning
 | TRUE | Paint the bitmap using its DPI settings.
 | FALSE | Paint the bitmap using the bitmap’s original height and width.

Returns

The previous state.

Comments

If enabled, the bitmap window will account for the physical resolution of the bitmap when displaying it.

The physical resolution of a bitmap is measured in dots per inch (DPI). Some images have different horizontal and vertical resolutions (for example: 300 by 600). In such cases, the displayed images will appear elongated if you do not account for the resolution.

This setting is disabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::EnablePaintTransition

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnablePaintTransition(bEnable)

L_BOOL bEnable;

/* flag that indicates whether the use of painting transitions is enabled */

Enables or disables the use of paint transitions.

Parameter | Description
bEnable | Flag that indicates whether the use of painting transitions is enabled or disabled. Possible values are:
 | Value | Meaning
 | TRUE | Enable the use of paint transitions.
 | FALSE | Disable the use of paint transitions.

Returns

The previous state.

Comments

When the use of painting transitions is enabled, anytime the class object paints an image, it will first paint a transition, using the current paint transition options set by:

LBitmapWindow::SetTransitionEffect

LBitmapWindow::SetMaxTransitionPasses

LBitmapWindow::SetTransition

LBitmapWindow::SetGradientStyle

LBitmapWindow::SetPatternStyle

LBitmapWindow::SetPatternForeColor

LBitmapWindow::SetPatternBackColor

LBitmapWindow::SetROP3

This setting is disabled by default.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::EnablePaintWhileLoad

#include "ltwrappr.h"

L_BOOL LBitmapWindow::EnablePaintWhileLoad(bEnable)

L_BOOL bEnable;

/* flag that indicates whether PaintWhileLoad is enabled */

Enables or disables painting the bitmap while loading.

Parameter | Description
bEnable | Flag that indicates whether painting the bitmap while loading is enabled or disabled. Possible values are:
 | Value | Meaning
 | TRUE | Enable painting the bitmap while loading.
 | FALSE | Disable painting the bitmap while loading.

Returns

The previous setting.

Comments

When PaintWhileLoad is enabled, the class object will display the bitmap as it is loaded, when using the Load functions.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd)
{
if(BmpWnd.IsPaintWhileLoadEnabled()==FALSE)
BmpWnd.EnablePaintWhileLoad(TRUE);
}


LBitmapWindow::EndChanging

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::EndChanging(nChangeType, nChangeCategory, nRetCode)

L_UINT nChangeType; | /* the type of change */
L_UINT nChangeCategory; | /* the change category */
L_INT nRetCode; | /* the function return code */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change that was done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nRetCode | The function return code.

Returns

None

Comments

This function is called by every function that affects the bitmap. You can override this function to be notified when the operation has completed changing the bitmap. This function is called after the changes to the bitmap have been made. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing, such as updating the display, after the operation has completed.

If you override this function you must do the following:

Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

For an example, refer to LBitmapWindow::StartChanging.


LBitmapWindow::FitToParent

#include "ltwrappr.h"

L_VOID LBitmapWindow::FitToParent(bFlag=TRUE)

L_BOOL bFlag;

/* flag that indicates whether the window will update the display */

Changes the class object's window so that its size fits its parent window's client area.

Parameter | Description
bFlag | Flag that indicates whether the bitmap window will update the display. Possible values are:
 | Value | Meaning
 | TRUE | The window will update the display.
 | FALSE | The window will not update the display.

Returns

None

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetAutoFloaterToRgn

#include "ltwrappr.h"

L_BOOL LBitmapWindow::GetAutoFloaterToRgn(L_VOID)

Returns a value that indicates whether the automatic creation of a bitmap region from a floater is currently enabled or disabled.

Returns

TRUE | The automatic creation of a region from a floater is currently enabled.
FALSE | The automatic creation of a region from a floater is currently disabled.

Comments

To enable or disable the automatic creation of a region from a floater, use LBitmapWindow::SetAutoFloaterToRgn.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::SetAutoFloaterToRgn, LBitmapWindow::GetFloater, LBitmapWindow::HasFloater, LBitmapWindow::CancelRgn, LBitmapWindow::SetAutoRgnToFloater, LBitmapWindow::GetAutoRgnToFloater, Class Members
Topics: | Floaters and Regions in the LBitmapWindow Class

Example

void CDemoView::OnTestExample()
{
//m_LAniWnd is object of class LBitmapWindow

L_BOOL bOld;

bOld = m_LAniWnd.GetAutoFloaterToRgn();
CString strPrev = (bOld) ? TEXT("TRUE") : TEXT("FALSE");
AfxMessageBox(TEXT("Previous AutoFloaterToRgn: ") + strPrev);

//Enable automatic creation of region from floater
m_LAniWnd.SetAutoFloaterToRgn(TRUE);

//Set floater tool
m_LAniWnd.SetToolType(TOOL_REGION);
m_LAniWnd.SetRegionType(REGION_TYPE_RECT);

//...Here you would drag the mouse to create a rectangular floater.
//...When the floater is created, the region will also be created.
}


LBitmapWindow::GetAutoRgnToFloater

#include "ltwrappr.h"

L_BOOL LBitmapWindow::GetAutoRgnToFloater(void)

Returns a value that indicates whether the automatic creation of a floater from a region is currently enabled or disabled.

Returns

TRUE | The automatic creation of a floater from a region is currently enabled.
FALSE | The automatic creation of a floater from a region is currently disabled.

Comments

To enable or disable the automatic creation of a floater from a region, use LBitmapWindow::SetAutoRgnToFloater.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

LBitmapWindow::GetFloater, LBitmapWindow::GetFloaterRgn, LBitmapWindow::HasFloater, LBitmapWindow::SetAutoRgnToFloater, Class Members, Floaters and Regions in the LbitmapWindow Class

Example

For an example, refer to LBitmapWindow::SetAutoRgnToFloater.


LBitmapWindow::GetBitmapVisibleRect

#include "ltwrappr.h"

L_VOID LBitmapWindow::GetBitmapVisibleRect(pRect)

LPRECT pRect;

/* pointer to the rectangle to be updated */

Gets the visible rectangle of the displayed bitmap.

Parameter | Description
pRect | Pointer to the rectangle to be updated with the visible part of the displayed bitmap.

Returns

None

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_INT TestFunc(HWND hWndParent)
{
LBitmapWindow LeadBWnd ;

if (LeadBWnd.Load(TEXT("image1.cmp")) == SUCCESS)
{
L_UINT uToolType, uRgnType;
RECT rect ;

if (LeadBWnd.CreateWnd( hWndParent, TRUE, 0, 0, 100, 100) == NULL)
return 0;

uToolType = LeadBWnd.GetToolType() ;
if (uToolType != TOOL_REGION)
LeadBWnd.SetToolType(TOOL_REGION) ;

uRgnType = LeadBWnd.GetRegionType() ;
if (uRgnType != REGION_TYPE_FREE_HAND)
LeadBWnd.SetRegionType(REGION_TYPE_FREE_HAND) ;

//... do some process
//...

if (LeadBWnd.HasRgn() == TRUE)
LeadBWnd.CancelRgn() ;

LeadBWnd.ZoomIn() ;
LeadBWnd.GetBitmapVisibleRect(&rect) ;

rect.left -= 10 ;
rect.top -= 10 ;
rect.right -= 10;
rect.bottom-= 10;

LeadBWnd.Move(rect);
LeadBWnd.FitToParent() ;

GRADIENTDLGPARAMS GradDlgParm;
if(LeadBWnd. DialogEffect()->DoModalGetGradient(hWndParent)==SUCCESS)
{
LeadBWnd.GetGradientParameters(&GradDlgParm);
//…
LeadBWnd.SetGradientParameters(&GradDlgParm);

if (LeadBWnd.GetGradientStyle() != EFX_GRADIENT_LINE2_C_TO_LT_AND_RB)
LeadBWnd.SetGradientStyle(EFX_GRADIENT_LINE2_C_TO_LT_AND_RB) ;
}

TRANSITIONDLGPARAMS TransDlgParm;
if(LeadBWnd. DialogEffect()->DoModalGetTransition(hWndParent)==SUCCESS)
{
LeadBWnd.GetTransitionParameters(&TransDlgParm);
//…
LeadBWnd.SetTransitionParameters(&TransDlgParm);

if (LeadBWnd.GetTransition() != EFX_TRANS_SOLID)
LeadBWnd.SetTransition(EFX_TRANS_SOLID) ;

if (LeadBWnd.GetTransitionEffect() != EFX_TRANS_UPWARD_DIAG)
LeadBWnd.SetTransitionEffect(EFX_TRANS_UPWARD_DIAG) ;

if (LeadBWnd.GetMaxTransitionPasses() == 1)
LeadBWnd.SetMaxTransitionPasses(3) ;
}

EFFECTDLGPARAMS EfxDlgParm;
if(LeadBWnd. DialogEffect()->DoModalGetEffect(hWndParent)==SUCCESS)
{
LeadBWnd.DialogEffect()->GetEffectParams(&EfxDlgParm,sizeof(EfxDlgParm));
LeadBWnd.SetEffectParameters(&EfxDlgParm);

if (LeadBWnd.GetMaxEffectPasses() == 1)
LeadBWnd.SetMaxEffectPasses(3) ;
}

if (LeadBWnd.GetPaintEffect() != EFX_EFFECT_WIPE_L_TO_R)
LeadBWnd.SetPaintEffect(EFX_EFFECT_WIPE_L_TO_R) ;

if (LeadBWnd.GetRgnFrameType() != RGNFRAME_STATIC)
LeadBWnd.SetRgnFrameType(RGNFRAME_STATIC) ;
}

return SUCCESS ;
}


LBitmapWindow::GetBitmapWnd

#include "ltwrappr.h"

HWND LBitmapWindow::GetBitmapWnd(void)

Gets the window handle of the class object's bitmap window.

Returns

The window handle of the bitmap window.

Comments

This returns the m_hWnd data member.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::GetEffectParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::GetEffectParameters(pEfxDlgParm)

LPEFFECTDLGPARAMS pEfxDlgParm;

/* pointer to the structure to update */

Gets the effect painting parameters that are used when painting effects.

Parameter | Description
pEfxDlgParm | Pointer to the structure of type EFFECTDLGPARAMS to be updated with the effect painting parameters.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::SetEffectParameters, Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetFloater

#include "ltwrappr.h"

LBitmap LBitmapWindow::GetFloater(void)

Retrieves a copy of a floater.

Returns

NULL | No floater exists.
!NULL | Pointer to an LBitmap object that contains a copy of the floater.

Comments

The LBitmap object is allocated by the GetFloater() function. It should be deallocated when no longer needed.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::GetFloaterRgn, LBitmapWindow::HasFloater, LBitmapWindow::SetAutoRgnToFloater, Class Members, Floaters and Regions in the LbitmapWindow Class

Example

//This example assumes that pBitmapWindow points to a valid LBitmapWindow object

LBitmap *pBitmap;
pBitmap = pBitmapWindow->GetFloater();


LBitmapWindow::GetFloaterRgn

#include "ltwrappr.h"

HRGN LBitmapWindow::GetFloaterRgn(uFloatRgnType, pRgnXForm)

L_UINT uFloatRgnType; | /* flag that indicates the type of region returned */
RGNXFORM pRgnXForm; | /* pointer to an RGNXFORM structure */

Returns the region corresponding to a floater.

Parameter | Description
uFloatRgnType | Flag that indicates the type of region returned. Possible values are:
 | Value | Meaning
 | FLOAT_RGN_TRANS_NONE | [0] Returns a windows region in bitmap coordinates.
 | FLOAT_RGN_TRANS_FROM_WINDOW | [1] Returns a windows region relative to the client area of the window. This accounts for scroll and zoom.
 | FLOAT_RGN_TRANS_USE_XFORM | [2] Returns a windows region that is translated using pRgnXForm structure.
pRgnXForm | Pointer to a RGNXFORM structure … This parameter is valid only if uFloatRgnType is FLOAT_RGN_TRANS_USE_XFORM.

Returns

NULL | No floater exists.
!NULL | Handle to the region that corresponds to the floater.

Comments

HRGN should be freed when you are finished with the region.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::GetFloater, LBitmapWindow::HasFloater, LBitmapWindow::SetAutoRgnToFloater, Class Members

Example

For an example, refer to LBitmapWindow::SetAutoRgnToFloater.


LBitmapWindow::GetGradientParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::GetGradientParameters(pGradDlgParm)

LPGRADIENTDLGPARAMS pGradDlgParm;

/* pointer to the structure to be updated */

Gets the gradient painting parameters that are used when painting gradients.

Parameter | Description
pGradDlgParm | Pointer to a structure of type GRADIENTDLGPARAMS to be updated with the gradient painting parameters.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::SetGradientParameters, Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect .


LBitmapWindow::GetGradientStyle

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetGradientStyle(void)

Gets the gradient style used when drawing gradients.

Returns

The gradient style. For valid values, refer to Effect Gradient Styles.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetHorzLineStep

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetHorzLineStep(void)

Gets the horizontal scrolling line step.

Returns

The horizontal line step.

Comments

This is the amount by which the image will be scrolled when the user clicks the scrollbar's scroll-line button.

The default value is 5 pixels.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::GetMagGlassOptions

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::GetMagGlassOptions (pOptions, uStructSize)

MAGGLASSOPTIONS pOptions; | /* pointer to a MAGGLASSDATA structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pOptions */

Gets the magnifying glass options for the class object.

Parameter | Description
pOptions | Pointer to the MAGGLASSOPTIONS structure to be updated with the magnifying glass options for the class object.
uStructSize | Size in bytes, of the structure pointed to by pOptions. Use sizeof(FILEINFO).

Returns

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

Comments

For more information on the magnifying glass options, refer to the MAGGLASSOPTIONS structure.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::SetMagGlassOptions, LBitmapWindow::MagGlassCallBack, Class Members
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

L_VOID TestFun(LBitmapWindow &LeadBWnd)
{
MAGGLASSOPTIONS opt;

LeadBWnd.GetMagGlassOptions(&opt, sizeof(opt));
opt.clrBack = RGB(255, 0, 0);
LeadBWnd.SetMagGlassOptions (&opt);
LeadBWnd.SetToolType(TOOL_MAGGLASS);
}


LBitmapWindow::GetMaxEffectPasses

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetMaxEffectPasses(void)

Gets the maximum number of passes used when painting effects.

Returns

The maximum number of passes used for painting effects.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetMaxTransitionPasses

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetMaxTransitionPasses(void)

Gets the maximum number of passes used when drawing transitions.

Returns

The maximum number of passes used for drawing transitions.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetPaintEffect

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetPaintEffect(void)

Gets the paint effect used for painting bitmaps.

Returns

The effect to apply when painting. For valid values, refer to Effect Types.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetPanWnd

#include "ltwrappr.h"

HWND LBitmapWindow::GetPanWnd(void)

Gets the window handle of the associated Pan Window.

Returns

The window handle of the associated Pan Window, or NULL if the Pan Window has not been created.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::GetPatternBackColor

#include "ltwrappr.h"

COLORREF LBitmapWindow::GetPatternBackColor(void)

Gets the background color used for drawing patterns.

Returns

The background color used for drawing patterns.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::GetPatternForeColor

#include "ltwrappr.h"

COLORREF LBitmapWindow::GetPatternForeColor(void)

Gets the foreground color used for drawing patterns.

Returns

The pattern foreground color.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

L_VOID Test(LBitmapWindow L_FAR* pBitmapWindow)
{
COLORREF cr=pBitmapWindow->GetPatternForeColor();
}


LBitmapWindow::GetPatternStyle

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetPatternStyle(void)

Gets the style used for drawing patterns.

Returns

The 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)

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::GetRegionType

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetRegionType(void)

Gets the region type for the class object's window.

Returns

The region type. Possible values are:

Value | Meaning
REGION_TYPE_POLYGON: | polygonal region.
REGION_TYPE_RECT: | rectangular region.
REGION_TYPE_ELIPSE: | elliptical region.
REGION_TYPE_ROUNDRECT: | round rectangle region.
REGION_TYPE_TRIANGLE: | triangular region.
REGION_TYPE_FREE_HAND: | freehand region.
REGION_TYPE_CURVE: | smooth curved region.
REGION_TYPE_BEZIER: | curved region that is composed of a series of Bezier curves.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
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 LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetRgnCurveOptions

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::GetRgnCurveOptions(puFillMode, pdTension = NULL, pnClose = NULL)

L_UINT * puFillMode; | /* pointer to a variable to be updated */
L_DOUBLE * pdTension; | /* pointer to a variable to be updated */
L_INT * pnClose; | /* pointer to a variable to be updated */

Gets the curved region’s options set for the class object.

Parameter | Description
puFillMode | Pointer to a variable to be updated with the filling mode. Possible values are:
 | 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.
pdTension | Pointer to a variable to be updated with the tension value. Possible values range from 0.0 to 1.0. NULL is the default value.
pnClose | Pointer to a variable to be updated with a value that specifies how the curve is closed. 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).
 | NULL is the default value.

Returns

None.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::SetRgnCurveOptions, LBitmapWindow::SetToolType, LBitmapWindow::SetRegionType, Class Members

Example

L_VOID TestFunction(LBitmapWindow & BitmapWindow)
{
L_UINT uFillMode;
L_DOUBLE dTension;
L_INT nClose;

BitmapWindow.GetRgnCurveOptions(&uFillMode, &dTension, &nClose);

if (uFillMode == L_POLY_ALTERNATE)
BitmapWindow.SetRgnCurveOptions (L_POLY_WINDING, dTension,
 nClose);
}


LBitmapWindow::GetRgnFrameType

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetRgnFrameType(void)

Gets the frame type used for the class object's region frame.

Returns

The frame type for the drawn region. Possible values are:

Value | Meaning
RGNFRAME_STATIC | Static frame.
RGNFRAME_ANIMATED | Animated frame.
RGNFRAME_NONE | Hide the frame.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetROP3

#include "ltwrappr.h"

L_UINT32 LBitmapWindow::GetROP3(void)

Gets the Windows ROP code used for painting bitmaps.

Returns

The Windows ROP code used for painting bitmaps.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::GetToolType

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetToolType(void)

Gets the current tool type for the class object's window.

Returns

The current tool type. Possible values are:

Value | Meaning
TOOL_USERMODE | user tool type (default).
TOOL_PANIMAGE | pan image tool.
TOOL_ZOOMRECT | zoom rect tool.
TOOL_ZOOM_ON_MOUSECLICK | zoom in/out on mouse click.
TOOL_REGION | region tool type, the region shape is specified by LBitmapWindow::SetRegionType function.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetTransition

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetTransition(void)

Gets the filling style used when drawing transitions

Returns

The filling style used during transition. For valid values, refer to Effect Transition Filling Styles.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetTransitionEffect

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetTransitionEffect(void)

Gets the transition effect used when painting transitions.

Returns

The effect to apply when painting. For valid values, refer to Effect Types.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetTransitionParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::GetTransitionParameters(pTransDlgParm)

LPTRANSITIONDLGPARAMS pTransDlgParm;

/* pointer to the structure to be updated */

Gets the transition painting parameters that are used when painting transitions.

Parameter | Description
pTransDlgParm | Pointer to the structure of type TRANSITIONDLGPARAMS to be updated with the transition painting parameters.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::GetVertLineStep

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetVertLineStep(void)

Gets the vertical scrolling line step.

Returns

The vertical line step.

Comments

This is the amount by which the image will be scrolled when the user clicks the scrollbar's scroll-line button.

The default value is 5 pixels.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::GetZoomFactor

#include "ltwrappr.h"

L_FLOAT LBitmapWindow::GetZoomFactor(void)

Gets the zoom factor used when zooming in/out.

Returns

The zoom factor used when zooming in/out.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::GetZoomMode

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetZoomMode(void)

Gets the current zoom mode used by the class object's window.

Returns

The current zoom mode used by the bitmap window control. Possible values are:

Value | Meaning
ZOOM_FIT | fit the bitmap to the window while maintaining the aspect ratio.
ZOOM_STRETCH | stretch the bitmap to the window.
ZOOM_NORMAL | display the bitmap in its normal size.
ZOOM_FITWIDTH | fit the bitmap to the width of the window.
ZOOM_FITHEIGHT | fit the bitmap to the height of the window.
ZOOM_FACTOR | zoom the bitmap in or out while it is not in one of the fit states.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::GetZoomPercent

#include "ltwrappr.h"

L_UINT LBitmapWindow::GetZoomPercent(void)

Gets the current zoom percent.

Returns

The current zoom percent.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::GetZoomViewProps

#include "ltwrappr.h"

L_INT LBitmapWindow::GetZoomViewProps(pZoomViewProps, uStructSize)

pZOOMVIEWPROPS pZoomViewProps; | /* pointer to a ZOOMVIEWPROPS 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
pZoomViewProps | Pointer to the ZOOMVIEWPROPS structure that contains the Zoom View settings to be created for the class object.
uStructSize | Size in bytes, of the structure pointed to by pZoomViewProps. 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 LBitmapWindow::AddZoomView function.

When a Zoom View is no longer needed, call the LBitmapWindow::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 LBitmapWindow::UpdateZoomView.

For more information on the Zoom View options, refer to the ZOOMVIEWPROPS structure.

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.

See Also

Functions: | LBitmapWindow::HasZoomView, LBitmapWindow::AddZoomView, LBitmapWindow::UpdateZoomView, LBitmapWindow::DestroyZoomView, LBitmapWindow::GetZoomViewsCount, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

For an example, refer to LBitmapWindow::UpdateZoomView.


LBitmapWindow::GetZoomViewsCount

#include "ltwrappr.h"

L_INT LBitmapWindow::GetZoomViewsCount(void)

Gets the number of zoomed views that have been associated with the bitmap window. This function is available in the Document/Medical Toolkits.

Returns

>= 0 | The number of Zoom Views.
< 0 | An error occurred. Refer to Return Codes.

Comments

This function will return a count of the number of Zoom Views that have been created for the specified bitmap window. Zoom Views are created by calling the LBitmapWindow::AddZoomView 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.

See Also

Functions: | LBitmapWindow::HasZoomView, LBitmapWindow::AddZoomView, LBitmapWindow::UpdateZoomView, LBitmapWindow::DestroyZoomView, LBitmapWindow::GetZoomViewProps, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

For an example, refer to LBitmapWindow::AddZoomView.


LBitmapWindow::HandlePalette

#include "ltwrappr.h"

L_BOOL LBitmapWindow::HandlePalette(uMsg, wParam, lParam)

UINT uMsg; | /* window message */
WPARAM wParam; | /* first parameter of the window message */
LPARAM lParam; | /* second parameter of the window message */

Call this function to let the bitmap window automatically handle the palette based on the specified message.

Parameter | Description
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

TRUE | The bitmap window was repainted.
FALSE | The bitmap window was not repainted.

Comments

This function works with the following Windows messages:

WM_PALETTECHANGED

WM_QUERYNEWPALETTE

WM_SYSCOLORCHANGE

This function will respond to these messages by automatically handling palette issues properly.

You are responsible for calling this function with the appropriate window message to let the class object's window respond to palette changes.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Handling Palette Changes

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::HasFloater

#include "ltwrappr.h"

L_BOOL LBitmapWindow::HasFloater(void)

Determines whether the class object currently has a floater.

Returns

TRUE | The class object currently has a floater.
FALSE | The class object currently does not have a floater.

Comments

The LBitmapWindow object can have a region with no corresponding floater.

LBitmapWindow::SetAutoRgnToFloater will automatically generate a floater from a programmatically created region.

To access the floater, use LBitmapWindow::GetFloater.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::GetFloater, LBitmapWindow::GetFloaterRgn, LBitmapWindow::SetAutoRgnToFloater, LBitmapWindow::GetAutoRgnToFloater, Class Members, Floaters and Regions in the LbitmapWindow Class

Example

For an example, refer to LBitmapWindow::SetAutoRgnToFloater.


LBitmapWindow::HasZoomView

#include "ltwrappr.h"

L_BOOL LBitmapWindow::HasZoomView(void)

Determines whether the class object currently has one or more Zoom Views attached to it. This function is available in the Document/Medical Toolkits.

Returns

TRUE | The class object currently has one or more Zoom Views attached to it.
FALSE | The class object currently does not any Zoom Views attached to it.

Comments

Use the LBitmapWindow::GetZoomViewsCount function to determine how many Zoom Views are attached to the class object.

To attach a zoomed view to a window, call the LBitmapWindow::AddZoomView function.

When the zoomed view is no longer needed, call the LBitmapWindow::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.

See Also

Functions: | LBitmapWindow::AddZoomView, LBitmapWindow::GetZoomViewProps, LBitmapWindow::UpdateZoomView, LBitmapWindow::DestroyZoomView, LBitmapWindow::GetZoomViewsCount, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

For an example, refer to LBitmapWindow::AddZoomView.


LBitmapWindow::IsAutoPaintEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsAutoPaintEnabled(void)

Determines whether the bitmap window painting is enabled.

Returns

TRUE | Bitmap window painting is enabled.
FALSE | Bitmap window painting is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::IsAutoScrollEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsAutoScrollEnabled(void)

Determines whether auto scrolling is enabled or disabled.

Returns

TRUE | Auto scrolling is enabled.
FALSE | Auto scrolling is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::IsCenterOnZoomEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsCenterOnZoomEnabled(void)

Determines whether centering on zoom is enabled.

Returns

TRUE | Centering on zoom is enabled.
FALSE | Centering on zoom is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd)
{
if(BmpWnd.IsCenterOnZoomEnabled()==FALSE)
BmpWnd.EnableCenterOnZoom(TRUE);
}


LBitmapWindow::IsDoubleBufferEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsDoubleBufferEnabled(void)

Determines whether the bitmap window double buffer is enabled.

Returns

TRUE | Bitmap window double buffering is enabled.
FALSE | Bitmap window double buffering is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::EnableDoubleBuffer.


LBitmapWindow::IsDragAcceptFilesEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsDragAcceptFilesEnabled(void)

Determines whether drag/drop is enabled for the class object’s window.

Returns

TRUE | Drag/drop is enabled.
FALSE | Drag/drop is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::IsDrawGradientEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsDrawGradientEnabled(void)

Determines whether drawing gradients is enabled or disabled.

Returns

TRUE | Gradient drawing is enabled.
FALSE | Gradient drawing is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::IsDrawPatternEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsDrawPatternEnabled(void)

Determines whether drawing patterns is enabled or disabled.

Returns

TRUE | Drawing patterns is enabled.
FALSE | Drawing patterns is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::IsKeyBoardEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsKeyBoardEnabled(void)

Determines whether keyboard processing is enabled or disabled.

Returns

TRUE | Keyboard processing is enabled.
FALSE | Keyboard processing is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd)
{
if(BmpWnd.IsKeyBoardEnabled()==FALSE)
BmpWnd.EnableKeyBoard(TRUE);
}


LBitmapWindow::IsPaintEffectEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsPaintEffectEnabled(void)

Determines whether the use of paint effects is enabled or disabled.

Returns

TRUE | The use of paint effects is enabled.
FALSE | The use of paint effects is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::IsPaintSizeUseDPIEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsPaintSizeUseDPIEnabled(void)

Determines whether painting the bitmap using the DPI settings is enabled or disabled.

Returns

TRUE | Painting the bitmap using the DPI settings is enabled.
FALSE | Painting the bitmap using the DPI settings is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::IsPaintTransitionEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsPaintTransitionEnabled(void)

Determines whether the use of paint transitions is enabled or disabled.

Returns

TRUE | The use of paint transitions is enabled.
FALSE | The use of paint transitions is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::IsPaintWhileLoadEnabled

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsPaintWhileLoadEnabled(void)

Determines whether PaintWhileLoad is enabled or disabled.

Returns

TRUE | Painting the bitmap while loading is enabled.
FALSE | Painting the bitmap while loading is disabled.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::EnablePaintWhileLoad.


LBitmapWindow::IsPanWndCreated

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsPanWndCreated(void)

Determine whether the Pan Window has been created.

Returns

TRUE | The Pan Window has been created.
FALSE | The Pan Window has not been created.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::IsToolTypeMagGlass

#include "ltwrappr.h"

L_BOOL LBitmapWindow::IsToolTypeMagGlass(L_VOID)

Determines whether the tool type for the class object's window is currently set to the magnifying glass tool.

Returns

TRUE | The tool type is set to the magnifying glass tool.
FALSE | The tool type is not set to the magnifying glass tool.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::GetMagGlassOptions, LBitmapWindow::SetMagGlassOptions, LBitmapWindow::SetToolType, Class Members
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

The following function changes the magnification zoom factor if the tool type is set to the magnifying glass tool.

L_BOOL ChangeMagGlassZoom(LBitmapWindow & BitmapWindow, L_INT nZoom)
{
if (!BitmapWindow.IsToolTypeMagGlass())
return FALSE;

MAGGLASSOPTIONS mgd;
BitmapWindow.GetMagGlassOptions(&mgd, sizeof(MAGGLASSOPTIONS));
mgd.nZoom = nZoom;
BitmapWindow.SetMagGlassOptions(&mgd);

return TRUE;
}


LBitmapWindow::Load

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::Load(nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LBitmapWindow::Load(nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)

virtual L_INT LBitmapWindow::Load(pszFileName, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

virtual L_INT LBitmapWindow::Load(pszFileName, nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)

L_TCHAR L_FAR * pszFileName; | /* name of the file to load */
L_INT nBitsPerPixel; | /* resulting bitmap’s pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48, and 64-bit bitmaps */
L_INT nPage; | /* the page number of the first image to be loaded */
LOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads a bitmap image from disk into the class object. The image file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
pszFileName | Character string containing the name of the file to load.
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant bitmap
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmap
 | 24 | 24 bits per pixel in the resultant bitmap
 | 32 | 32 bits per pixel in the resultant bitmap
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 64 bits per pixel in the resultant bitmap
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 toolkits.
 | 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 toolkits 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 toolkits only.
nPage | The page number (for multipage files) that contains the first image to be loaded. If the file is not a multipage file, pass 0.
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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

Call this function to load a bitmap image from disk into the class object.

If PaintWhileLoad is enabled for the bitmap window the loaded image will be painted as it is loaded. In this case, the mapped file object will not be used for the load operation. If PaintWhileLoad is disabled the mapped file object will be used for the load operation.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical 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 multipage 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.

The class object will free the bitmap when it is destroyed. If you wish to free the bitmap, use LBitmapBase::Free.

If the paint while load is enabled for the bitmap window, then the loaded image will be painted as it is loaded.

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.

Note: For information on loading and saving large TIFF files faster, refer to Loading and Saving Large TIFF Files.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members, LBitmapBase::GetLoadStatus, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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 is an example for LBitmapWindow::Load(nBitsPerPixel=0,
 nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL,
 pFileInfo=NULL):*/

void OnBUTTONLBitmapWindowLoad1()
{
LBitmapWindow BitmapWindow;
BitmapWindow.SetFileName(TEXT("d:\\work\\images\\eagle.jpg"));
BitmapWindow.Load();
BitmapWindow.Save(FILE_TIF,
 1, 0, NULL);
}

/*This is an example for LBitmapWindow::Load(nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)*/

void OnBUTTONLBitmapWindowLoad2()
{
LBitmapWindow BitmapWindow;
BitmapWindow.SetFileName(TEXT("d:\\work\\images\\eagle.jpg"));
BitmapWindow.Load(0,ORDER_BGR,
 1);
BitmapWindow.Save(FILE_TIF,
 2, 0, 1, MULTIPAGE_OPERATION_OVERWRITE);
}

/*This is an example for LBitmapWindow::Load(pszFileName,
 nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL,
 pFileInfo=NULL)*/

void OnBUTTONLBitmapWindowLoad3()
{
LBitmapWindow BitmapWindow;
BitmapWindow.Load(TEXT("d:\\ltwin14x\\images\\image1.cmp"),
 0,ORDER_BGR, NULL);
BitmapWindow.Save(TEXT("d:\\work\\images\\temp.tif"),
 FILE_TIF, 1, 0,NULL);
}

/*This is an example for LBitmapWindow::Load(pszFileName, nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)*/

void OnBUTTONLBitmapWindowLoad4()
{
LBitmapWindow BitmapWindow;
BitmapWindow.Load(TEXT("d:\\ltwin14x\\images\\image2.cmp"),
 0,ORDER_BGR, 1);
BitmapWindow.Save(TEXT("d:\\work\\images\\temp.tif"),
 FILE_TIF, 2, 0,1, MULTIPAGE_OPERATION_OVERWRITE);
}


LBitmapWindow::m_hWnd

#include "ltwrappr.h"

HWND m_hWnd

Comments

This is the window handle of the class object's bitmap window control. This data member will be filled when LBitmapWindow::CreateWnd is called.

You can use this member variable if you derive a class from LBitmapWindow.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Wrapper Macros, Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::MagGlassCallBack

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::MagGlassCallBack(hWnd, nMaskPlaneStart, nMaskPlaneEnd, pMaskPlane, nMaskPlaneSize)

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 */

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.
 | 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 is called 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, you must call LBitmapWindow::SetToolType, and also you must override LBitmapWindow::MagGlassCallBack. 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.

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.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::SetMagGlassOptions, LBitmapWindow::GetMagGlassOptions
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

class MyBitmapWindow : public LBitmapWindow
{
public:
L_INT MagGlassCallback (HWND hWnd, L_INT nMaskPlaneStart, L_INT nMaskPlaneEnd, L_UCHAR L_FAR *pMaskPlane, L_INT nMaskPlaneSize);
};

L_INT MyBitmapWindow::MagGlassCallback (HWND hWnd, L_INT nMaskPlaneStart, L_INT nMaskPlaneEnd, L_UCHAR L_FAR *pMaskPlane, L_INT nMaskPlaneSize)
{
// .. Write your code here.
return SUCCESS;
}

L_VOID MyTestFunction(MyBitmapWindow *LeadBWnd )
{
LeadBWnd->EnableCallBack(TRUE);
LeadBWnd->LBitmapWindow::SetToolType(TOOL_MAGGLASS) ;
}


LBitmapWindow::Move

#include "ltwrappr.h"

L_INT LBitmapWindow::Move(rect, bFlag=TRUE)

RECT& rect; | /* RECT structure that contains the new dimensions and/or position of the bitmap window */
L_BOOL bFlag; | /* flag that indicates whether the window will update the display */

Moves and/or resizes the class object's window.

Parameter | Description
rect | RECT structure that contains the new dimensions and/or position of the bitmap window.
bFlag | Flag that indicates whether the window will update the display. Possible values are:
 | Value | Meaning
 | TRUE | The bitmap window will update the display.
 | FALSE | The bitmap window will not update the display.

Returns

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

Comments

The rect parameter is passed by reference, and is a required parameter.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::MsgProcCallBack

#include "ltwrappr.h"

virtual LRESULT LBitmapWindow::MsgProcCallBack(hWnd, uMsg, wParam, lParam)

HWND hWnd; | /* handle to the bitmap window */
UINT uMsg; | /* the window message */
WPARAM wParam; | /* the first parameter of the window message */
LPARAM lParam; | /* the second parameter of the window message */

This function is called for each message the bitmap window control receives.

Parameter | Description
hWnd | Handle to the bitmap window.
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

The result of processing a specific message.

Comments

Override this function to do your own processing of window events and messages. If you override this function you must call the base class implementation (LBitmapWindow::MsgProcCallBack) for default processing.

The following messages are NOT passed to the LBitmapWindow::MsgProcCallBack. To get these messages, sub-class the window using SetWindowLong().:

WM_GETDLGCODE
WM_SETCURSOR
WM_ERASEBKGND
WM_PAINT

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::OnDraw

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::OnDraw(hdc, Rect)

HDC hdc; | /* the device context */
RECT& Rect; | /* the rectangle to be updated */

This function is called whenever the class object updates its window.

Parameter | Description
hdc | The device context of the bitmap window.
Rect | The bitmap window rectangle to be updated.

Returns

None

Comments

Override this function if you want to do your own drawing on the class object's window.

This function will be called following the class object's own processing of the WM_PAINT message.

The rect parameter is passed by reference, and is a required parameter.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::OnFileDropped

#include "ltwrappr.h"

virtual L_BOOL LBitmapWindow::OnFileDropped(pszFile, uFileNumber, uFilesCount)

L_TCHAR L_FAR * pszFile; | /* dropped file name */
L_UINT uFileNumber; | /* dropped file number */
L_UINT uFilesCount; | /* total number of dropped files */

This function is called for every file that is dropped on the LBitmapWindow object's window.

Parameter | Description
pszFile | The name of the dropped file.
uFileNumber | The number of the dropped file.
uFilesCount | The total number of dropped files.

Returns

TRUE | Continue processing.
FALSE | Stop processing.

Comments

This function will be called repeatedly as a result of a file drag/drop operations. The function will be called for every file that is dropped on the LBitmapWindow object's window. Override this function if you want to handle the dropped files. The default implementation will attempt to load the image file and display the image.

If more than one file is dropped, then this function will be called for every dropped file, as long as you continue to return TRUE from this function. If you return FALSE, the enumeration process will be terminated.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::OnZoom

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::OnZoom(uZoomPercent)

L_UINT uZoomPercent;

/* the zoom percent */

This function is called whenever a zoom operation is requested on the bitmap window.

Parameter | Description
uZoomPercent | The zoom percent. The minimum value is 1.

Returns

None

Comments

Override this function to be notified of any zooming on the displayed bitmap.

A zoom can be requested by the following:

user presses one of the keys defined for zooming

user draws a rectangle while the current tool type is set to TOOL_ZOOMRECT

user clicks the mouse in the class object's window while the current tool type is set to TOOL_ZOOM_ON_MOUSECLICK

If the zoom occurs because the user has zoomed using the TOOL_ZOOMRECT tool, the zoom percent is updated. You can call LBitmapWindow::GetZoomPercent to get the zoom percent currently used to display the image.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::PaintNotification

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::PaintNotification(nPass, uType)

L_INT nPass; | /* current paint effect pass */
L_INT uType; | /* type of effect */

This function is called on every pass, when painting the bitmap using paint effects.

Parameter | Description
nPass | The current paint effect pass. Possible values are:
 | Value | Meaning
 | 0 | No passes have painted. The first pass is next.
 | 1 | One pass has painted. The second pass is next.
 | 0 | The second pass has painted. The third pass is next.
 | And so forth.... |
uType | The type of effect. Possible values are:
 | Value | Meaning
 | EFX_NOTIFY_TRANSITION | Painting a transition.
 | EFX_NOTIFY_IMAGE | Painting an image.

Returns

None

Comments

Override this function to be notified on every painting pass of a paint effect. This will enable you to change the effect type between passes.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::PanWndCallBack

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::PanWndCallBack(uFlag, prcPan)

L_UINT uFlag; | /* flag that indicates the reason for the notification */
LPRECT prcPan; | /* pointer to the Pan RECT */

Called to notify the main window of changes to the associated Pan Window.

Parameter | Description
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_REPAINT | [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. You must convert these coordinates to match your main window's current zoom factor.

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.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::Repaint

#include "ltwrappr.h"

L_VOID LBitmapWindow::Repaint(pRect=NULL)

LPRECT pRect;

/* pointer to a rectangle structure */

Repaints the class object's window. Only the specified rectangle will be repainted.

Parameter | Description
pRect | Pointer to a rectangle structure that describes the rectangle to be repainted. Pass NULL to repaint the entire window.

Returns

None

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_INT MyFunction(HWND hWndParent)
{
LBitmapWindow LeadBWnd ;
L_UINT uZoomMode ;
RECT rectZoom ;

if (LeadBWnd.Load(TEXT("image1.cmp")) == SUCCESS)
{
if (LeadBWnd.CreateWnd(hWndParent, TRUE, 0, 0, 100, 100) == NULL)
return 0;

if (LeadBWnd.IsAutoPaintEnabled() == FALSE)
// stop paint
LeadBWnd.EnableAutoPaint(TRUE) ;

/* repaint the image, but paint stopped,
then the Repaint will not paint the image */
LeadBWnd.Repaint() ;

// start paint with new updates
LeadBWnd.EnableAutoPaint(FALSE) ;
// repaint the image
LeadBWnd.Repaint() ;

// get zoom mode for current bitmap window
uZoomMode = LeadBWnd.GetZoomMode();
if (uZoomMode != ZOOM_ZOOMFACTOR)
{
uZoomMode = ZOOM_FITHEIGHT ;
// change the zoom mode for current bitmap window
LeadBWnd.SetZoomMode(uZoomMode) ;
}

//...
//...

if (LeadBWnd.GetHorzLineStep() != 2)
LeadBWnd.SetHorzLineStep(2) ;

if (LeadBWnd.GetVertLineStep() != 2)
LeadBWnd.SetVertLineStep(2) ;

// check if auto scroll bars is enable or not
if (LeadBWnd.IsAutoScrollEnabled() == FALSE)
LeadBWnd.EnableAutoScroll(TRUE) ;

// fill zoom rect to use it in ZoomToRect
rectZoom.left = 50 ;
rectZoom.top = 50 ;
rectZoom.right = 75 ;
rectZoom.bottom= 75 ;

LeadBWnd.ZoomToRect(rectZoom) ;

//...
//...

// use ScrollBars (Horizontal & Vertical)

// 10 = the distance to scroll the bitmap horizontally.
// 20 = the distance to scroll the bitmap horizontally.
LeadBWnd.ScrollBy( 10, 20) ;

// go to 10 position on horizontal scroll in bitmap
// go to 20 position on vertical scroll in bitmap
LeadBWnd.ScrollTo( 10, 20) ;
}

return SUCCESS ;
}


LBitmapWindow::ScrollBy

#include "ltwrappr.h"

POINT LBitmapWindow::ScrollBy(dx, dy)

L_INT dx; | /* horizontal distance */
L_INT dy; | /* vertical distance*/

Scrolls the displayed bitmap by the specified amount.

Parameter | Description
dx | The distance to scroll the bitmap horizontally.
dy | The distance to scroll the bitmap vertically.

Returns

A point structure that holds the actual horizontal and vertical distances by which the bitmap was scrolled.

Comments

The units for dx and dy are in pixels, with the top, left pixel of the image being 0,0.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::ScrollTo

#include "ltwrappr.h"

POINT LBitmapWindow::ScrollTo(x, y)

L_INT x; | /* the x position to which to scroll the bitmap */
L_INT y; | /* the y position to which to scroll the bitmap */

Scrolls the displayed bitmap to the specified position.

Parameter | Description
x | The x position to which to scroll the bitmap.
y | The y position to which to scroll the bitmap.

Returns

A point structure that holds the actual horizontal and vertical distances by which the bitmap was scrolled.

Comments

The units for x and y are in pixels, with the top, left pixel of the image being 0,0.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::SetAutoFloaterToRgn

#include "ltwrappr.h"

L_BOOL LBitmapWindow::SetAutoFloaterToRgn(bAutoFloaterToRgn=TRUE)

L_BOOL bAutoFloaterToRgn;

/* flag that indicates whether to automatically create a region */

Enables or disables the automatic creation of a bitmap region when using the TOOL_REGION tool.

Parameter | Description
bAutoFloaterToRgn | Flag that indicates whether to automatically create a region when using the TOOL_REGION. Possible values are:
 | Value | Meaning
 | TRUE | Enable the automatic creation of a region when creating floaters using the TOOL_REGION tool.
 | FALSE | Disable the automatic creation of a region when creating floaters using the TOOL_REGION tool.

Returns

The previous setting.

TRUE | The previous setting was TRUE.
FALSE | The previous setting was FALSE.

Comments

LbitmapWindow::SetToolType(TOOL_REGION) lets the user create a floater with the mouse. To create a bitmap region, in addition to the floater, call LbitmapWindow::SetAutoFloaterToRgn(TRUE). By default, a floater is created, but not a region.

Libraries

win32

ltkrn14n.dll (ltkrn_n.lib import library)
ltdis14n.dll (ltdis_n.lib import library)
ltfil14n.dll (ltfil_n.lib import library)
ltimg14n.dll (ltimg_n.lib import library)
ltefx14n.dll (ltefx_n.lib import library)
ltdlg14n.dll (ltdlg_n.lib import library)
ltisi14n.dll (ltisi_n.lib import library)
lttwn14n.dll (lttwn_n.lib import library)
ltscr14n.dll (ltscr_n.lib import library)

See Also

Functions: | LBitmapWindow::SetAutoFloaterToRgn, LBitmapWindow::GetFloater, LBitmapWindow::HasFloater, LBitmapWindow::CancelRgn, LBitmapWindow::SetAutoRgnToFloater, LBitmapWindow::GetAutoRgnToFloater, Class Members
Topics: | Floaters and Regions in the LBitmapWindow Class

Example

For an example, refer to LBitmapWindow::GetAutoFloaterToRgn.


LBitmapWindow::SetAutoRgnToFloater

#include "ltwrappr.h"

L_BOOL LBitmapWindow::SetAutoRgnToFloater(bAutoRgnToFloater)

L_BOOL bAutoRgnToFloater;

/* flag that indicates whether to create the floater */

Enables or disables the automatic creation of a floater from a region.

Parameter | Description
bAutoRgnToFloater | Flag that indicates whether to enable or disable the automatic creation of a floater from a region. Possible values are:
 | Value | Meaning
 | TRUE | [1] Enable the automatic creation of a floater from the region. This is the default value.
 | FALSE | [0] Disable the automatic creation of a floater from the region.

Returns

The previous setting.

TRUE | The previous setting was TRUE.
FALSE | The previous setting was FALSE.

Comments

The view perspective is always TOP_LEFT.

If you move the floater, the original region remains unchanged.

This member function does not affect the creation of floaters using the TOOL_REGION tool. This function only affects the behavior of the Lregion functions on the LbitmapWindow().

To create a floater programmatically with no region, do the following:

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(TRUE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

To create a region programmatically with no floater, do the following:

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(FALSE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

LBitmapWindow::GetFloater, LBitmapWindow::GetFloaterRgn, LBitmapWindow::HasFloater, LBitmapWindow::GetAutoRgnToFloater, Class Members, Floaters and Regions in the LbitmapWindow Class

Example

LBitmapWindow *pBitmapWindow = new(LBitmapWindow);
LBitmapRgn *pBitmapRgn = new(LBitmapRgn);
RECT rRgnBounds, myRect;
L_BOOL bIsValid;
L_BOOL bAutoRgnToFloater;
L_BOOL bBitmapHasRgn;
L_BOOL bHasRgn;
L_BOOL bHasFloater;
L_TCHAR szTemp[300], szOutput[300];
HRGN hRgn;

pBitmapWindow->EnableAutoPaint(TRUE);
pBitmapWindow->SetWndHandle(m_hWnd);
pBitmapWindow->Load(TEXT("d:\\work\\images\\biggrid.bmp"));
pBitmapWindow->SetAutoRgnToFloater (TRUE);

pBitmapRgn->SetBitmap(pBitmapWindow);
RECT Rect={10,20,50,100};
pBitmapRgn->SetRgnRect(&Rect); //set the rect as a region

bIsValid = pBitmapRgn->IsValid();
bAutoRgnToFloater = pBitmapWindow->GetAutoRgnToFloater();
bBitmapHasRgn = pBitmapRgn->BitmapHasRgn();
bHasRgn = pBitmapWindow->HasRgn();
bHasFloater = pBitmapWindow->HasFloater();
pBitmapRgn->GetRgnBounds(&rRgnBounds);

wsprintf( szOutput,
TEXT("[%d]pBitmapRgn->IsValid()\n[%d]pBitmapWindow->GetAutoRgnToFloater()\n[%d]pBitmapRgn->BitmapHasRgn()\n[%d]pBitmapWindow->HasRgn()\n[%d]pBitmapWindow->HasFloater()\npBitmapRgn->GetRgnBounds(%d, %d, %d, %d)\n\n"),
bIsValid,
bAutoRgnToFloater,
bBitmapHasRgn,
bHasRgn,
bHasFloater,
rRgnBounds.left,
rRgnBounds.top,
rRgnBounds.right,
rRgnBounds.bottom
);

hRgn = pBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_NONE);
GetRgnBox(hRgn, &myRect);
wsprintf(szTemp, TEXT("%spBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_NONE) (%d, %d, %d, %d)\n"),
szOutput,
myRect.left,
myRect.top,
myRect.right,
myRect.bottom);
lstrcpy(szOutput, szTemp);

hRgn = pBitmapWindow->GetFloaterRgn (FLOAT_RGN_TRANS_FROM_WINDOW); //bombs
GetRgnBox(hRgn, &myRect);
wsprintf(szTemp, TEXT("%spBitmapWindow->GetFloaterRgn(FLOAT_RGN_TRANS_FROM_WINDOW) (%d, %d, %d, %d)\n"),
szOutput,
myRect.left,
myRect.top,
myRect.right,
myRect.bottom);
lstrcpy(szOutput, szTemp);
AfxMessageBox(szOutput);


LBitmapWindow::SetDefaultDithering

#include "ltwrappr.h"

L_INT LBitmapWindow::SetDefaultDithering(uMethod)

L_UINT uMethod;

/* the dithering mode to set */

Specifies the default dithering method to use when converting an image from 32, 24, or 16 bits per pixel to 8 bits per pixel or fewer.

Parameter | Description
uMethod | The dithering mode to be set for the bitmap. This is the local dithering mode for the class object and will not affect the global dithering mode. The dithering mode will be set when painting the bitmap. Possible 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.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this function to set the default dithering mode for the class object. The local setting will be set when painting the bitmap.

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.

This will also set the default dithering for the floater bitmap to the passed value.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
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

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetDefaultDithering(CLUSTERED_DITHERING);


LBitmapWindow::SetDisplayMode

#include "ltwrappr.h"

L_INT LBitmapWindow::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 LBitmapWindow::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 LBitmapWindow::SetDisplayMode Function for descriptions of the flags.

Returns

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

Comments

This will be the local display mode setting for the class object and is used when painting the bitmap.

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:

MyBitmapBase::SetDisplayMode( DISPLAYMODE_FASTPAINT | DISPLAYMODE_DITHEREDPAINT, DISPLAYMODE_FASTPAINT );

This will set the display flags for the floater bitmap to the passed values and will create a new paint palette for the bitmap window and the floater.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | LBitmapBase::GetDisplayMode, LBitmapWindow::EnableLocalSettings, LBitmapBase::IsLocalSettingsEnabled, Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetDisplayMode(DISPLAYMODE_SCALETOGRAY, DISPLAYMODE_SCALETOGRAY);


LBitmapWindow::SetEffectParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::SetEffectParameters(pEfxDlgParm)

LPEFFECTDLGPARAMS pEfxDlgParm;

/* pointer to a structure */

Sets the effect painting parameters that will be used when painting effects.

Parameter | Description
pEfxDlgParm | Pointer to a structure of type EFFECTDLGPARAMS that contains the effect painting parameters to set.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::GetEffectParameters, Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetGradientParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::SetGradientParameters(pGradDlgParm)

LPGRADIENTDLGPARAMS pGradDlgParm;

/* pointer to a structure */

Sets the gradient painting parameters that will be used when painting gradients.

Parameter | Description
pGradDlgParm | Pointer to a structure of type GRADIENTDLGPARAMS that contains the gradient painting parameters to be set.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::GetGradientParameters, Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetGradientStyle

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetGradientStyle(uGradientStyle)

L_UINT uGradientStyle;

/* gradient style */

Sets the gradient style used when drawing gradients.

Parameter | Description
uGradientStyle | Gradient style. For valid values, refer to Effect Gradient Styles.

Returns

None

Comments

The default is EFX_GRADIENT_LINE_L_TO_R.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetHorzLineStep

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetHorzLineStep(nHLineStep)

L_INT nHLineStep;

/* the horizontal line step */

Sets the horizontal scrolling line step.

Parameter | Description
nHLineStep | The horizontal line step.

Returns

None

Comments

This is the amount by which the image will be scrolled when the user clicks the scrollbar's scroll-line button.

The default value is 5 pixels.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::SetMagGlassOptions

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::SetMagGlassOptions (pOptions=NULL)

MAGGLASSOPTIONS * pOptions;

/* pointer to a MAGGLASSOPTIONS structure */

Sets the magnifying glass options for the class object.

Parameter | Description
pOptions | Pointer to the MAGGLASSOPTIONS structure that contains the magnifying glass options to be set for the class object.

Returns

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

Comments

For more information on the magnifying glass options, refer to the MAGGLASSOPTIONS structure.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | LBitmapWindow::GetMagGlassOptions, LBitmapWindow::MagGlassCallBack, Class Members
Topics: | Using the Magnifying Glass
 | Raster Image Functions: Displaying Images
 | Using the Zoom View

Example

For an example, refer to LBitmapWindow::GetMagGlassOptions.


LBitmapWindow::SetMaxEffectPasses

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetMaxEffectPasses(uMaxPasses)

L_UINT uMaxPasses;

/* maximum number of passes */

Sets the maximum number of passes used when painting effects.

Parameter | Description
uMaxPasses | The maximum number of passes used for painting effects. Valid values are 1 - 64.

Returns

None

Comments

The default is 1.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetMaxTransitionPasses

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetMaxTransitionPasses(uMaxPasses)

L_UINT uMaxPasses;

/* maximum number of passes */

Sets the maximum number of passes used when drawing transitions.

Parameter | Description
uMaxPasses | The maximum number of passes used for drawing transitions. Valid values are 1 - 64.

Returns

None

Comments

The default is 1.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetPaintContrast

#include "ltwrappr.h"

L_INT LBitmapWindow::SetPaintContrast(nValue)

L_INT nValue;

/* amount of contrast change */

Sets the paint contrast value used by painting operations. This value can be retrieved using the LBitmapBase::GetPaintContrast function.

Parameter | Description
nValue | The 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

Use this function to set the value to be used for the paint contrast. This is the local paint contrast for the class object and is used when painting the bitmap.

This sets the paint contrast for the floater bitmap to the passed value.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Raster Image Functions: Displaying Images

Example

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintContrast(50);


LBitmapWindow::SetPaintEffect

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetPaintEffect(uEffect)

L_UINT uEffect;

/* the effect to apply when painting */

Sets the paint effect used for painting the bitmap.

Parameter | Description
uEffect | The effect to apply when painting. For valid values, refer to Effect Types.

Returns

None

Comments

The default is EFX_EFFECT_NONE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetPaintGamma

#include "ltwrappr.h"

L_INT LBitmapWindow::SetPaintGamma(uValue)

L_UINT uValue;

/* the gamma value */

Sets the current gamma correction value for the class object’s bitmap. This value isused by painting operations and can be retrieved using the LBitmapBase::GetPaintGamma function.

Parameter | Description
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

This is the local paint gamma for the class object and is used when painting the bitmap.

Setting the gamma correction that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

Intensity values ideally follow a logarithmic progression, because the eye perceives changes in intensity as being equal when the ratio of change is equal. For example, we would see a change from 0.1 to 0.2 as being equal to a change from 0.2 to 0.4.

Gamma is a standard constant that is used to calculate the progression. For most CRTs the gamma constant is in the range of 2.2 to 2.5.

This sets the paint gamma for the floater bitmap to the passed value.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast

Example

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintGamma(150);


LBitmapWindow::SetPaintIntensity

#include "ltwrappr.h"

L_INT LBitmapWindow::SetPaintIntensity(nValue)

L_INT nValue;

/* the amount to change the intensity */

Sets the current intensity value of the class object’s bitmap. This value is used by painting operations and can be retrieved using the LBitmapBase::GetPaintIntensity function.

Parameter | Description
nValue | The 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

This will be the local paint intensity setting for the class object and is used when painting the bitmap.

Setting the intensity value that is used for painting lets you adjust the displayed brightness of all images without changing the bitmap data.

This sets the paint intensity for the floater bitmap to the passed value.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Changing Brightness and Contrast

Example

LBitmapWindow MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"),24);
MyBitmap.SetPaintIntensity(50);


LBitmapWindow::SetPatternBackColor

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetPatternBackColor(PatternBackColor)

COLORREF PatternBackColor;

/* the background color used for drawing patterns */

Sets the background color used for drawing patterns.

Parameter | Description
PatternBackColor | The background color used for drawing patterns.

Returns

None

Comments

The default is the value returned by the Windows API GetSysColor(COLOR_APPWORKSPACE).

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::SetPatternForeColor

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetPatternForeColor(PatternForeColor)

COLORREF PatternForeColor;

/* the foreground color for drawing patterns */

Sets the foreground color used for drawing patterns.

Parameter | Description
PatternForeColor | The foreground color for drawing patterns.

Returns

None

Comments

The default is RGB(255,123,24).

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::SetPatternStyle

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetPatternStyle(uPatternStyle)

L_UINT uPatternStyle;

/* the filling style */

Sets the filling style used for drawing patterns.

Parameter | Description
uPatternStyle | The 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)

Returns

None

Comments

The default is EFX_PATTERN_CROSS.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::SetROP3.


LBitmapWindow::SetRegionType

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetRegionType(uRegionType)

L_UINT uRegionType;

/* the region type to set */

Sets the region type for the class object's window.

Parameter | Description
uRegionType | The region type to set. Possible values are:
 | Value | Meaning
 | REGION_TYPE_POLYGON | polygonal region.
 | REGION_TYPE_RECT | rectangular region.
 | REGION_TYPE_ELIPSE | elliptical region.
 | REGION_TYPE_ROUNDRECT | round rectangle region.
 | REGION_TYPE_TRIANGLE | triangular region.
 | REGION_TYPE_FREE_HAND | freehand region.
 | REGION_TYPE_CURVE | smooth curved region.
 | REGION_TYPE_BEZIER | curved region that is composed of a series of Bezier curves.

Returns

None

Comments

This setting determines the shape of a region, created when the user clicks and drags the mouse, if the LBitmapWindow object is set to use the TOOL_REGION tool. See LBitmapWindow::SetToolType for more information.

The default setting is REGION_TYPE_POLYGON.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
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 LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetRgnCurveOptions

#include "ltwrappr.h"

virtual L_VOID LBitmapWindow::SetRgnCurveOptions(uFillMode, dTension, nClose)

L_UINT uFillMode; | /* filling mode */
L_DOUBLE dTension; | /* tension value */
L_INT nClose; | /* value that specifies how the curve is closed */

Sets the curved region’s options for the class object.

Parameter | Description
uFillMode | The filling mode. Possible values are:
 | 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 | Determines the straightness of the curve lines that connect the points of the curved region. Valid values range from 0.0 to 1.0.
nClose | A value that specifies how the curve is closed. 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).

Returns

None.

Comments

Use this function to specify the options of a curved region prior to drawing it. If an invalid value is passed for a parameter, it won’t be set.

Refer to the CURVE structure for more information on the options mentioned above.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

LBitmapWindow::GetRgnCurveOptions, LBitmapWindow::SetToolType, LBitmapWindow::SetRegionType, Class Members

Example

For an example, refer to LBitmapWindow::GetRgnCurveOptions.


LBitmapWindow::SetRgnFrameType

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetRgnFrameType(uRgnFrameType)

L_UINT uRgnFrameType;

/* frame type */

Sets the frame type used for the class object's region frame.

Parameter | Description
uRgnFrameType | The frame type for the drawn region. Possible values are:
 | Value | Meaning
 | RGNFRAME_STATIC | Static frame.
 | RGNFRAME_ANIMATED | Animated frame.
 | RGNFRAME_NONE | Hide the frame.

Returns

None

Comments

When a region is displayed, an outline of the bitmap region can also be displayed. If the region includes noncontiguous shapes, each shape is outlined. The outline, itself, is inside the region.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetROP3

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetROP3(uROP3)

L_UINT32 uROP3;

/* windows ROP code for display */

Sets the Windows ROP3 code to use when painting.

Parameter | Description
uROP3 | The Windows ROP code that determines how the bitmap is updated. This parameter takes the same codes as the Windows BitBlt function. For ordinary painting, use SRCCOPY.

Returns

None

Comments

The default (for normal painting) is SRCCOPY. You can specify any of the ROP3 codes that the Windows BitBlt function uses.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Using Color Values in LEADTOOLS

Example

L_INT MyFunc(HWND hWndParent)
{
LBitmapWindow LeadBWnd ;

if (LeadBWnd.Load(TEXT("image1.cmp")) == SUCCESS)
{
COLORREF PatternBackColor ;
COLORREF PatternForeColor ;

if (LeadBWnd.CreateWnd( hWndParent, TRUE, 0, 0, 100, 100) == NULL)
return 0;

if (LeadBWnd.GetPatternStyle() != EFX_PATTERN_DOWNWARD_DIAG)
LeadBWnd.SetPatternStyle(EFX_PATTERN_DOWNWARD_DIAG) ;

PatternBackColor = LeadBWnd.GetPatternBackColor() ;
// do process on background color

//...
LeadBWnd.SetPatternBackColor(RGB(255,0,255)) ;
//...

PatternForeColor = LeadBWnd.GetPatternForeColor();
// do process on foreground color

//...
LeadBWnd.SetPatternForeColor(RGB(0,255,0)) ;
//...

if (LeadBWnd.GetROP3() != SRCCOPY)
LeadBWnd.SetROP3(SRCCOPY) ;

if (LeadBWnd.IsPaintSizeUseDPIEnabled() == FALSE)
LeadBWnd.EnablePaintSizeUseDPI(TRUE) ;

if (LeadBWnd.IsDrawGradientEnabled() == FALSE)
LeadBWnd.EnableDrawGradient(TRUE) ;

if (LeadBWnd.IsDrawPatternEnabled() == FALSE)
LeadBWnd.EnableDrawPattern(TRUE) ;

if (LeadBWnd.IsPaintEffectEnabled() == FALSE)
LeadBWnd.EnablePaintEffect(TRUE) ;

if (LeadBWnd.IsPaintTransitionEnabled() == FALSE)
LeadBWnd.EnablePaintTransition(TRUE) ;

LeadBWnd.Repaint();
}
return SUCCESS ;
}


LBitmapWindow::SetToolType

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetToolType(uToolType)

L_UINT uToolType;

/* the tool type */

Sets the tool type for the class object's window.

Parameter | Description
uToolType | The tool type to be used by the bitmap window. Possible values are:
 | Value | Meaning
 | TOOL_USERMODE | user tool type (default).
 | TOOL_PANIMAGE | pan image tool.
 | TOOL_ZOOMRECT | zoom rect tool.
 | TOOL_ZOOM_ON_MOUSECLICK | zoom in/out on mouse click.
 | TOOL_REGION | region tool type, the region shape is specified by LBitmapWindow::SetRegionType() function.
 | TOOL_MAGGLASS | magnifying glass tool.
 | TOOL_ZOOMVIEW | Zoom View tool.

Returns

None

Comments

The bitmap window can automatically perform some functions. These include panning the image, zooming a user-defined rectangle to fit the window, zooming in/out on a mouse click, and creating a bitmap region (floater) based on a user-defined shape.

The default setting for an LBitmapWindow object is TOOL_USERMODE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Using the Zoom View

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetTransition

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetTransition(uTransition)

L_UINT uTransition;

/* transition filling style */

Sets the filling style used when drawing transitions.

Parameter | Description
uTransition | The filling style used during transition. For valid values, refer to Effect Transition Filling Styles.

Returns

None

Comments

The default is EFX_EFFECT_WIPE_RECTANGLE_IN.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetTransitionEffect

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetTransitionEffect(uTransitionEffect)

L_UINT uTransitionEffect;

/* the effect to apply when painting */

Sets the transition effect used when painting transitions.

Parameter | Description
uTransitionEffect | The effect to apply when painting transitions. For valid values, refer to Effect Types.

Returns

None

Comments

The default is EFX_EFFECT_NONE.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetTransitionParameters

#include "ltwrappr.h"

L_INT LBitmapWindow::SetTransitionParameters(pTransDlgParm)

LPTRANSITIONDLGPARAMS pTransDlgParm;

/* pointer to a structure */

Sets the transition painting parameters that will be used when painting transitions.

Parameter | Description
pTransDlgParm | Pointer to a structure of type TRANSITIONDLGPARAMS that contains the transition painting parameters to be set.

Returns

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

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LBitmapWindow::GetBitmapVisibleRect.


LBitmapWindow::SetVertLineStep

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetVertLineStep(nVLineStep)

L_INT nVLineStep;

/* the vertical scrolling line step */

Sets the vertical scrolling line step.

Parameter | Description
nVLineStep | The vertical scrolling line step.

Returns

None

Comments

This is the amount by which the image will be scrolled when the user clicks the scrollbar's scroll-line button.

The default value is 5 pixels.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::SetWndHandle

#include "ltwrappr.h"

L_INT LBitmapWindow::SetWndHandle(hWnd)

HWND hWnd;

/* handle to the bitmap window */

Sets the handle of the window to be used by the bitmap window.

Parameter | Description
hWnd | Handle to the bitmap window.

Returns

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

Comments

The passed window handle will be attached to the bitmap window. If you pass NULL, then the previously attached window will be detached from the bitmap window.

If the bitmap window has a created window using LBitmapWindow::CreateWnd function then this function will return an error code.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd, HWND hWnd)
{
BmpWnd.SetWndHandle(hWnd);
}


LBitmapWindow::SetZoomFactor

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetZoomFactor(fZoomFactor=1.3f)

L_FLOAT fZoomFactor;

/* the zoom factor */

Sets the zoom factor to be used when zooming in or out.

Parameter | Description
fZoomFactor | The zoom factor to be used when zooming in or out.

Returns

None

Comments

The default zoom factor is 1.3.

This zoom factor will be used when the user zooms in/out using the + - keys or when the class object is set to use the TOOL_ZOOM_ON_MOUSECLICK tool.

When setting fZoomFactor, it must be greater than 1.0 for it to have an effect.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::SetZoomMode

#include "ltwrappr.h"

L_INT LBitmapWindow::SetZoomMode(uMode, bDraw=TRUE)

L_UINT uMode; | /* zoom mode */
L_BOOL bDraw; | /* flag that indicates whether to repaint the window */

Sets the zoom mode used for displaying the bitmap in the class object's window.

Parameter | Description
uMode | The zoom mode. Possible values are:
 | Value | Meaning
 | ZOOM_FIT | to fit the bitmap in the window while maintaining the aspect ratio.
 | ZOOM_STRETCH | to stretch the bitmap to the window.
 | ZOOM_NORMAL | to display the bitmap in its normal size.
 | ZOOM_FITWIDTH | to fit the bitmap to the width of the window.
 | ZOOM_FITHEIGHT | to fit the bitmap to the height of the window.
bDraw | Flag that indicates whether to enable or disable repainting the window. Possible values are:
 | Value | Meaning
 | TRUE | Enable repainting of the window.
 | FALSE | Disable repainting of the window.

Returns

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

Comments

When you change the zoom mode, the zoom percent is updated. You can call LBitmapWindow::GetZoomPercent to get the zoom percent currently used to display the image.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBitmapWindow::SetZoomPercent

#include "ltwrappr.h"

L_VOID LBitmapWindow::SetZoomPercent(uPercent)

L_UINT uPercent;

/* the zoom percent */

Sets the current zoom percent for the displayed bitmap. This will zoom the image by the specified zoom percent.

Parameter | Description
uPercent | The percent to zoom in or out on the displayed bitmap.

Returns

None

Comments

The default for this setting is 100 percent.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::SnapWndToImage

#include "ltwrappr.h"

L_VOID LBitmapWindow::SnapWndToImage(bFlag=TRUE)

L_BOOL bFlag;

/* flag that indicates whether to resize the window to the current zoom */

Resizes the bitmap window to the size of the image (using the zoomed size or the normal size).

Parameter | Description
bFlag | Flag that indicates whether to enable or disable repainting the window. Possible values are:
 | Value | Meaning
 | TRUE | Resize the window to the current zoom size of the image.
 | FALSE | Resize the window to the normal size of the image.

Returns

None

Comments

If LBitmapWindow::IsPaintSizeUseDPIEnabled is enabled then the this will be considered.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

L_VOID MyFunc(LBitmapWindow& BmpWnd)
{
BmpWnd.SnapWndToImage(TRUE);
}


LBitmapWindow::StartChanging

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::StartChanging(nChangeType, nChangeCategory)

L_UINT nChangeType; | /* type of change */
L_UINT nChangeCategory; | /* the change category */

This function is called by every function that affects the bitmap.

Parameter | Description
nChangeType | The type of change to be done to the bitmap. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.
nChangeCategory | The change category. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

Returns

SUCCESS | Continue the operation without interrupting it.
< 1 | An error occurred. Refer to Return Codes. This will halt the operation and stop it.

Comments

This function is called by every function that affects the bitmap. You can override this function to have control over the different operations that are done to the bitmap. This function is called before doing any changes to the bitmap. If you want to cancel the operation, you can return an error code that is less than SUCCESS. If you return SUCCESS, the operation will continue executing. For a list of all the change types and notifications refer to Bitmap Change Notifications and Notification Categories.

The high level window classes override this function so it will be notified of any changing done to the bitmap object. This allows these classes to do some special processing before starting the changing operation.

If you override this function you must do one of the following:

1. | To stop an operation, return an error code (anything other than SUCCESS). In this case the operation will stop and the parent class will not have a chance to do any default processing for the operation.
2. | Do your customer processing, and then call the parent-class implementation for this function to let the parent do default processing for this function.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

class MyBitmap: public LBitmapWindow
{
protected:
L_BOOL m_bChanged;
virtual L_INT StartChanging(L_UINT nChangeType,L_UINT nChangeCategory);
virtual L_VOID EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode);
};

L_INT MyBitmap::StartChanging(L_UINT nChangeType,L_UINT nChangeCategory)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
/*the image is to be flipped*/
break;
/*
case ….:
do other things
*/
}

return(LBitmapWindow::StartChanging(nChangeType,nChangeCategory));
}

L_VOID MyBitmap::EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode)
{
switch(nChangeType)
{
case NC_TRANSFORM_FLIP:
if(nRetCode==SUCCESS)
m_bChanged=TRUE;
break;
/*
case ….:
do other things
*/
}

LBitmapWindow::EndChanging(nChangeType,nChangeCategory,nRetCode);
}


LBitmapWindow::StatusCallBack

#include "ltwrappr.h"

virtual L_INT LBitmapWindow::StatusCallBack (nPercentComplete)

L_INT nPercentComplete;

/* completion percentage */

Override this function to 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.

Returns

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

Comments

Derived classes can override this function to update a status bar or interrupt the calling function's operation.

This generalized callback function can be called by many different Class Library functions. If this function returns a failure, the calling function will terminate and return the same error that the callback returned. Override this function in your derived class if you want to have control over the function in process. This function will be called only if the status callback is enabled for the class object.

LBitmapWindow overrides this function to give the user the ability to cancel an operation in progress (such as painting the bitmap while using a paint effect) by pressing the ESC key.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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

Elements:

Class Members

Example

#include <ltwrappr.h>
class LUserBitmap : public LBitmapWindow
{
public:
LUserBitmap();
virtual L_INT StatusCallBack(L_INT nPercentComplete);
virtual ~LUserBitmap();

};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LUserBitmap::LUserBitmap()
{
}

LUserBitmap::~LUserBitmap()
{

}

L_INT LUserBitmap::StatusCallBack(L_INT nPercClientRectentComplete)
{
// display a message when 30% of the status is done.
if(nPercClientRectentComplete == 30)
{
MessageBox(NULL, TEXT("30 Percent of AddNoise function is completed."), TEXT("StatusCallBack"), MB_OK);
}
return SUCCESS;
}

L_INT MyFunc(HWND hWnd)
{
LUserBitmap LeadBitmap;
HDC hDC;
RECT rcClientRect;
L_INT nRet;

// get DC
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);

//Load an image
LeadBitmap.Load(TEXT("V:\\images\\babe.cmp"), 0,ORDER_BGR);
// Check if StatusCallBack is already enabled
nRet = LeadBitmap.IsStatusCallBackEnabled();
if(nRet == FALSE)
// Enable Status CallBack
LeadBitmap.EnableStatusCallBack(TRUE);
// Call add noise function
// during the calling of this function
// StatusCallBack will be called
LeadBitmap.AddNoise();

return SUCCESS;
}


LBitmapWindow::UpdatePanWnd

#include "ltwrappr.h"

L_INT LBitmapWindow::UpdatePanWnd(ulDisplayFlags, crPen, pszTitle)

L_UINT32 ulDisplayFlags; | /* flags that determine how the image is painted in the Pan Window.*/
COLORREF crPen; | /* pen color for drawing the Pan Rect*/
const L_TCHAR pszTitle; | /* title bar string */

Updates the Pan Window with the specified settings.

Parameter | Description
ulDisplayFlags | Flags that determine how the image is painted in the Pan Window. For values, refer to Flags for the LBitmapSettings::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.

Returns

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

Comments

You can call this function if you want to change the settings of the class object's associated Pan Window.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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: | Class Members
Topics: | Using Color Values in LEADTOOLS

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::UpdateZoomView

#include "ltwrappr.h"

L_INT LBitmapWindow::UpdateZoomView(pZoomViewProps)

pZOOMVIEWPROPS pZoomViewProps;

/* pointer to a ZOOMVIEWPROPS structure */

Updates the specified Zoom View with new settings. This function is available in the Document/Medical Toolkits.

Parameter | Description
pZoomViewProps | Pointer to the ZOOMVIEWPROPS structure that contains the updated Zoom View settings.

Returns

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

Comments

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 LBitmapWindow::UpdateZoomView.

To attach a zoomed view to a window, call the LBitmapWindow::AddZoomView function.

When a Zoom View is no longer needed, call the LBitmapWindow::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.

See Also

Functions: | LBitmapWindow::HasZoomView, LBitmapWindow::AddZoomView, LBitmapWindow::GetZoomViewProps, LBitmapWindow::DestroyZoomView, LBitmapWindow::GetZoomViewsCount, Class Members.
Topics: | Using the Zoom View
 | Raster Image Functions: Displaying Images

Example

void CDemoView::OnUpdateZoomView()
{
L_UINT uCount,i;
ZOOMVIEWPROPS ZoomViewProps;
memset(&ZoomViewProps,0,sizeof(ZOOMVIEWPROPS));

if(m_LAniWnd.HasZoomView ())
{
uCount = m_LAniWnd.GetZoomViewsCount ();

for(i=0; i < uCount;++i)
{
ZoomViewProps.uIndex = i;
m_LAniWnd.GetZoomViewProps(&ZoomViewProps, sizeof(ZoomViewProps));
ZoomViewProps.bCallouts = FALSE;
m_LAniWnd.UpdateZoomView(&ZoomViewProps);
}
}
}


LBitmapWindow::ZoomIn

#include "ltwrappr.h"

L_VOID LBitmapWindow::ZoomIn(void)

Zooms in on the displayed bitmap.

Returns

None

Comments

This will zoom by the amount specified in LBitmapWindow::SetZoomFactor.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::ZoomOut

#include "ltwrappr.h"

L_VOID LBitmapWindow::ZoomOut(void)

Zooms out on the displayed bitmap.

Returns

None

Comments

This will zoom out by the amount specified in LBitmapWindow::SetZoomFactor.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::CreatePanWnd.


LBitmapWindow::ZoomToRect

#include "ltwrappr.h"

L_INT LBitmapWindow::ZoomToRect(ZoomRect)

RECT& ZoomRect;

/* rectangle that contains values relative to the client area */

Zooms the specified rectangle to the client area of the class object's window.

Parameter | Description
ZoomRect | Rectangle in the current client area to be zoomed to fit the client area of the window.

Returns

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

Comments

The ZoomRect parameter is passed by reference and is a required parameter.

Required DLLs and Libraries

LTDIS
LTDLG
LTEFX
LTFIL
LTIMG
LTISI
LTSCR
LTTWN

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:

Class Members

Example

For an example, refer to LBitmapWindow::Repaint.


LBuffer::LBuffer

#include "ltwrappr.h"

L_VOID LBuffer::LBuffer(L_VOID)

L_VOID LBuffer::LBuffer(dwSize)

L_VOID LBuffer::LBuffer(lpStr)

L_VOID LBuffer::LBuffer(lpData, dwSize)

L_VOID LBuffer::LBuffer(LBufferSrc)

DWORD dwSize; | /* number of bytes with which to initialize the buffer */
L_CHAR L_FAR * lpStr; | /* character string */
L_VOID L_HUGE * lpData; | /* pointer to a data buffer */
LBuffer& LBufferSrc; | /* an LBuffer object*/

Constructs the object and initializes the member variables.

Parameter | Description
dwSize | Number of bytes with which to initialize the buffer.
lpStr | Character string to be copied to the buffer.
lpData | Pointer to data buffer to be copied.
LBufferSrc | A LEAD LBuffer object to copy.

Returns

None

Comments

LBuffer::LBuffer() is a constructor for the LBuffer class.

LBuffer::LBuffer(dwSize) will initialize the member variables and allocate the specified size of memory.

LBuffer::LBuffer(lpStr) will copy the specified string to the class object's buffer.

LBuffer::LBuffer(lpData, dwSize) will copy the specified buffer to the class object's buffer. This results in two copies of the buffer.

LBuffer::LBuffer(LBufferSrc) will copy the specified class object's buffer. This results in two copies of the buffer.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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:

LBuffer::~LBuffer, Class Members

Example

This is an example for LBuffer::LBuffer():

L_VOID TestConstructor()
{
// this will call the default constructor and destructor when it is out of scope
LBuffer LeadBuffer ;

//...
}

This is an example for LBuffer::LBuffer(dwSize):

L_VOID TestConstructor (LBitmapBase& LeadBitmap)
{
L_INT nBytesPerLine ;

nBytesPerLine = LeadBitmap.GetBytesPerLine() ;

LBuffer LeadBuffer ((DWORD)nBytesPerLine) ;

//...
}

This is an example for LBuffer::LBuffer(lpStr):

L_VOID TestConstructor()
{
LBuffer LeadBuffer(TEXT("ABCD String")) ;

//...
}

This is an example for LBuffer::LBuffer(lpData, dwSize):

L_VOID TestConstructor(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer ;
L_INT nBytesPerLine ;

L_CHAR L_FAR * pBuff ;

nBytesPerLine = LeadBitmap.GetBytesPerLine() ;
LeadBitmap.GetRow(&LeadBuffer,5) ;

pBuff = (L_CHAR L_FAR *)LeadBuffer.Lock() ;

LBuffer LeadConstrBuffer(pBuff,(DWORD)nBytesPerLine) ;

LeadBuffer.Unlock() ;

//...
}

This is an example for LBuffer::LBuffer(LBufferSrc):

L_VOID TestConstructor(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer ;
LeadBitmap.GetRow(&LeadBuffer,5) ;

LBuffer LeadConstrBuffer(LeadBuffer) ;

//...
}


LBuffer::~LBuffer

#include "ltwrappr.h"

virtual L_VOID LBuffer::~LBuffer(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LBuffer class.

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:

Class Members

Example

For an example, refer to LBuffer::LBuffer().


LBuffer::CompressRow

#include "ltwrappr.h"

virtual L_INT LBuffer::CompressRow(LBufferSrc, nCol, nWidth)

LBuffer& LBufferSrc; | /* the input LBuffer object */
L_INT nCol; | /* column offset within the row */
L_INT nWidth; | /* number of pixels to process */

Performs 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 Document/Medical toolkits only.

Parameter | Description
LBufferSrc | 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.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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: | Class Members
Topics: | Speeding Up 1-Bit Documents

Example

L_VOID TestCompressRow(LBitmapBase L_FAR * pLeadBitmap)
{
LBuffer LeadBuffer, TmpBuffer ;
L_INT nXOffset; // Column offset of the rectangle to process
L_INT nXSize; // Pixel width of the rectangle to process
L_INT nYOffset; // Row offset of the rectangle to process
L_INT nYSize; // Pixel height of the rectangle to process
L_INT i,n; // indexs
L_CHAR L_FAR * pBuffer ;

// Specify a rectangle in the middle right part of the displayed image
nXOffset = pLeadBitmap->GetWidth() / 3;
nXSize = pLeadBitmap->GetWidth() * 2 / 3;
nYOffset = pLeadBitmap->GetHeight() / 3;
nYSize = pLeadBitmap->GetHeight() / 3;

pLeadBitmap->Access() ;

for (i = nYOffset; i<(nYOffset + nYSize);i++)
{
pLeadBitmap->GetRowColCompressed( &LeadBuffer, i,nXOffset, nXSize, NULL);

TmpBuffer.ExpandRow( LeadBuffer, 0, nXSize/2) ;

pBuffer = (L_CHAR L_FAR *)TmpBuffer.Lock();

for(n=0; n < (nXSize /16); n++)
pBuffer[n] = pBuffer[n] ^ 0xFF;

TmpBuffer.Unlock();

LeadBuffer.CompressRow( TmpBuffer, 0, nXSize/2) ;

pLeadBitmap->PutRowColCompressed( LeadBuffer, i, nXOffset, nXSize/2, NULL);
}
pLeadBitmap->Release() ;

TmpBuffer.Free();
LeadBuffer.Free();
}


LBuffer::CompressRows

LBuffer::CompressRows (Document/Medical only)

#include "ltwrappr.h"

virtual L_INT LBuffer::CompressRows(LBufferSrc, nWidth, nRows)

LBuffer& LBufferSrc; | /* input LBuffer object */
L_UINT nWidth; | /* number of pixels in each row */
L_UINT nRows; | /* number of rows to process */

Performs 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 Document/Medical toolkits only.

Parameter | Description
LBufferSrc | 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.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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: | Class Members
Topics: | Speeding Up 1-Bit Documents

Example

L_VOID TestCompressRows(LBitmapBase L_FAR * pLeadBitmap)
{
LBuffer LeadBuffer, TmpBuffer ;
L_INT nLines = 50 ;
L_INT nRow = 0 ;
L_CHAR L_FAR * pBuffer;

pLeadBitmap->Access() ;

// Get the top nRow lines
pLeadBitmap->GetRowCompressed( &LeadBuffer, nRow, nLines, NULL) ;

// Expand the compressed data
TmpBuffer.ExpandRows(LeadBuffer, pLeadBitmap->GetWidth(), nLines) ;

pBuffer = (L_CHAR L_FAR *)TmpBuffer.Lock() ;
// Invert the data
for(L_INT n=0; n < pLeadBitmap->GetBytesPerLine() * nLines; n++)
pBuffer[n] = pBuffer[n] ^ 0xFF;

TmpBuffer.Unlock() ;

// Compress the inverted data
LeadBuffer.CompressRows( TmpBuffer, pLeadBitmap->GetWidth(), nLines);

// Put the inverted, compressed data back into the bitmap
pLeadBitmap->PutRowCompressed( LeadBuffer, nRow, nLines);

pLeadBitmap->Release() ;

TmpBuffer.Free();
LeadBuffer.Free() ;
}


LBuffer::ConvertBuffer

#include "ltwrappr.h"

virtual L_INT LBuffer::ConvertBuffer(nWidth, nBitsPerPixelSrc, nBitsPerPixelDst, nOrderSrc, nOrderDst, pPaletteSrc, pPaletteDst, uFlags=0, uLowBit=0, uHighBit=0)

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 class object's 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
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 toolkits.
 | 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] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical toolkits.
 | 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.
 | 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 toolkits. 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

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: | Class Members
Topics: | Raster Image Functions: Doing Color Expansion or Reduction
 | Raster Image Functions: Doing Color Space Conversions

Example

L_VOID TestConvertBuffer(LBitmapBase L_FAR * pLeadBitmap)
{
LBuffer LeadBuffer ;
LBitmapBase TmpBitmap ;

TmpBitmap.Load(TEXT("image2.cmp")) ;

pLeadBitmap->Access();
for (L_INT i = 0; i< TmpBitmap.GetHeight(); i++)
{
pLeadBitmap->GetRow(&LeadBuffer,i) ;

LeadBuffer.ConvertBuffer(pLeadBitmap->GetWidth(),TmpBitmap.GetBitsPerPixel(),
pLeadBitmap->GetBitsPerPixel(),TmpBitmap.GetColorOrder(),
pLeadBitmap->GetColorOrder(), NULL, NULL, CVT_DSTGRAY, 0, 15) ;

pLeadBitmap->PutRow(LeadBuffer,i) ;
}
pLeadBitmap->Release();

LeadBuffer.Free() ;
}


LBuffer::ConvertColorSpace

#include "ltwrappr.h"

virtual L_INT LBuffer::ConvertColorSpace(LBufferSrc, nWidth, nFormatSrc, nFormatDst)

LBuffer& LBufferSrc; | /* LBuffer object that holds the input data */
L_INT nWidth; | /* the 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 class object's buffer from one color space model to another. The supported models are RGB, YUV, CMYK, CMY, YIQ, HSV, and HLS.

Parameter | Description
LBufferSrc | The LBuffer object holding the input data.
nWidth | The number of pixels to be processed.
nFormatSrc | Format of the source data. There are two possible groups of values. The first group of values is:
 | 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 second group of values is:
 | 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 possible groups of values. The first group of values is:
 | 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 second group of values is:
 | 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). 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, but this function's buffer parameters expect unsigned characters. Therefore, when allocating space for data, you should allocate a buffer of integers; then cast the buffer pointer to the appropriate data type when using it as a parameter.

YUV or YIQ data must be always allocated in an integer (short) buffer. Therefore, when allocating space for YUV or YIQ data, you should allocate a buffer of integers; then cast the buffer pointer to the appropriate data type when using it as a parameter.

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.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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.

See Also

Functions: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, Class Members
Topics: | Processing an Image
 | Color Halftones and Halftone Images
 | Raster Image Functions: Working with Color Halftones, Halftones, and Grayscale Images
 | Raster Image Functions: Processing an Image

Example

L_VOID TestConvertColorSpace()
{
LBitmapBase LeadBitmap ;
LBuffer LeadBuffer, TmpBuffer ;

LeadBitmap.Load(TEXT("image1.cmp")) ;

LeadBitmap.GetRow(&LeadBuffer,0);

TmpBuffer.ConvertColorSpace(LeadBuffer,LeadBitmap.GetWidth(), CCS_RGB, CCS_CMYK);

LeadBuffer = TmpBuffer ;

TmpBuffer.Free() ;
LeadBuffer.Free() ;
}


LBuffer::Copy

#include "ltwrappr.h"

L_INT LBuffer::Copy(lpStr)

L_INT LBuffer::Copy(lpData, dwSize)

L_INT LBuffer::Copy(pLBufferSrc)

L_CHAR L_FAR * lpStr; | /* character string */
L_VOID L_HUGE * lpData; | /* pointer to a data buffer */
DWORD dwSize; | /* size of the buffer in bytes */
LBuffer L_FAR * pLBufferSrc; | /* pointer to a LEAD buffer object to copy */

Copies the passed item to the LBuffer object.

Parameter | Description
lpStr | Character string to be copied to the buffer.
lpData | Pointer to the data buffer to be copied.
dwSize | Size of the buffer in bytes
pLBufferSrc | Pointer to a LEAD buffer object to copy

Returns

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

Comments

LBuffer::Copy(lpStr) copies a string to the class object’s buffer.

LBuffer::Copy(lpData, dwSize) copies the specified buffer to the class object's buffer. This results in two copies of the buffer.

LBuffer::Copy(pLBufferSrc) copies the specified class object's buffer. This results in two copies of the buffer.

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:

Class Members

Example

For an example of LBuffer::Copy(lpStr), refer to LBuffer::Fill.

This is an example for LBuffer::Copy(lpData, dwSize):

L_VOID TestCopyData(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer;
LBuffer MyBuffer ;

LeadBitmap.GetRow(&LeadBuffer,6);

MyBuffer.Copy((L_CHAR L_FAR *)LeadBuffer.Lock(),LeadBuffer.GetSize());

LeadBuffer.Unlock();
}

This is an example for LBuffer::Copy(pLBufferSrc):

L_VOID TestCopyBuffer(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer;
LBuffer MyBuffer ;

LeadBitmap.GetRow(&LeadBuffer,6);

MyBuffer.Copy(&LeadBuffer);
}


LBuffer::ExpandRow

#include "ltwrappr.h"

virtual L_INT LBuffer::ExpandRow(LBufferSrc, nCol, nWidth)

LBuffer& LBufferSrc; | /* the input LBuffer object */
L_UINT nCol; | /* column offset within the row */
L_INT nWidth; | /* number of pixels to process */

Performs 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 Document/Medical toolkits only.

Parameter | Description
LBufferSrc | The input buffer containing 1-bit compressed image data.
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.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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: | Class Members
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to LBuffer::CompressRow.


LBuffer::ExpandRows

#include "ltwrappr.h"

virtual L_INT LBuffer::ExpandRows(LBufferSrc, nWidth, nRows)

LBuffer& LBufferSrc; | /* input LBuffer object */
L_UINT nWidth; | /* number of pixels in each row */
L_UINT nRows; | /* number of rows to process */

Performs 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 Document/Medical toolkits only.

Parameter | Description
LBufferSrc | The input buffer containing 1-bit compressed image data.
nWidth | Number of pixels in each row
nRows | 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.

The parameter LBufferSrc is passed by reference, and is a required parameter.

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: | Class Members
Topics: | Speeding Up 1-Bit Documents

Example

For an example, refer to LBuffer::CompressRows.


LBuffer::Fill

#include "ltwrappr.h"

L_INT LBuffer::Fill(cValue=0)

L_UCHAR cValue;

/* character to use to fill the buffer */

Fills the class object’s buffer with the specified value.

Parameter | Description
cValue | Character to use to fill the buffer.

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.

See Also

Functions:

Class Members

Example

L_VOID TestFunction(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer ;
LBuffer LeadCopyBuffer ;

LeadBitmap.GetRow(&LeadBuffer,5) ;

LeadCopyBuffer.Copy(TEXT("ABCD String")) ;

LeadBuffer.Fill() ;
//...

LeadBuffer.Free() ;

//...

LeadCopyBuffer.Free() ;
}


LBuffer::Free

#include "ltwrappr.h"

L_INT LBuffer::Free(L_VOID)

Frees the class object's allocated buffer.

Returns

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

Comments

If you do not call this function, any allocated memory will be freed when the class object is destroyed.

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:

Class Members

Example

For an example, refer to LBuffer::Fill.


LBuffer::GetHandle

#include "ltwrappr.h"

L_INT LBuffer::GetHandle()

Gets an HGLOBAL memory handle to a copy of the allocated global buffer handle of the class object.

Returns

>0 | Global memory handle to a copy of the object’s internal buffer.
0 | An error occurred.

Comments

The returned handle is a handle to a copy of the object’s internal buffer, and you are responsible for freeing this 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.

See Also

Functions:

Class Members

Example

L_VOID TestHandle()
{
LBuffer LeadBuffer(1024) ;
HGLOBAL hGlobal=LeadBuffer.GetHandle() ;

GlobalFree(hGlobal);
}


LBuffer::GetSize

#include "ltwrappr.h"

DWORD LBuffer::GetSize(L_VOID)

Retrieves the size of the class object's buffer.

Returns

The size of the allocated LEAD buffer.

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:

Class Members

Example

L_VOID TestFunction (LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer ;
L_INT nBytesPerLine ;

nBytesPerLine = LeadBitmap.GetBytesPerLine();

if (LeadBuffer.GetSize() < (DWORD)nBytesPerLine)
LeadBuffer.Reallocate((DWORD)nBytesPerLine) ;

//...
}


LBuffer::IsValid

#include "ltwrappr.h"

L_BOOL LBuffer::IsValid(L_VOID)

Determines whether the LBuffer object is valid.

Returns

TRUE | The buffer is allocated and the class object has a valid memory handle.
FALSE | Otherwise.

Comments

If the class object does not have a valid memory handle associated with it, the object is considered invalid.

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:

Class Members

Example

L_VOID TestValidation()
{
LBuffer LeadBuffer ;

if (LeadBuffer.IsValid() == TRUE)
MessageBox(NULL,TEXT("LBuffer is valid ..."),TEXT("Validation"),MB_OK) ;
}


LBuffer::Lock

#include "ltwrappr.h"

L_VOID L_HUGE * LBuffer::Lock(L_VOID)

Gets a pointer to the class object's internal buffer.

Returns

Pointer to the internal allocated global buffer. NULL if there is no data in the buffer.

Comments

You can use this to change the contents of the buffer.

You should cast this pointer to the appropriate data type.

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:

Class Members

Example

For an example, refer to LBuffer::Copy .


LBuffer::Reallocate

#include "ltwrappr.h"

L_INT LBuffer::Reallocate(dwSize)

DWORD dwSize;

/* the new size for the LEAD buffer to allocate */

Changes the size of the class object's buffer.

Parameter | Description
dwSize | The new size for the LEAD buffer to allocate.

Returns

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

Comments

If the class object does not have an allocated buffer when this function is called, one will be allocated the size of dwSize.

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:

Class Members

Example

For an example, refer to LBuffer::GetSize.


LBuffer::Resize

#include "ltwrappr.h"

virtual L_INT LBuffer::Resize(nRow, nBitsPerPixel, pXSize, pYSize)

L_INT nRow; | /* current row */
L_INT nBitsPerPixel; | /* bits per pixel */
L_INT L_FAR * pXSize; | /* address of a variable to be updated with the width */
L_INT L_FAR * pYSize; | /* address of a variable to be updated with the number of copy repetitions */

Resizes image data in the class object's buffer to the new size specified with the LBuffer::StartResize function.

Parameter | Description
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 resized line.
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 ....

Returns

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

Comments

Before calling this function, you must do the following:

1. | Call the LBuffer::StartResize function.
2. | 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 LBuffer::StopResize.

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: | Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For an example, refer to LBuffer::StartResize.


LBuffer::SetHandle

#include "ltwrappr.h"

L_INT LBuffer::SetHandle(pMemHandle, dwSize=0)

HGLOBAL L_FAR * pMemHandle; | /* pointer to a global memory handle */
DWORD dwSize; | /* size of the global handle */

Initializes the class object with an allocated global buffer handle.

Parameter | Description
pMemHandle | Pointer to a global memory handle.
dwSize | The size of the global memory handle. Pass 0 to let the function get the size.

Returns

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

Comments

You can use this function to have the class object manipulate a buffer that you have previously allocated. This memory will be automatically freed when the class object is destroyed.

If the object already has an allocated buffer associated with it, that buffer is freed before the new handle is set.

The passed memory handle will be invalidated after this operation.

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:

Class Members

Example

L_VOID TestHandle()
{
LBuffer LeadBuffer ;
HGLOBAL hGlobal ;

hGlobal = GlobalAlloc(GMEM_MOVEABLE,1024) ;

LeadBuffer.SetHandle (&hGlobal);

//...

}


LBuffer::StartResize

#include "ltwrappr.h"

virtual L_INT LBuffer::StartResize(nOldWidth, nOldHeight, nNewWidth, nNewHeight)

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 */

Sets up information for the LBuffer::Resize function.

Parameter | Description
nOldWidth | The original width of the image.
nOldHeight | The original height of the image.
nNewWidth | The new width for the image.
nNewHeight | The new height for the image.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

L_VOID TestResize()
{
LBitmapBase LeadBitmap, TmpBitmap ;
LBuffer LeadBuffer;
L_INT nNewHeight;
L_INT nOldHeight;
L_INT nNewWidth;
L_INT nOldWidth;
L_INT i,n,nDestRow ;
L_INT CopyWidth, CopyHeight;

TmpBitmap.Load (TEXT("image1.cmp")) ;

nOldHeight = TmpBitmap.GetHeight () ;
nOldWidth = TmpBitmap.GetWidth ();
nNewHeight = nOldHeight * 2;
nNewWidth = nOldWidth * 2;

L_INT nBufferSize = max( TmpBitmap.GetBytesPerLine (), nNewWidth* 3);
LeadBuffer.Reallocate (nBufferSize);

LeadBitmap.Create (nNewWidth, nNewHeight,24, TmpBitmap.GetColorOrder (), NULL, TYPE_CONV) ;

// Initialize the resize process

LeadBuffer.StartResize(nOldWidth,nOldHeight,nNewWidth,nNewHeight);

// Initialize the destination row number
nDestRow = 0;

// Use Resize to process each row in the bitmap
LeadBitmap.Access ();
TmpBitmap.Access ();

for(i=0; i < TmpBitmap.GetHeight (); i++)
{

TmpBitmap.GetRow (&LeadBuffer, i);

LeadBuffer.Resize (i, TmpBitmap.GetBitsPerPixel (), &CopyWidth, &CopyHeight);

// Output as many or as few rows as Resize supplies
for(n=0; n < CopyHeight; n++)
{
LeadBitmap.PutRow (LeadBuffer, nDestRow);
nDestRow++;
}
}

LeadBitmap.Release ();
TmpBitmap.Release();

// End the resize process
LeadBuffer.StopResize ();
}


LBuffer::StopResize

#include "ltwrappr.h"

virtual L_INT LBuffer::StopResize(L_VOID)

Cleans up all data variables and buffers allocated by LBuffer::StartResize and resets all internal variables to their default settings.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations

Example

For an example, refer to LBuffer::StartResize.


LBuffer::Unlock

#include "ltwrappr.h"

L_VOID LBuffer::Unlock(L_VOID)

Unlocks the class object's buffer.

Returns

None

Comments

You should call this function whenever the class object's buffer is not used, so that Windows can manage its memory properly.

Call this once for each call to LBuffer::Lock.

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:

Class Members

Example

For an example, refer to LBuffer::Copy.


LChange::LChange

#include "ltwrappr.h"

LChange::LChange(void)

Constructs the LChange object.

Returns

None

Comments

This is the constructor for the LChange class.

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:

LChange::~LChange, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LChange LeadChange;

//…
}


LChange::~LChange

#include "ltwrappr.h"

virtual LChange::~LChange(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LChange class.

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:

LChange::LChange, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LChange LeadChange;

//…
}


LChange::ChangeFromDDB

#include "ltwrappr.h"

static L_INT LChange::ChangeFromDDB(hDC, pLBitmap, hBitmap, hPalette)

HDC hDC; | /* handle to the device responsible for the conversion */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pLBitmap */
LBitmapBase L_FAR * pLBitmap; | /* address of the LEAD bitmap object */
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. The new LEAD bitmap is stored in the specified LBitmapBase object's internal LEAD bitmap handle. 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.
uStructSize | Size in bytes, of the structure pointed to by pLBitmap. Use sizeof(BITMAPHANDLE).
pLBitmap | Address of the LEAD bitmap object.
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.
< 1 | An error occurred. Refer to Return Codes.

Comments

After calling this function, the class object's internal LEAD bitmap handle will point to the previous DDB data.

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: | LBitmapBase::ConvertFromDDB, LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertToDIB,, LChange::ChangeToDDB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction(HINSTANCE hAppInstance)
{
LBitmapBase MyBitmap;
HBITMAP hBitmap;
HDC hDC;

hBitmap=LoadBitmap(hAppInstance,TEXT("ResourceBitmap"));

if(hBitmap)
{
hDC=GetDC(NULL);
LChange::ChangeFromDDB(hDC,&MyBitmap, sizeof(BITMAPHANDLE),hBitmap,NULL);
if(MyBitmap.IsAllocated())
{
LBase::DisplayError(NULL,TEXT("Successful converting DDB Bitmap to LEAD Bitmap"));

hBitmap=LChange::ChangeToDDB (hDC,&MyBitmap);
if(hBitmap)
LBase::DisplayError(NULL,TEXT("Successful converting from LEAD Bitmap to DDB Bitmap"));
}
else
LBase::DisplayErrorFromList(NULL);

ReleaseDC(NULL,hDC);
}
else
LBase::DisplayError(NULL,TEXT("Cannot Load Bitmap from resource"));
}


LChange::ChangeFromDIB

#include "ltwrappr.h"

static L_INT LChange::ChangeFromDIB(pLBitmap, uStructSize, hDIB)

LBitmapBase L_FAR * pLBitmap; | /* address of the LEAD bitmap object */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pLBitmap */
HGLOBAL hDIB; | /* DIB handle to be changed */

Changes a Windows device independent bitmap (DIB) to a LEAD bitmap. The new LEAD bitmap is stored in the specified LBitmapBase object's internal LEAD bitmap handle. This function results in only one copy of the bitmap, and it invalidates the DIB handle.

Parameter | Description
pLBitmap | Address of the LEAD bitmap object.
uStructSize | Size in bytes, of the structure pointed to by pLBitmap. 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

After calling this function, the class object's internal LEAD bitmap handle will point to the previous DIB data.

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

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: | LBitmapBase::ConvertFromDDB, LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertToDIB, LChange::ChangeToDIB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to LChange::ChangeToDIB.


LChange::ChangeFromEMF

#include "ltwrappr.h"

static L_INT LChange::ChangeFromEMF(pLBitmap, uStructSize, hWmf, uWidth, uHeight)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object*/
L_UINT uStructSize | /* size in bytes, of the structure pointed to by pLBitmap */
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
pLBitmap | Pointer to the bitmap object to be updated with the changed file.
uStructSize | Size in bytes, of the structure pointed to by pLBitmap. 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.

See Also

Functions: | Class Members, LChange::ChangeToEMF, LChange::ChangeFromWMF, LChange::ChangeToWMF, LBitmapBase::ConvertFromEMF, LBitmapBase::ConvertFromWMF, LBitmapBase::ConvertToWMF, LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

/* This example loads a bitmap, converts it to a EMF, then converts
the EMF back to a bitmap
*/

void ChangeEMFToLead(LBitmap * pLeadBitmap)
{
LBitmap Bitmap; /* Bitmap handle for the initial image */
HENHMETAFILE hEMF;

/* Load a bitmap, keeping its own bits per pixel */
Bitmap.Load(TEXT("image3.cmp"), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a EMF */
hEMF = LChange::ChangeToEMF( &Bitmap );

/* Convert the EMF to create a new LEAD bitmap and preserve the size */
LChange::ChangeFromEMF(pLeadBitmap, sizeof(BITMAPHANDLE), hEMF, 0, 0);
}


LChange::ChangeFromWMF

#include "ltwrappr.h"

static L_INT LChange::ChangeFromWMF(pLBitmap, uStructSize, hWmf, uWidth, uHeight)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
L_UINT uStructSize | /* size in bytes, of the structure pointed to by pLBitmap */
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
pLBitmap | Pointer to the bitmap object to be updated with the changed file.
uStructSize | Size in bytes, of the structure pointed to by pLBitmap. 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.

See Also

Functions: | Class Members, LChange::ChangeToEMF, LChange::ChangeFromEMF, LChange::ChangeToWMF, LBitmapBase::ConvertFromEMF, LBitmapBase::ConvertFromWMF, LBitmapBase::ConvertToWMF, LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

/* This example loads a bitmap, converts it to a WMF, then converts
the WMF back to a bitmap
*/

void MyTestFunction(LBitmap LeadBitmap)
{

HMETAFILE hWmf;
LBitmap lTmpbitmap;

/* Load a bitmap, keeping its own bits per pixel */
lTmpbitmap.Load(TEXT("image3.cmp"), 0, ORDER_BGR, NULL, NULL);

/* Convert the initial bitmap to a WMF */
hWmf = LChange::ChangeToWMF( &lTmpbitmap );

/* Convert the WMF to create a new LEAD bitmap and preserve the size */
LChange::ChangeFromWMF(&LeadBitmap, sizeof(BITMAPHANDLE), hWmf, 0, 0);
}


LChange::ChangeToDDB

#include "ltwrappr.h"

static HBITMAP LChange::ChangeToDDB(hDC, pLBitmap)

HDC hDC; | /* handle to the device responsible for the conversion */
LBitmapBase L_FAR * pLBitmap; | /* pointer to the bitmap object */

Changes an LBitmapBase object's internal 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.
pLBitmap | Pointer to the bitmap object referencing the bitmap to change.

Returns

>0 | HBITMAP.
0 | An error occurred.

Comments

When you no longer need the DDB, you can free it using the Windows DeleteObject() 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.

See Also

Functions: | LBitmapBase::ConvertFromDDB, LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertToDIB, LChange::ChangeToDDB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

For an example, refer to LChange::ChangeFromDDB.


LChange::ChangeToDIB

#include "ltwrappr.h"

static HGLOBAL LChange::ChangeToDIB(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to a LEAD bitmap object */

Changes an LBitmapBase object's internal 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.

Parameter | Description
pLBitmap | Pointer to a LEAD bitmap object referencing the bitmap to change.

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.

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

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: | LBitmapBase::ConvertFromDDB, LBitmapBase::ConvertFromDIB, LBitmapBase::ConvertToDDB, LBitmapBase::ConvertToDIB, LChange::ChangeFromDIB, Class Members
Topics: | Raster Image Functions: Creation, Deletion, and Copying
 | Using DIBs, DDBs, and the Clipboard

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap;
HGLOBAL hDib;

MyBitmap.Load(TEXT("image1.cmp"));
if(MyBitmap.IsAllocated())
{
hDib=LChange::ChangeToDIB(&MyBitmap);
if(hDib!=0)
{
LBase::DisplayError(NULL,TEXT("Successful converting LEAD Bitmap to DIB Bitmap"));
if(LChange::ChangeFromDIB(&MyBitmap, sizeof(BITMAPHANDLE), hDib)==SUCCESS)
LBase::DisplayError(NULL,TEXT("Successful converting from DIB Bitmap to LEAD bitmap"));
}
else
LBase::DisplayErrorFromList(NULL);
}
else
LBase::DisplayError(NULL,TEXT("Cannot Load Bitmap"));

//…

}


LChange::ChangeToEMF

#include "ltwrappr.h"

static HENHMETAFILE LChange::ChangeToEMF(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to a bitmap base object*/

Changes a LEAD Technologies bitmap into a Windows enhanced metafile (EMF) and, if successful, frees the bitmap.

Parameter | Description
pLBitmap | 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.

See Also

Functions: | Class Members , LChange::ChangeFromEMF , LChange::ChangeFromWMF , LChange::ChangeToWMF , LBitmapBase::ConvertFromEMF , LBitmapBase::ConvertFromWMF , LBitmapBase::ConvertToWMF , LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

For an example, refer to LChange::ChangeFromEMF .


LChange::ChangeToWMF

#include "ltwrappr.h"

static HMETAFILE LChange::ChangeToWMF(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to a bitmap base object */

Changes a LEAD Technologies bitmap into a Windows metafile (WMF) and, if successful, frees the bitmap.

Parameter | Description
pLBitmap | Pointer to the bitmap object class 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.

See Also

Functions: | Class Members , LChange::ChangeFromEMF , LChange::ChangeFromWMF , LChange::ChangeToEMF , LBitmapBase::ConvertFromEMF , LBitmapBase::ConvertFromWMF , LBitmapBase::ConvertToWMF , LBitmapBase::ConvertToEMF
Topics: | Raster Image Functions: Input and Output Loading and Saving Images

Example

For an example, refer to LChange::ChangeFromWMF.


LDoubleBuffer::LDoubleBuffer

#include "ltwrappr.h"

L_VOID LDoubleBuffer::LDoubleBuffer(L_VOID)

Constructs and initializes the different member variables of the LDoubleBuffer object.

Returns

None

Comments

This is the constructor for the LDoubleBuffer class.

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:

LDoubleBuffer::~LDoubleBuffer, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LDoubleBuffer LeadDoubleBuffer;

//...
}


LDoubleBuffer::~LDoubleBuffer

#include "ltwrappr.h"

L_VOID LDoubleBuffer::~LDoubleBuffer(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LDoubleBuffer class.

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:

LDoubleBuffer::LDoubleBuffer, Class Members

Example

For an example, refer to LDoubleBuffer::LDoubleBuffer.


LDoubleBuffer::Begin

#include "ltwrappr.h"

virtual HDC LDoubleBuffer::Begin(hDC, cx, cy)

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
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 LDoubleBuffer::Begin to begin a double buffering process. All double buffered paint operations should be wrapped in LDoubleBuffer::Begin and LDoubleBuffer::End 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 LDoubleBuffer::Begin 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 LDoubleBuffer::End.

Note that you must create a double buffer handle with LDoubleBuffer::CreateHandle 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

For an example, refer to LDoubleBuffer::End.


LDoubleBuffer::CreateHandle

#include "ltwrappr.h"

virtual L_INT LDoubleBuffer::CreateHandle(L_VOID)

Creates the handle that is used throughout the double buffering. This function is available in the Document/Medical Toolkits.

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. Call LDoubleBuffer::CreateHandle. If successful, your object will contain a double buffering handle that will be used throughout the double buffering process. When you are finished with the object, you must call LDoubleBuffer::DestroyHandle.

You may decide to call this function only one time for your 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.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

For an example, refer to LDoubleBuffer::End.


LDoubleBuffer::DestroyHandle

#include "ltwrappr.h"

virtual L_INT LDoubleBuffer::DestroyHandle(L_VOID)

Frees the double buffer handle resources. This function is available in the Document/Medical Toolkits.

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 LDoubleBuffer::CreateHandle.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

For an example refer to LDoubleBuffer::End.


LDoubleBuffer::EnableDoubleBuffer

#include "ltwrappr.h"

virtual L_BOOL LDoubleBuffer::EnableDoubleBuffer(bEnable)

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
bEnable | Value that specifies whether to enable double buffering. Possible values are:
 | Value | Meaning
 | TRUE | Enable double buffering.
 | FALSE | Disable double buffering.

Returns

The previous setting.

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 LDoubleBuffer::Begin.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

For an example, refer to LDoubleBuffer::End.


LDoubleBuffer::End

#include "ltwrappr.h"

virtual L_INT LDoubleBuffer::End(hDC)

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
hDC | Handle to the original target device context

Returns

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

Comments

Use LDoubleBuffer::End when ready to paint all that has been double-buffered to the target hDC. All double buffered paint operations should be wrapped in LDoubleBuffer::Begin and LDoubleBuffer::End 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 LDoubleBuffer::Begin.

Note that you must create a double buffer handle with LDoubleBuffer::CreateHandle 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

// 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;
LBitmap Bitmap;
LDoubleBuffer LDoubleBufferObj;
L_INT cx, cy;
HDC hDC, hMemDC;
RECT rcClient;
RECT rcBitmap;
RECT rcBall;
L_INT dx, dy;
L_INT i;
L_INT nRet;

nRet = Bitmap.Load(pszFile, 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));
LDoubleBufferObj.CreateHandle();

LDoubleBufferObj.EnableDoubleBuffer(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 = Bitmap.GetHeight();
rcBitmap.bottom = Bitmap.GetWidth();

SetRect(&rcBall, 0, 0, 75, 75);
dx = dy = 1;
for (i=0; i<2000; i++)
{
// Double buffer painting the image and the moving ball
hMemDC = LDoubleBufferObj.Begin(hDC, cx, cy);
FillRect(hMemDC, &rcClient, hBrush);
Bitmap.SetDstRect(&rcBitmap);
LPaint MyPaint(&Bitmap, hMemDC);
MyPaint.PaintDC();
Ellipse(hMemDC, rcBall.left, rcBall.top, rcBall.right, rcBall.bottom);
LDoubleBufferObj.End(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
Bitmap.Free();
LDoubleBufferObj.DestroyHandle();
DeleteObject(hBrush);
}


LDoubleBuffer::IsDoubleBufferEnabled

#include "ltwrappr.h"

static L_BOOL LDoubleBuffer::IsDoubleBufferEnabled(L_VOID)

Indicates whether double buffering is enabled or not. This function is available in the Document/Medical Toolkits.

Returns

TRUE | Double buffering is enabled.
FALSE | Double buffering is disabled.

Comments

Call this function to determine whether double buffering is enabled.

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: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Minimizing Flicker with Double Buffering

Example

LDoubleBuffer MyDoubleBuffer;

if(MyDoubleBuffer.IsDoubleBufferEnabled()==FALSE)
MyDoubleBuffer.EnableDoubleBuffer(TRUE);


LDraw::LDraw

#include "ltwrappr.h"

L_VOID LDraw::LDraw(L_VOID)

Constructs and initializes the different member variables of the LDraw object.

Returns

None

Comments

This is the constructor for the LDraw class.

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:

LDraw::~LDraw, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LDraw LeadDraw;

//...
}


LDraw::~LDraw

#include "ltwrappr.h"

L_VOID LDraw::~LDraw(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LDraw class.

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:

LDraw::LDraw, Class Members

Example

For an example, refer to LDraw::LDraw.


LDraw::GetDC

#include "ltwrappr.h"

HDC LDraw::GetDC(L_VOID)

Retrieves the device context that is used by the painting and drawing functions.

Returns

The handle of the windows device context that is used by the painting functions.

Comments

This is the same device context handle that was set using the LDraw::SetDC 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.

See Also

Functions: | LDraw::SetDC, Class Members
Topics: | Processing an Image

Example

For an example, refer to LDraw::SetBitmap.


LDraw::IsValid

#include "ltwrappr.h"

L_BOOL LDraw::IsValid(L_VOID)

Determine whether the class object is valid for painting bitmaps.

Returns

TRUE | The LDraw object is valid.
FALSE | The LDraw object is not valid.

Comments

Before you can use any of the painting functions, a bitmap and a device context must be associated with the class object. Until you have associated a bitmap and a device context with the LDraw object, the object is considered invalid.

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:

Class Members

Example

For an example, refer to LDraw::SetBitmap.


LDraw::SetBitmap

#include "ltwrappr.h"

L_VOID LDraw::SetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to an LBitmapBase object */

Sets the bitmap object that will be used by the painting and drawing functions. The painting functions will paint the class object's associated bitmap into the device context specified by the LDraw::SetDC.

Parameter | Description
pBitmap | Pointer to a LEAD bitmap object of type LBitmapBase, this is the bitmap object to be used by the painting functions.

Returns

None

Comments

Before you can use any of the bitmap painting functions, a bitmap and a device context must be associated with the class object. Until you have associated a bitmap with the LDraw object, the object is considered invalid.

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:

Class Members

Example

L_VOID MyFunction(LBitmapBase& LeadBitmap,HWND hWnd)
{
LDraw LeadDraw ;

if (LeadDraw.IsValid() == FALSE)
LeadDraw.SetBitmap(&LeadBitmap) ;

if (LeadDraw.GetDC() == NULL)
{
HDC hDC = GetDC(hWnd);
LeadDraw.SetDC(hDC) ;

//...

LeadDraw.SetDC(0) ;
ReleaseDC(hWnd,hDC) ;
}
}


LDraw::SetDC

#include "ltwrappr.h"

HDC LDraw::SetDC(hDC)

HDC hDC;

/* handle of a device context */

Sets the device context that will be used by the painting functions.

Parameter | Description
hDC | Handle of a Windows device context to be used for painting functions. The mapping mode of the device context must be MM_TEXT.

Returns

The handle of the previous DC.

Comments

The painting and drawing functions will send output to this device context. The device context must be set before using any painting or drawing functions.

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: | LDraw::GetDC, Class Members
Topics: | Processing an Image

Example

For an example, refer to LDraw::SetBitmap.


LFile::LFile

#include "ltwrappr.h"

L_VOID LFile::LFile(L_VOID)

L_VOID LFile::LFile(pLBitmap)

L_VOID LFile::LFile(pLBitmap, pFileName)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a LEAD bitmap object */
L_TCHAR L_FAR * pFileName; | /* file name */

Constructs and initializes the member variables of the class object.

Parameter | Description
pLBitmap | Pointer to a LEAD bitmap object, used to initialize the LFile object.
pFileName | Character string that contains the name of the file.

Returns

None

Comments

LFile::LFile() is a constructor for the LFile class.

LFile::LFile(pLBitmap) also sets the bitmap for the class object.

LFile::LFile(pLBitmap, pFileName) also sets the bitmap for the class object and the filename to associate with the object.

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.

See Also

Functions:

LFile::~LFile, Class Members

Example

This is an example for LFile::LFile():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LFile LeadFile;

//…
}

This is an example for LFile::LFile(pLBitmap):

L_VOID MyFunction()
{
LBitmapBase LeadBitmap ;
LeadBitmap.Load (TEXT("Image1.cmp"), 24, ORDER_RGB) ;

LFile LeadFile (&LeadBitmap) ;

//…
//…
}

This is an example for LFile::LFile(pLBitmap, pFileName):

L_INT TestFunction(L_TCHAR L_FAR * pFileName)
{
LBitmapBase LeadBitmap ;
LeadBitmap.Load (TEXT("Image1.cmp"), 24, ORDER_RGB) ;

LFile LeadFile (&LeadBitmap, pFileName) ;

// do process here …
// ….

return SUCCESS ;
}


LFile::~LFile

#include "ltwrappr.h"

virtual L_VOID LFile::~LFile(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LFile class.

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.

See Also

Functions:

Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LFile LeadFile;

//…
//…
}


LFile::BrowseDir

#include "ltwrappr.h"

virtual L_INT LFile::BrowseDir(pszPath, pszFilter, pThumbOptions, bStopOnError=FALSE, bIncludeSubDirs=FALSE, bExpandMultipage=FALSE, lSizeDisk=0, lSizeMem=0)

L_TCHAR L_FAR * pszPath; | /* directory to browse */
L_TCHAR L_FAR * pszFilter; | /* file filter, ex *.jpg */
THUMBOPTIONS L_FAR *pThumbOptions; | /* pointer to 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 multipage files */
L_INT32 lSizeDisk; | /* maximum size of file to load */
L_INT32 lSizeMem; | /* maximum size of image to load */

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 multipage files. If True, each page from a multipage file will be loaded. Possible values are:
 | Value | Meaning
 | TRUE | Expand multipage files, loading each page from a multipage file.
 | FALSE | Do not expand multipage 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.

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 LFile::BrowseDirCallBack function.

If –1 is specified for either the nThumbHeight or nThumbWidth, the image will not be loaded at all. The LFile::BrowseDirCallBack function will be called for each file, but will only receive file information, not a valid image.

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: | LFile::LoadBitmap, LFile::GetCompressStamp, LFileSettings::SetExtFileOption, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFile::BrowseDirCallBack
Topics: | Thumbnail Browser

Example

// define user LFile class to override CallBack
class LMyBrowse : public LFile
{
public:
HDC m_hDC;

public:
LMyBrowse();
virtual ~LMyBrowse();

virtual L_INT BrowseDirCallBack( LBitmapBase L_FAR* pLBitmap,
L_TCHAR L_FAR* pszFilename,
pFILEINFO pFileInfo,
L_INT nStatus,
L_INT nPercent
);
};

LMyBrowse::LMyBrowse()
{
m_hDC = NULL;
}

LMyBrowse::~LMyBrowse()
{
}

L_INT LMyBrowse::BrowseDirCallBack(LBitmapBase L_FAR* pLBitmap,
L_TCHAR L_FAR* pszFilename,
pFILEINFO pFileInfo,
L_INT nStatus, L_INT nPercent)
{
// we have a thumbnail, do something with it
if(nStatus == SUCCESS)
{
pLBitmap->Paint()->SetDC(m_hDC);
pLBitmap->Paint()->PaintDC();
}
else if(nStatus == BROWSE_LOADING)
{
// imaging being loaded
;
}
return SUCCESS ;
}

// Test Function
L_VOID TestFunction(HDC hDC)
{
L_INT nRet;
LBase::LoadLibraries(LT_ALL_LEADLIB);
LMyBrowse myBrowse;
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 */

myBrowse.m_hDC = hDC;
nRet = myBrowse.BrowseDir(TEXT("o:\\images\\new"), // path
TEXT("*.*"), // all files
&Opt,
FALSE, // do not stop on errors
FALSE, // do not include sub-dirs
FALSE, // do not expand multipage files
0, // no limit to file sizes
4000*1024); // limit image in memory to 4MB
}


LFile::BrowseDirCallBack

#include "ltwrappr.h"

virtual L_INT LFile::BrowseDirCallBack(pLBitmap, pszFilename, pInfo, nStatusCode, nPercent, pUserData)

LBitmapBase L_FAR *pLBitmap; | /* pointer to an LBitmapBase object */
L_TCHAR L_FAR * pszFilename; | /* pointer to the filename */
pFILEINFO pFileInfo; | /* pointer to the file info structure */
L_INT nStatus; | /* status code */
L_INT nPercent; | /* percentage completion of a file load */

Handles the thumbnails generated by calling the LFile::BrowseDir function.

Parameter | Description
pBitmap | The pointer to the LBitmapBase object that references the thumbnail generated by LFile::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.
pFileInfo | Pointer to a FILEINFO structure containing information about pszFilename.
nStatus | Status code. If an error occurred during thumbnail generation, this will be < SUCCESS. Possible values are:
 | Value | Meaning
 | 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 LFile::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 nErrorCode is equal to BROWSE_LOADING.

Returns

> 0 | The function was successful, and returns the handle to the ImageList Control window.
< 0 | 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 LFile::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: | LFile::BrowseDir, LFile::LoadBitmap, LFile::GetCompressStamp, LFileSettings::SetExtFileOption, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution
Topics: | Thumbnail Browser

Example

For an example, refer to LFile::BrowseDir.


LFile::Compact

#include "ltwrappr.h"

L_INT LFile::Compact(pszDstFile, uPages, pLoadFileOption, pSaveFileOption)

L_TCHAR L_FAR * pszDstFile; | /* name of the output file */
L_UINT uPages; | /* number of pages to copy */
pLOADFILEOPTION pLoadFileOption; | /* pointer to the LOADFILEOPTION structure */
pSAVEFILEOPTION pSaveFileOption; | /* 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
pszDstFile | Character string that contains 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 | 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.

See Also

Functions: | LFile::SaveFile, LFile::SaveOffset, LBitmapBase::Save, LBitmapBase::Load, LFile::LoadFile, LFile::GetInfo, LBaseFile::GetDefaultLoadFileOption, LBaseFile::GetDefaultSaveFileOption
Topics: | Loading and Saving Large TIFF Files
 | Raster Image Functions: Loading Files
 | Raster Image Functions: Saving Files

Example 1

void Compactfiletiffexample1()
{
/* This example will compact all the pages in a TIFF
 file. */
/* It will create a new file called dstfile.tif */

   LFile lf;
L_INT nRet = 0 ;

lf.SetFileName(TEXT("C:\\Faces_24.tif"))
 ;

nRet = lf.Compact(TEXT("C:\\dstfile.tif"),
 0, NULL, NULL);

if(nRet != SUCCESS)
MessageBox(TEXT("Error compacting file!"),
 TEXT("ERROR"), MB_OK);
}

Example 2

void Compactfiletiff()
{
/* This example will compact all the pages in a TIFF
 file.*/
/* It will append all the pages to an existing file called
 dstfile.tif */
LFile lf;
SAVEFILEOPTION SaveFileOption;
L_INT nRet = 0 ;

lf.SetFileName(TEXT("C:\\Faces_24.tif"))
 ;

lf.GetDefaultSaveFileOption(&SaveFileOption,
 sizeof(SaveFileOption));
SaveFileOption.PageNumber = 2;

nRet = lf.Compact(TEXT("C:\\dstfile.tif"),
 0, NULL, &SaveFileOption);
if(nRet != SUCCESS)
MessageBox(TEXT("Error compacting file!"),
 TEXT("ERROR"), MB_OK);
}


LFile::CreateThumbnail

#include "ltwrappr.h"

virtual L_INT LFile::CreateThumbnail(pThumbOptions, pLoadOptions, pFileInfo)

const pTHUMBOPTIONS pThumbOptions; | /* pointer to a structure */
pLOADFILEOPTION pLoadOptions | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Creates a thumbnail from the specified image file.

Parameter | Description
pThumbOptions | Pointer to a structure containing thumbnail generation options. Pass NULL to get the default options.
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 LFile::GetInfo.
 | 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 LFile::GetInfo.has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo..
 | If LFile::GetInfo.has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo., 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 LFile::GetInfo.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 LFile::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 LBitmapBase::Free.

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
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: | LFile::LoadFile, LFile::BrowseDir, Class Members
Topics: | Raster Image Functions: Saving Files,
 | Raster Image Functions: Loading and Saving Stamp Images,
 | Loading and Saving Images

Example

class MyFileClass : public LFile
{
public:
L_INT CreateThumbnailCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
);
};
L_INT MyFileClass::CreateThumbnailCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
)
{
// Write Your Code here.
return SUCCESS;
}

void MyTestFun()
{
LBitmap LeadBitmap;
L_INT nRet;
THUMBOPTIONS opt;
LeadBitmap.Load (TEXT("c:\\lead.cmp"));
//Create a thumbnail with default options, and no callback
nRet = LeadBitmap.File()->CreateThumbnail(NULL, NULL, NULL );
if(nRet == SUCCESS)
LeadBitmap.Free ();

//Create a thumbnail with some options, and no callback
MyFileClass *Tmp = new MyFileClass();
Tmp->SetFileName(TEXT("c:\\lead.cmp"));

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);
Tmp->EnableCallBack(TRUE);
nRet = Tmp->CreateThumbnail(&opt, NULL, NULL);
}


LFile::CreateThumbnailCallBack

#include "ltwrappr.h"

virtual L_INT LFile::CreateThumbnailCallBack (pFileInfo, pBitmap, pBuffer, uFlags, nRow, nLines)

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 */

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. Possible values are:
 | Value | 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.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to 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 LFile::CreateThumbnailCallBack function does not contain the total number of pages. To get the total number of pages, you should call LFile::GetInfo and set the FILEINFO_TOTALPAGES flag.

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.

See Also

Functions: | LFile::LoadFile, LFile::BrowseDir, Class Members
Topics: | Raster Image Functions: Saving Files,
 | Raster Image Functions: Loading and Saving Stamp Images,
 | Loading and Saving Images

Example

For an example, refer to LFile::CreateThumbnail.


LFile::DeletePage

#include "ltwrappr.h"

virtual L_INT LFile::DeletePage(nPage, uFlags=0, pSaveFileOption=NULL)

L_INT nPage; | /* page number */
L_UINT uFlags; | /* flags */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Deletes the specified page from a multi-page file, if the format supports delete operations.

Parameter | Description
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.
pSaveFileOption | 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

Before you can call this function, you must set the filename for the class object.

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.

See Also

Functions:

Class Members

Example

L_VOID TestFunction()
{
LFile LeadFile ;

LeadFile.SetFileName(TEXT("test.tif")) ;

LeadFile.DeletePage(2,0, NULL) ;
}


LFile::DeleteTag

#include "ltwrappr.h"

L_INT LFile::DeleteTag(nPage, uTag, uFlags, pSaveOptions)

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
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 LFile::EnumTagsCallBack callback function. If you want to delete tags that you enumerate, use LFile::EnumTagsCallBack to add the tags to a list. Upon returning from LFile::EnumTags, 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.

See Also

Functions: | LFile::ReadTag, LFile::WriteTag, LFileSettings::SetTag, LFileSettings::GetTag, LFile::EnumTags
Topics: | Implementing TIFF Comments and Tags
 | Raster Image Functions: Maintaining File Comments and Tags

Example

void DeletetagExample()
{
/*The following example will delete the tag 0x8001 from
 page 1 of a TIFF file*/
LFile lf ;
LOADFILEOPTION LoadFileOption;
L_INT nRet = 0;

lf.SetFileName(TEXT("C:\\Faces_24.tif"));

lf.GetDefaultLoadFileOption(&LoadFileOption,
 sizeof(LoadFileOption));
LoadFileOption.PageNumber = 1;

nRet = lf.ReadTag(0x8001, NULL,
 NULL, NULL, &LoadFileOption) ;
if (nRet >= SUCCESS)
{
nRet = lf.DeleteTag(1,
 0x8001, 0, NULL);
}
}


LFile::EnumGeoKeys

#include "ltwrappr.h"

virtual L_INT LFile::EnumGeoKeys(uFlags, pLoadOptions)

L_UINT uFlags; | /* reserved for future use. */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Enumerates all the GeoKeys in a GeoTIFF file.

Parameter | Description
uFlags | Flags parameter reserved for future use. Pass 0.
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 LFile::EnumTags. Or you can call LFile::ReadTag for each of these tags (since there are not that many of them to warrant the use of LFile::EnumTags).

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.

See Also

Functions: | LFile::SetGeoKey, LFile::GetGeoKey, LFile::WriteGeoKey, LFile::WriteMetaData, LFile::EnumGeoKeys, LFile::SaveFile, LFile::SaveBitmap, LFile::EnumGeoKeysCallBack
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

/* Displays a GeoKey in a message
 box*/
static L_VOID DisplayKey(L_UINT16 uTag,L_UINT16 uType,L_UINT32 uCount,L_VOID
 L_FAR*pData)
{
L_TCHAR s[500];
wsprintf(s, TEXT("Key = %d, Type = %s, Count = %d"),
 uTag,
uType == TAG_ASCII ? TEXT("ASCII") : (uType == TAG_SHORT ? TEXT("SHORT")
 : TEXT("DOUBLE")),uCount);
MessageBox(NULL, s, TEXT("Key Info"), MB_OK);
/* 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*/
if(uType == TAG_ASCII)
MessageBox(NULL, (LPSTR)pData, TEXT("Key
 Value"), MB_OK);
else
{
if(uType == TAG_SHORT)
{
if(uCount == 1)
wsprintf(s,
 TEXT("%d"), *(L_UINT16 L_FAR*)pData);
else
wsprintf(s,
 TEXT("{%d, ...}"), *(L_UINT16 L_FAR*)pData);
}
else
{
if(uCount == 1)
sprintf(s,
 TEXT("%g"), *(L_DOUBLE L_FAR*)pData);
else
sprintf(s,
 TEXT("{%g, ...}"), *(L_DOUBLE L_FAR*)pData);
}
MessageBox(NULL, s, TEXT("Key
 Value"), MB_OK);
}
}
class LFileChild : public LFile
{
L_INT EnumGeoKeysCallBack(L_UINT16 uTag,L_UINT16 uType,L_UINT32
 uCount,
L_VOID L_FAR*pData);
};

L_INT LFileChild::EnumGeoKeysCallBack(L_UINT16 uTag,L_UINT16 uType,L_UINT32
 uCount,
L_VOID L_FAR*pData)
{
DisplayKey(uTag,uType,uCount,pData) ;
return SUCCESS ;
}

L_VOID EnumGeoKeysExample(LFileChild& file)
{
file.SetFileName(TEXT("C:\\GeoTIFF.tif"));
file.EnableCallBack(TRUE)
 ;
L_INT nRet = file.EnumGeoKeys(
 0, NULL);
if(nRet != SUCCESS)
MessageBox(NULL, TEXT("Error enumerating
 GeoKeys"), TEXT("ERROR"), MB_OK);
else
MessageBox(NULL, TEXT("Enumeration
 SUCCEEDED!"), TEXT("SUCCESS"), MB_OK);
}


LFile::EnumGeoKeysCallBack

#include "ltwrappr.h"

virtual L_INT LFile::EnumGeoKeysCallBack(uTag, uType, uCount, pData)

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 */

This function is called for each GeoKey enumerated by the LFile::EnumGeoKeys 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.

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: | LFile::EnumGeoKeys, LFile::ReadGeoKey
Topics: | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

For an example, refer to LFile::EnumGeoKeys function.


LFile::EnumTags

#include "ltwrappr.h"

L_INT LFile::EnumTags(uFlags, pLoadOptions)

L_UINT uFlags; | /* reserved for future use. Pass 0. */
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
uFlags | Flags parameter. Reserved for future use. Pass 0.
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 LFile::ReadTag.

Note that if LFile::EnumTagsCallBack returns a value other than SUCCESS, LFile::EnumTags will stop enumerating the tags and return the value returned by LFile::EnumTagsCallBack as its return value.

Do not attempt to use the LFile::DeleteTag function to delete tags from inside an LFile::EnumTagsCallback callback function. If you want to delete tags that you enumerate, use LFile::EnumTagsCallback to add the tags to a list. Upon returning from LFile::EnumTags, you can delete all the tags from the list.

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.

See Also

Functions: | LFile::ReadTag, LFile::WriteTag, LFileSettings::SetTag, LFileSettings::GetTag, LFile::EnumTagsCallBack, LFile::DeleteTag, LFile::ReadComment, LFile::ReadCommentOffset, LFile::WriteComment, LFileSettings::GetComment, LFileSettings::SetComment, LMemoryFile::ReadComment, LMemoryFile::ReadTag
Topics: | Implementing TIFF Comments and Tags
 | Raster Image Functions: Maintaining File Comments and Tags

Example

L_INT LFileChild::EnumTagsCallBack(L_UINT16 uTag, L_UINT16
 uType, L_UINT32 uCount)
{
L_TCHAR
 s[100];
wsprintf(s,
 TEXT("Tag = %d, Type = %d, Count = %d"), uTag, uType, uCount);
MessageBox(NULL,
 s, TEXT("EnumFileTagCallback"), MB_OK);
return
 SUCCESS;
}

void EnumfiletagsExample()
{
/*
 This example will read all the user tags from page 1 of " C:\\file.tif".
 */
LFileChild
 lfc ;
lfc.EnableCallBack(TRUE)
 ;
lfc.SetFileName(TEXT("C:\\file.tif"))
 ;
/*
 Enumerate the tags */
L_INT
 nRet = lfc.EnumTags(0, NULL);
}


LFile::EnumTagsCallBack

#include "ltwrappr.h"

L_INT LFile::EnumTagsCallBack(uTag, uType, uCount)

L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16 uType; | /* tag data type */
L_UINT32 uCount; | /* number of values */

The LFile::EnumTags function will call 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 LFileSettings::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.

Returns

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

Comments

The LFile::EnumTags function calls this callback for each tag in the page. For more information, refer to LFile::EnumTags.

Do not attempt to use the LFile::DeleteTag function to delete tags from inside an LFile::EnumTagsCallback callback function. If you want to delete tags that you enumerate, use LFile::EnumTagsCallback to add the tags to a list. Upon returning from LFile::EnumTags, you can delete all the tags from the list.

See Also

Functions: | LFile::EnumTags, LFile::ReadTag, LFile::DeleteTag, LFile::ReadComment, LFile::ReadCommentOffset, LFile::WriteComment, LFile::WriteTag, LFileSettings::GetTag, LFileSettings::SetTag, LFileSettings::GetComment, LFileSettings::SetComment, LMemoryFile::ReadComment, LMemoryFile::ReadTag
Topics: | Implementing TIFF Comments and Tags
 | Raster Image Functions: Maintaining File Comments and Tags

Example

For an example, refer to LFile::EnumTags.


LFile::FeedLoad

#include "ltwrappr.h"

virtual L_INT LFile::FeedLoad(pLBuffer)

LBuffer L_FAR * pLBuffer;

/* pointer to a LEAD buffer object*/

Supplies image data to the file-load process from a buffer that you provide.

Parameter | Description
pLBuffer | Pointer to an LBuffer object that contains the image data to load.

Returns

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

Comments

This function supports the LFile::FeedLoadCallBack virtual function.

Use this function with the LFile::StartFeedLoad and LFile::StopFeedLoad functions. For a description of how the functions relate to each other, refer to LFile::StartFeedLoad.

This function cannot be used in combination with the Redirect input / output functions.

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.

See Also

Functions: | LBitmapBase::GetLoadStatus, Class Members
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 an example, refer to LFile::StartFeedLoad.


LFile::FeedLoadCallBack

#include "ltwrappr.h"

virtual L_INT LFile::FeedLoadCallBack(pFileInfo, pLBitmap, pLBuffer, uFlags, nRow, nLines)

pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure */
LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uFlags; | /* flags for the first and last row, and the 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 */

Handles the output image data that LFile::FeedLoad has written to a buffer.

Parameter | Description
pFileInfo | Pointer to the FILEINFO structure that contains image information.
pLBitmap | Pointer to the bitmap object referencing the bitmap that contains the image information.
pLBuffer | Pointer to a buffer object 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 pLBuffer buffer object.

Returns

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

Comments

Override this function to handle the output image data that LFile::FeedLoad has written to a buffer.

The FILEINFO structure that gets passed to this function does not contain the total number of pages. To get the total number of pages, you should call LFile::GetInfo and set the FILEINFO_TOTALPAGES flag.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::StartFeedLoad.


LFile::FileConvert

#include "ltwrappr.h"

static L_INT LFile::FileConvert(pszFileDst, pszFileSrc, nType, nWidth, nHeight, nBitsPerPixel, nQFactor, pLoadFileOption=NULL, pSaveFileOption=NULL)

L_TCHAR L_FAR * pszFileDst; | /* output file name */
L_TCHAR L_FAR * pszFileSrc; | /* input file name */
L_INT nType; | /* output file format */
L_INT nWidth; | /* width of the new output file */
L_INT nHeight; | /* height of the new output file */
L_INT nBitsPerPixel; | /* output file pixel depth */
L_INT nQFactor; | /* quality factor */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Converts an image file from one format to another, creating a new file in the new format.

Parameter | Description
pszFileDst | Character string containing the output file name.
pszFileSrc | Character string containing the input 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.
pLoadFileOption | Pointer to optional extended load options. Pass NULL to use the default load options.
pSaveFileOption | 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 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 LBase::EnableStatusCallBack.

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.

See Also

Functions: | Class Members
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 an example, refer to LFile::LoadBitmap.


LFile::FreeExtensions

#include "ltwrappr.h"

virtual L_INT LFile::FreeExtensions(pExtensionList)

pEXTENSIONLIST pExtensionList;

/* pointer to a structure */

Frees the extension list data allocated by the LFile::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
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.

See Also

Functions: | LFile::LoadExtensionStamp, LFile::GetExtensionAudio, LFile::ReadFileExtensions, Class Members
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

For an example, refer to LFile::ReadFileExtensions.


LFile::FreeICCProfile

#include "ltwrappr.h"

L_INT LFile::FreeICCProfile(pICCProfile)

pMEMICCPROFILE pICCProfile;

/* pointer to a structure */

Frees the memory allocated by LFile::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 LFile::InitICCProfile is no longer needed, the memory must be freed by calling LFile::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.

See Also

Functions: | LFile::LoadICCProfile, LFile::InitICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

LFile MyFile;
MEMICCPROFILE ICCProfile;

// initialize the MEMICCPROFILE structure
if (MyFile.InitICCProfile(&ICCProfile,
 sizeof(MEMICCPROFILE)) == SUCCESS)
MessageBox(TEXT("InitICCProfile SUCCESS"));

// load the embedded ICC profile
if(MyFile.LoadICCProfile(TEXT("embeddedICC.jpg"),
 &ICCProfile, NULL) == SUCCESS)
{
MessageBox(TEXT("LoadICCProfile SUCCESS"));
if(MyFile.FreeICCProfile(&ICCProfile)
 == SUCCESS)
MessageBox(TEXT("FreeICCProfile
 SUCCESS"));
}


LFile::FreeICCProfileExt

#include "ltwrappr.h"
#include "ltclr.h"

L_INT LFile::FreeICCProfileExt(pICCProfile)

pICCPROFILEEXT pICCProfile;

/* pointer to a structure */

Frees the memory allocated by LFile::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 LFile::InitICCProfileExt is no longer needed, the memory must be freed by calling LFile::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.

See Also

Functions: | LFile::FreeICCProfile, LFile::InitICCProfile, LFile::LoadICCProfile, LFile::InitICCProfileExt, LFile::SaveICCProfile, LFile::LoadICCProfileExt, Class Members
Topics: | Using ICC Profile Functions
 | Raster Image Functions: ICC Profile Functions

Example

For an example, refer to LFile::InitICCProfileExt.


LFile::GetCommentSize

#include "ltwrappr.h"

virtual L_INT LFile::GetCommentSize(uType, puSize, pLoadFileOption=NULL)

L_UINT uType; | /* type of comment */
L_UINT L_FAR * puSize; | /* pointer to a variable to be updated */
pLOADFIlEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Gets the size, in bytes, of the requested comments.

Parameter | Description
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 LFile::ReadComment. For more information concerning FlashPix file comments,see FlashPix File Comments.
puSize | Pointer to a variable to be updated with the size of the comments requested, in bytes.
pLoadFileOption | 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 LFileSettings::SetComment. LFileSettings::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 LFile::SaveFile or LFile::SaveBitmap when creating a new file. If you wish to change a comment in an existing file, use LFile::WriteComment.

The basic order of function calls for reading comments is as follows:

Get the size of the comments with LFile::GetCommentSize

Allocate a buffer of a corresponding size.

Read the comments with LFile::ReadComment

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Maintaining File Comments
 | Loading and Saving Images

Example

For an example, refer to LFile::ReadCommentExt.


LFile::GetCompressStamp

This function has been removed. You can get the same functionality using LFile::ReadStamp.


LFile::GetExtensionAudio

#include "ltwrappr.h"

virtual L_INT LFile::GetExtensionAudio(pExtensionList, nIndex, ppBuffer, puSize)

pEXTENSIONLIST pExtensionList; | /* pointer to a structure */
L_INT nIndex; | /* audio stream index */
L_CHAR * * ppBuffer; | /* pointer to a pointer */
L_UINT *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 LFile::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.

See Also

Functions: | LFile::ReadFileExtensions, LFile::LoadExtensionStamp, LFile::FreeExtensions, Class Members
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

#include <stdio.h>

L_VOID TestFunction(L_TCHAR * pszFile, L_TCHAR * pszAudioFile)
{
LFile File;
pEXTENSIONLIST pExtensionList;

File.SetFileName(pszFile);
if (File.ReadFileExtensions(&pExtensionList) != SUCCESS)
{
MessageBox(NULL, TEXT("Error getting extensions!"), TEXT("Testing"), MB_OK);
return;
}

if (pExtensionList->uFlags & EXTENSION_AUDIO)
{
L_CHAR * pData;
L_UINT uSize;

if (File.GetExtensionAudio (pExtensionList, 0, &pData, &uSize)
!= SUCCESS)
MessageBox(NULL, TEXT("Error getting the audio data!"),
TEXT("Testing"), MB_OK);
else
{
FILE * fd;

#ifdef UNICODE

fd = _wfopen(pszAudioFile, TEXT("wb")); // pszAudioFile: .wav file
#else

fd = fopen(pszAudioFile, "wb"); // pszAudioFile: .wav file
#endif
if (fd)
{
fwrite(pData, uSize, 1, fd);
fclose(fd);
}
}
}

File.FreeExtensions(pExtensionList);
}


LFile::GetFileName

#include "ltwrappr.h"

L_TCHAR L_FAR * LFile::GetFileName(L_VOID)

L_INT LFile::GetFileName(pBuffer, puBuffSize)

L_TCHAR L_FAR * pBuffer; | /* character string to be updated */
L_UINT L_FAR * puBuffSize; | /* size of pBuffer */

LFile::GetFileName() gets a pointer to the internal file name.

LFile::GetFileName(pBuffer, puBuffSize) gets a copy of the internal file name.

Parameter | Description
pBuffer | Character string that will be updated with the internal file name.
uBuffSize | Pointer to a variable to be updated with the size of pBuffer.

Returns

LFile::GetFileName returns a pointer to the internal file name. You should not attempt to free this pointer.

LFile::GetFileName(pBuffer, uBuffSize) returns the following:

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.

See Also

Functions:

Class Members

Example

L_VOID TestFunction (HWND hWnd)
{
LFile LeadFile ;
LBitmapBase LeadBitmap ;
L_INT nRet = 0;
L_TCHAR *szOldFileName;
L_TCHAR *szNewFileName;

LeadFile.SetBitmap(&LeadBitmap) ;
LeadFile.SetFileName(TEXT("image1.cmp")) ;

MessageBox(0,LeadFile.GetFileName() ,TEXT("file to load"),MB_OK);

LeadFile.LoadFile (24, ORDER_RGB, LOADFILE_ALLOCATE | LOADFILE_STORE) ;

LeadFile.SetFileName (TEXT("TESTSTMP.CMP"));

// Save a CMP file
nRet = LeadFile.SaveBitmap(FILE_CMP);

if (nRet == SUCCESS)
{
L_TCHAR szBuffer[256] ;
L_UINT puFileNameLen ;

MessageBox (hWnd, TEXT("Function complete - Look at TESTSTMP.CMP"), TEXT("Notice"), MB_OK);
LeadFile.GetFileName(szNewFileName,&puFileNameLen) ;
wsprintf(szBuffer,TEXT("Old File Name = %s\nBitmap compressed with stamp to\nNew File Name = %s\n"),
szOldFileName,szNewFileName) ;
MessageBox(hWnd,szBuffer,TEXT("Information"),MB_OK);
}

LeadBitmap.Free() ;

}


LFile::GetGeoKey

#include "ltwrappr.h"

virtual L_INT LFile::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 LFile::ReadGeoKey function.

It is often convenient to call this function twice, as follows:

1. | Call the function the first time, passing NULL to 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.

See Also

Functions: | LFile::SetGeoKey, LFile::WriteGeoKey, LFile::ReadGeoKey, LFile::EnumGeoKeys, LFile::SaveFile, LFile::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
 GetGeoKey twice
//and get the required size in the first call
L_VOID GetGeokeyExample(LFile& file)
{
L_UINT16 L_FAR*pData = NULL;
L_UINT uCount;
L_UINT uType;
L_INT nSize;

nSize = file.GetGeoKey(1024,
 &uType, &uCount, NULL);
if(nSize <= 0)
MessageBox(NULL, TEXT("The GeoKey
 was not set, or an error occurred!"), TEXT("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 = file.GetGeoKey(1024,
 &uType, &uCount, pData);
if(nSize <= 0)
MessageBox(NULL,
 TEXT("Error getting the GeoKey!"), TEXT("FAILURE"),
 MB_OK);
else
{
// do whatever you want with the GeoKey data
MessageBox(NULL,
 TEXT("works Fine!"), TEXT("SUCCESS"), MB_OK);
}
free(pData); ////
 free the pData buffer
}
}
}


LFile::GetInfo

#include "ltwrappr.h"

virtual L_INT LFile::GetInfo(pFileInfo, uStructSize, uFlags=FILEINFO_TOTALPAGES, pLoadFileOption=NULL)

pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure to be filled */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pFileInfo */
L_UINT uFlags; | /* flag that indicates whether to update the TotalPages field in the FILEINFO structure */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Gets information about the specified file and fills the specified FILEINFO structure with the information.

Parameter | Description
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. Use sizeof(FILEINFO).
uFlags | Flag that indicates 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.
pLoadFileOption | 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 multipage 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 LFile::GetInfo 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 on 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.

See Also

Functions: | LFile::Compact, Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LFile::ReadLoadResolutions.


LFile::GetPCDResolution

#include "ltwrappr.h"

virtual L_INT LFile::GetPCDResolution(pPCDInfo)

pPCDINFO pPCDInfo;

/* pointer to a LEAD PCDINFO structure */

Examines a PhotoCD file to determine which resolutions it contains.

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

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

L_VOID MyFunction()
{
LFile LeadFile;
PCDINFO PCDInfo;

LeadFile.SetFileName(TEXT("Img0024.pcd")) ;

LeadFile.GetPCDResolution(&PCDInfo);
}


LFile::GetProperQualityFactor

#include "ltwrappr.h"

static L_INT LFile::GetProperQualityFactor(nFileFormat)

L_INT nFileFormat;

/* file format */

Retrieves a suitable quality factor for the passed format. For more information, see Compression Quality Factors.

Parameter | Description
nFileFormat | One of LEAD file format constants.

Returns

The quality value that is suitable for the file format.

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.

See Also

Functions:

Class Members

Example

L_VOID MyFunction()
{
L_TCHAR szMessage[256] ;
LFile LeadFile ;
L_INT nQualityFactor = LeadFile.GetProperQualityFactor(FILE_LEAD) ;

wsprintf(szMessage,TEXT("Quality Factor = %d\n"),nQualityFactor);
MessageBox(NULL,szMessage,TEXT("Quality Factor"),MB_OK);
}


LFile::InitICCProfile

#include "ltwrappr.h"

L_INT LFile::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 LFile::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 LFile::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.

See Also

Functions: | LFile::LoadICCProfile, LFile::FreeICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to LFile::FreeICCProfile.


LFile::InitICCProfileExt

#include "ltwrappr.h"
#include "ltclr.h"

L_INT LFile::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 LFile::InitICCProfileExt with the uStructSize parameter set to sizeof().

When the ICCPROFILEEXT structure is no longer needed, be sure to free the memory allocated by calling LFile::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.

See Also

Functions: | LFile::FreeICCProfile, LFile::InitICCProfile, LFile::LoadICCProfile, LFile::FreeICCProfileExt, LFile::SaveICCProfile, LFile::LoadICCProfileExt, Class Members
Topics: | Using ICC Profile Functions
 | Raster Image Functions: ICC Profile Functions

Example

/* This example initializes an ICC Profile, and then loads an ICC Profile from an Image, and after that it is freed */
L_VOID InitICCProfileExample(LFile& MyFile)
{
L_INT nRet ;
ICCPROFILEEXT iccProfile;
MyFile.SetFileName(TEXT("image1.jpg"));
// Initialize the ICCPROFILEEXT structure
nRet = MyFile.InitICCProfileExt( &iccProfile, sizeof(ICCPROFILEEXT));
// Load an ICC Profile that is embedded in an image
nRet = MyFile.LoadICCProfileExt( &iccProfile, NULL);
MyFile.SetFileName(TEXT("image2.jpg"));
// Save the ICC Profile into another image
nRet = MyFile.SaveICCProfile( &iccProfile, NULL);
// Free the ICCPROFILEEXT structure
nRet = MyFile.FreeICCProfileExt( &iccProfile);
}


LFile::IsValid

#include "ltwrappr.h"

L_BOOL LFile::IsValid(L_VOID)

Determines whether the LFile object is ready to be used.

Returns

TRUE | The LFile object is ready to be used.
FALSE | The LFile object is not ready to be used.

Comments

Before you can use some of the file functions, a bitmap and a filename must be associated with the class object. Until you have associated a bitmap and a filename with the LFile object, the object is considered invalid.

The function will return TRUE only if both the filename and the bitmap have been set and are valid.

The following table describes the functions that require either the bitmap, filename, or both to be set:

Functions: | Requirements:
LFile::GetInfo | requires the filename to be set
LFile::DeletePage | requires the filename to be set
LFile::ReadLoadResolutions | requires the filename to be set
LFile::ReadFileTransforms | requires the filename to be set
LFile::WriteFileTransforms | requires the filename to be set
LFile::GetCommentSize | requires the filename to be set
LFile::GetPCDResolution | requires the filename to be set
LFile::LoadBitmapList | requires the filename to be set
LFile::LoadOffset | requires the bitmap to be set
LFile::ReadComment | requires the filename to be set
LFile::ReadCommentExt | requires the filename to be set
LFile::ReadTag | requires the filename to be set
LFile::SaveBitmapList | requires the filename to be set
LFile::SaveOffset | requires the bitmap to be set
LFile::WriteComment | requires the filename to be set
LFile::FileConvert | does not require either filename or bitmap to be set

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.

See Also

Functions:

Class Members

Example

L_INT TestFunction ()
{
LBitmapBase LeadBitmap;
LFile LeadFile;

if (LeadFile.IsValid() == FALSE)
LeadFile.SetBitmap(&LeadBitmap);

return SUCCESS ;
}


LFile::LoadBitmap

#include "ltwrappr.h"

virtual L_INT LFile::LoadBitmap(nBitsPerPixel, nOrder, nPage, pFileInfo=NULL)

virtual L_INT LFile::LoadBitmap(nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps */
L_INT nPage; | /* number of the page to load */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file into the class object's associated bitmap. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
 | 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. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
nPage | The number of the page to load.
pLoadFileOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

Note: More options are available in the LOADFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical 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 multipage file or the resolution of a PCD file. Refer to Getting and Setting File Information.

The function will initialize the associated 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 LBitmapBase::Free.

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.

Note: For information on 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.

See Also

Functions: | Class Members, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D, LBitmapBase::GetLoadStatus, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray,
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

L_VOID TestFunction()
{
LFile
 LeadFile ;
LBitmapBase
 LeadBitmap;

LeadFile.SetBitmap(&LeadBitmap);
LeadFile.SetFileName(TEXT("image1.cmp"));
LeadFile.LoadBitmap ();
/*
 or */
/*
 LeadFile.LoadBitmap(0, ORDER_BGR, 0); */

LeadFile.SetFileName(TEXT("TestBMP.bmp"))
 ;
LeadFile.SaveBitmap(FILE_BMP,8,0)
 ;
/*
 or */
/*
 LeadFile.SaveBitmap(FILE_BMP, 8, 0, 0, SAVE_OVERWRITE);*/
//
 or LeadFile.SaveBitmap(FILE_BMP);

LeadFile.FileConvert(TEXT("TestBMP2.bmp"),TEXT("image1.cmp"),FILE_BMP,
LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),24,0,
 NULL, NULL);
}


LFile::LoadBitmapList

#include "ltwrappr.h"

virtual L_INT LFile::LoadBitmapList(pLFileBitmapList, nBitsTo=0, nColorOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL, pFileInfo=NULL)

LBitmapList L_FAR * pLFileBitmapList; | /* pointer to an LBitmapList object */
L_INT nBitsTo; | /* resulting bitmap pixel depth */
L_INT nColorOrder; | /* color order for 16-, 24-, 32-, 48, and 64-bit bitmaps */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Creates a bitmap list in the specified LBitmapList object, and loads bitmaps from a multipage file into the list.

Parameter | Description
pLFileBitmapList | Pointer to an LBitmapList object that is to receive the loaded list.
nBitsTo | Resulting pixel depth of bitmaps in the list. Possible values are:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant 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 toolkits.
 | 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 toolkits 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 toolkits only.
pLoadFileOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

Before calling this function, you must create an LBitmapList object. You can then pass the address of this object in the pLFileBitmapList parameter, which this function will update with the loaded bitmap list.

Note: More options are available in the LOADFILEOPTION structure.

Note: For information on 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.

See Also

Functions: | Class Members, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

L_VOID TestBitmapList()
{
LFile LeadFile ;
LBitmapBase LeadBitmap;
LBitmapList LeadBitmapList;
SAVEFILEOPTION SaveFileOption;
LSettings::UnlockSupport(L_SUPPORT_GIFLZW, L_KEY_GIFLZW);
LeadFile.SetFileName(TEXT("d:\\ltwin14x\\images\\eye.gif"));
LeadFile.LoadBitmapList(&LeadBitmapList) ;

// Get a copy of the first image
LeadBitmapList.GetFirstItem( &LeadBitmap);
// Get default SaveFileOption
LBaseFile::GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
// Use the target bitmap's palette as the global palette
LeadBitmap.GetColors( 0, 256, SaveFileOption.GlobalPalette);
// Assign the SAVEFILEOPTION fields
SaveFileOption.Flags = ESO_GLOBALBACKGROUND|ESO_GLOBALPALETTE;
SaveFileOption.GlobalWidth = LeadBitmap.GetWidth();
SaveFileOption.GlobalHeight = LeadBitmap.GetHeight();
SaveFileOption.GlobalLoop = 0;
SaveFileOption.GlobalBackground = RGB(0,255,0);
// Save the bitmap list as an animated GIF file
LeadFile.SetFileName(TEXT("d:\\Test_eye.gif"));
LeadFile.SaveBitmapList( &LeadBitmapList, FILE_GIF, 8, 0,
&SaveFileOption);
}


LFile::LoadBitmapResize

#include "ltwrappr.h"

virtual L_INT LFile::LoadBitmapResize(nDestWidth, nDestHeight, nDestBits, uFlags, nOrder, pLoadOptions, pFileInfo)

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 the class object's associated 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.

Parameter | Description
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 toolkits.
 | 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 toolkits 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 toolkits only.
pLoadOptions | Pointer to a LOADFILEOPTION structure that contains 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo 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.

See Also

Functions: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFile::LoadFile, LFile::LoadOffset, LFile::ReadStamp, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LBitmapWindow::CreatePanWnd, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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 in the resize.
The bitmap is loaded at the original bits per pixel. */
L_INT LoadBitmapResized(LFile & LeadFile, LBitmapBase & Bitmap,
L_TCHAR * pszFile)
{
LeadFile.SetBitmap(&Bitmap);
LeadFile.SetFileName(pszFile);
return LeadFile.LoadBitmapResize(0, 400, 0, SIZE_BICUBIC, ORDER_BGR, NULL, NULL);

}


LFile::LoadCMYKArray

#include "ltwrappr.h"

L_INT LFile::LoadCMYKArray(ppBitmapArray, uBitmapArrayCount, uStructSize, nBitsPerPixel, uFlags, pLoadFileOption, pFileInfo)

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 */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure */

Loads CMYK TIFF files as CMYK and avoids the color space conversion to RGB.

Parameter | Description
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. The uBitmapArrayCount parameter 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 LFile::LoadCMYKArray. 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.
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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfohas been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo 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 Codes.

Comments

If the data does not have to be loaded as CMYK, use the regular load
 functions LFile::LoadBitmap,
 LMemoryFile::LoadBitmap,
 LFile::LoadBitmapResize,
 LFile::LoadFile,
 LFile::LoadOffset,
 or LMemoryFile::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 LPaint::PaintDCCMYKArray to display the array and LFile::SaveCMYKArray to save this array as a CMYK TIFF file.

Note that if you pass 5 bitmaps to LFile::LoadCMYKArray 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 LBitmap::ColorMerge and pass COLORSEP_CMYK for the uFlags parameter. If alpha information is included, use LBitmapBase::SetAlpha 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 LFile::LoadBitmap, LMemoryFile::LoadBitmap,
 LFile::LoadBitmapResize,
 LFile::LoadFile,
 LFile::LoadOffset,
 or LMemoryFile::LoadMemory
 and then call LBitmap::ColorSeparate
 and LBitmapBase::CreateAlphaBitmap.

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.

See Also

Functions: | LPaint::PaintDCCMYKArray, LFile::SaveCMYKArray, LFile::LoadFile, LBaseFile::GetDefaultLoadFileOption, LBitmap::ColorMerge, LBitmap::ColorSeparate, LBitmapBase::CreateAlphaBitmap, LBitmapBase::SetAlpha
Topics: | Handling CMYK Files as Separate Bitmaps
 | Loading and Saving Images
 | Raster Image Functions: Loading Files

Example

void LoadfilecmykarrayExample()
{
/* 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 */
L_INT nRet;
FILEINFO FileInfo;
LFile file, fileRes ;
L_UINT u;
LBitmap CMYKBitmapsArray[4];
pBITMAPHANDLE CMYKHandlesArray[4] = {CMYKBitmapsArray[0].GetHandle(),
 CMYKBitmapsArray[1].GetHandle(),
CMYKBitmapsArray[2].GetHandle(), CMYKBitmapsArray[3].GetHandle()};

file.SetFileName(TEXT("C:\\TIFF24UncompressedCMYK.tif"))
 ;
memset(&FileInfo, 0,sizeof(FileInfo)) ;
nRet = file.GetInfo(&FileInfo,
 sizeof(FileInfo), 0, NULL);
if(nRet != SUCCESS)
{
MessageBox(TEXT("Invalid
 source file"), TEXT("Error"), MB_OK);
return ;
}

nRet = file.LoadCMYKArray(CMYKHandlesArray,
 4, sizeof(BITMAPHANDLE), 8,
LOADFILE_ALLOCATE|LOADFILE_STORE, NULL, NULL/*&FileInfo*/);
if(nRet != SUCCESS)
{
MessageBox(TEXT("LoadCMYKArray
 failed!"), TEXT("Error"), MB_OK);
return ;
}

/* The load has succeeded.
Increase the brightness of the K (black) plane
 by 50%
Note that this will DARKEN the image, because
 we increased the amount of black! */
nRet = CMYKBitmapsArray[3].ChangeIntensity(500);
if(nRet != SUCCESS)
MessageBox(TEXT("ChangeIntensity
 failed!"), TEXT("Error"), MB_OK);
else
{
fileRes.SetFileName(TEXT("C:\\myCMYK.tif"))
 ;
nRet = fileRes.SaveCMYKArray(CMYKHandlesArray,
 4, FILE_TIFLZW_CMYK, 8, 2, 0, NULL);
if(nRet != SUCCESS)
MessageBox(TEXT("SaveCMYKArray
 failed!"), TEXT("Error"), MB_OK);
}
// free the CMYK array allocated by LoadCMYKArray
for(u = 0; u < 4; u++)
{
L_TCHAR s[_MAX_PATH];
wsprintf(s, TEXT("c:\\plane%d.tif"),
 u);
nRet = CMYKBitmapsArray[u].Save(s,
 FILE_TIF, 0, 2, 0,NULL);
nRet = CMYKBitmapsArray[u].Free();
}
MessageBox(TEXT("Done")) ;
}


LFile::LoadExtensionStamp

#include "ltwrappr.h"

virtual L_INT LFile::LoadExtensionStamp(pExtensionList)

pEXTENSIONLIST pExtensionList;

/* pointer to a structure */

Loads a stamp from the specified extension list into the class object’s associated bitmap.

Parameter | Description
pExtensionList | Pointer to the EXTENSIONLIST structure that contains the stamp to load.

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

See Also

Functions: | LFile::ReadFileExtensions, LFile::GetExtensionAudio, LFile::FreeExtensions, LFile::ReadStamp, Class Members
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

L_VOID LoadExtensionStamp(LBitmapBase & Bitmap, L_TCHAR * pszFile)
{
LFile File;
pEXTENSIONLIST pExtensionList;

File.SetFileName(pszFile);
if (File.ReadFileExtensions(&pExtensionList) != SUCCESS)
{
MessageBox(NULL, TEXT("Error getting extensions!"),
TEXT("Loading Extension Stamp"), MB_OK);
return;
}

if (pExtensionList->uFlags & EXTENSION_STAMP)
{
File.SetBitmap(&Bitmap);
if (File.LoadExtensionStamp(pExtensionList) != SUCCESS)
MessageBox(NULL, TEXT("Error loading the stamp!"),
TEXT("Loading Extension Stamp"), MB_OK);
}
else
MessageBox(NULL, TEXT("The extensions do not contain a stamp!"),
TEXT("Loading Extension Stamp"), MB_OK);

File.FreeExtensions(pExtensionList);
}


LFile::LoadFile

#include "ltwrappr.h"

virtual L_INT LFile::LoadFile(nBitsPerPixel, nOrder, uFlags, nPage, pFileInfo=NULL)

virtual L_INT
 LFile::LoadFile(nBitsPerPixel=0,
 nOrder=ORDER_BGRORGRAY, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE, pLoadFileOption=NULL,
 pFileInfo=NULL)

L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that indicate the function behavior */
L_INT nPage; | /* number of the page to load */
pLOADFILEOPTION pLoadFileOption; | /* pointer to a LOADFILEOPTION structure */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image file into the class object's associated bitmap. The file can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
 | 0 | The data is 8 bits per pixel or less.
uFlags | Binary flags that determine the behavior of LFile::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 multipage file. Use this flag only if you are creating a bitmap list using the LPlayback::Append 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, and 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.
nPage | The number of the page to load.
pLoadFileOption | Pointer to the LOADFILEOPTION structure to be updated with the current extended values.
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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

This function supports the LFile::LoadFileCallBack virtual function.

Note: More options are available in the LOADFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical 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 multipage file or the resolution of a PCD file. Refer to Getting and Setting File Information.

Note: For information on 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.

See Also

Functions: | Class Members, LBitmapBase::GetLoadStatus, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFile::Compact, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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

class LUserFile : public LFile
{
public:
HDC m_hDC ;

public:
LUserFile () ;
virtual ~LUserFile () ;
virtual L_INT LoadFileCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines);
virtual L_INT SaveFileCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uRow,
L_UINT uLines);
};

LUserFile::LUserFile ()
{
}

LUserFile::~LUserFile ()
{
}

L_INT LUserFile::LoadFileCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines)
{
pLBitmap->Paint()->SetDC(m_hDC) ;
pLBitmap->Paint()->PaintDCBuffer( *pLBuffer, nRow);

return SUCCESS ;
}

L_INT LUserFile::SaveFileCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uRow,
L_UINT uLines)
{
L_UINT i; // Row counter
L_UINT uRowLast = uRow + uLines; // Used when counting rows
L_TCHAR szMessage [50] ;

// Put the required rows in the buffer
for (i = uRow; i < uRowLast; i++)
{
wsprintf(szMessage, TEXT("Row no. %u\n"),uRow);
MessageBox(NULL, szMessage, TEXT("Row"), MB_OK );
}

return SUCCESS ;
}

L_INT LoadSaveFunction(HWND hWnd)
{
LBitmapBase LeadBitmap ;
LUserFile UserLeadFile ;

UserLeadFile.SetBitmap(&LeadBitmap);
UserLeadFile.SetFileName(TEXT("image1.cmp")) ;
UserLeadFile.EnableCallBack(TRUE);

UserLeadFile.m_hDC = GetDC (hWnd);

UserLeadFile.LoadFile (24, ORDER_RGB, LOADFILE_ALLOCATE | LOADFILE_STORE);
/* or */
/* UserLeadFile.LoadFile(24, ORDER_RGB, LOADFILE_ALLOCATE | LEADFILE_STORE, 0); */

UserLeadFile.SetFileName (TEXT("Test.bmp"));
UserLeadFile.SaveFile (FILE_BMP, 8, 0, SAVEFILE_FIXEDPALETTE, NULL);

ReleaseDC (hWnd, UserLeadFile.m_hDC);
return SUCCESS ;
}


LFile::LoadFileCallBack

#include "ltwrappr.h"

virtual L_INT LFile::LoadFileCallBack(pFileInfo, pLBitmap, pLBuffer, uFlags, nRow, nLines)

pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure */
LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uFlags; | /* flags for the first and last row, and the 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 */

Handles the output image data that the LFile::LoadFile function has written to a buffer.

Parameter | Description
pFileInfo | Pointer to the FILEINFO structure that contains image information.
pLBitmap | Pointer to the bitmap object referencing the bitmap that contains the image information.
pLBuffer | Pointer to a buffer object 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 pLBuffer buffer object.

Returns

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

Comments

Override this function to handle the output image data that the LFile::LoadFile function has written to a buffer.

In some cases, The pLBuffer buffer object 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 LFile::LoadFile function to see how it uses the callback. The FILEINFO structure that gets passed to this function does not contain the total number of pages. To get the total number of pages, you should call LFile::GetInfo and set the FILEINFO_TOTALPAGES flag.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::LoadFile.


LFile::LoadFileOffsetCallBack

#include "ltwrappr.h"

virtual L_INT LFile::LoadFileOffsetCallBack(pFileInfo, pLBitmap, pLBuffer, uFlags, nRow, nLines)

pFILEINFO pFileInfo; | /* pointer to the FILEINFO structure */
LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
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 */

Handles the output image data that LFile::LoadOffset has written to a buffer.

Parameter | Description
pFileInfo | Pointer to the FILEINFO structure that contains image information.
pLBitmap | Pointer to the bitmap object referencing the bitmap that contains the image information.
pLBuffer | Pointer to a buffer object 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 pLBuffer buffer object.

Returns

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

Comments

Override this function to handle the output image data that LFile::LoadOffset has written to a buffer.

The FILEINFO structure that gets passed to this function does not contain the total number of pages. To get the total number of pages, you should call LFile::GetInfo and set the FILEINFO_TOTALPAGES flag.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::LoadOffset.


LFile::LoadFileTileCallBack

#include "ltwrappr.h"

virtual L_INT LFile::LoadFileTileCallBack(pFileInfo, pLBitmap, pLBuffer, uFlags, nRow, nLines)

pFILEINFO pFileInfo; | /* pointer to the file information handle */
LBitmapBase L_FAR * pLBitmap; | /* pointer to the bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uFlags; | /* flags for the first and last row, and the first and last pass */
L_INT nRow; | /* current bitmap row number of the first line in the buffer object */
L_INT nLines; | /* number of lines in the pLBuffer buffer object */

Handles the output image data that LFile::LoadTile has written to a buffer.

Parameter | Description
pFileInfo | Pointer to the FILEINFO structure that contains image information.
pLBitmap | Pointer to the bitmap object referencing the bitmap that contains the image information.
pLBuffer | A pointer to a buffer object 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. Possible values are:
 | 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 object.
nLines | The number of lines in the pLBuffer buffer object.

Returns

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

Comments

Override this function to handle the output image data that LFile::LoadTile has written to a buffer.

The FILEINFO structure that gets passed to the this function does not contain the total number of pages. To get the total number of pages, you should call LFile::GetInfo and set the FILEINFO_TOTALPAGES flag.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::LoadFile.


LFile::LoadICCProfile

#include "ltwrappr.h"

L_INT LFile::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 multipage and you can load the profile from a particular page using the pLoadOptions parameter.

Initialize the structure pointed to by pICCProfile first by calling LFile::InitICCProfile. If LFile::LoadICCProfile succeeds, free the ICC profile by calling LFile::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.

See Also

Functions: | LFile::InitICCProfile, LFile::FreeICCProfile
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to LFile::FreeICCProfile.


LFile::LoadICCProfileExt

#include "ltwrappr.h"
#include "ltclr.h"

L_INT LFile::LoadICCProfileExt(pICCProfile, pLoadOptions)

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
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 LFile::InitICCProfileExt. If LFile::LoadICCProfileExt succeeds, free the ICC profile by calling LFile::FreeICCProfileExt. In fact, when any ICCPROFILEEXT structure initialized by LFile::InitICCProfileExt is no longer needed, the memory must be freed by calling LFile::FreeICCProfileExt.

To save an ICC Profile to an image file, call LFile::SaveICCProfileExt.

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: | LFile::FreeICCProfile, LFile::InitICCProfile, LFile::LoadICCProfile, LFile::InitICCProfileExt, LFile::FreeICCProfileExt, LFile::SaveICCProfile
Topics: | Using ICC Profile Functions
 | Raster Image Functions: ICC Profile Functions

Example

For an example, refer to LFile::InitICCProfileExt.


LFile::LoadLayer

#include "ltwrappr.h"

virtual L_INT LFile::LoadLayer(nBitsPerPixel, nOrder, nLayer, pLayerInfo=NULL, pLoadOptions=NULL)

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 class object's associated bitmap. Currently only PSD files support layers.

Parameter | Description
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant bitmap
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmap
 | 24 | 24 bits per pixel in the resultant bitmap
 | 32 | 32 bits per pixel in the resultant bitmap
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 64 bits per pixel in the resultant bitmap
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 toolkits.
 | 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 toolkits 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 Document/Medical toolkits Imaging editions only.
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 toolkits.

Currently, only the PSD file format supports layers.

This function works similarly to the LFile::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 LBitmapBase::Free.

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.

See Also

Functions: | LFile::LoadBitmap, LFile::GetInfo, LFile::SaveBitmapWithLayers, Class Members
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

L_VOID TestFunction(LFile & File, LBitmapBase & Bitmap, L_TCHAR * pszFile, L_INT nLayer)
{
FILEINFO FileInfo;
int nRetCode;

File.SetBitmap(&Bitmap);
File.SetFileName(pszFile);
File.GetInfo(&FileInfo, sizeof(FILEINFO));

if (FileInfo.Layers)
{
if (FileInfo.Layers > nLayer)
{
nRetCode = File.LoadLayer(0, ORDER_BGRORGRAY, nLayer);
if(nRetCode!=SUCCESS)
{
LBase::DisplayErrorFromList();
}
}
else
MessageBox(NULL, TEXT("Invalid layer index!"), TEXT("Testing"), MB_OK);
}
else
MessageBox(NULL, TEXT("No layers in the file!"), TEXT("Testing"), MB_OK);
}


LFile::LoadOffset

#include "ltwrappr.h"

virtual L_INT LFile::LoadOffset(fd, nOffsetBegin, nBytesToLoad, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE, pLoadFileOption=NULL, pFileInfo=NULL)

L_INT fd; | /* file handle */
L_INT32 nOffsetBegin; | /* position of the first byte to load */
L_INT32 nBytesToLoad; | /* size of the embedded file */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order */
L_UINT uFlags; | /* flag that indicates the behavior of the function */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads an image from a file 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.)
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
 | 0 | The data is 8 bits per pixel or less.
uFlags | Binary flags that determine the behavior of LFile::LoadOffset. 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 multipage file. Use this flag only if you are creating a bitmap list using the LPlayBack::Append 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, 8-bit, and 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.
pLoadFileOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

This function supports the LFile::LoadFileOffsetCallBack virtual function.

Note: More information is available in the LOADFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

The location of the image is specified as shown in the following simple illustration:

Note: For information on 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.

See Also

Functions: | Class Members, LBitmapBase::GetLoadStatus, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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

class LUserFile : public LFile
{
public:
LUserFile ();
virtual ~LUserFile ();
virtual L_INT LoadFileOffsetCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines);
virtual L_INT SaveFileOffsetCallBack(LBitmapBase L_FAR* pLBitmap,
 LBuffer L_FAR* pLBuffer,
 L_UINT uRow,
 L_UINT uLines);
};

LUserFile::LUserFile ()
{
}

LUserFile::~LUserFile ()
{
}

L_INT LUserFile::LoadFileOffsetCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines)
{
MessageBox(NULL,TEXT("Here the user can set his code for LoadOffset"),
TEXT("LoadOffset"),MB_OK);
return SUCCESS ;
}

L_INT LUserFile:: SaveFileOffsetCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uRow,
L_UINT uLines)
{
MessageBox(NULL,TEXT("Here the user can set his code for SaveOffset"),
TEXT("SaveOffset"),MB_OK);
return SUCCESS ;
}

L_VOID LoadSaveOffsetFunction(LBitmapBase& LeadBitmap,HWND hWnd)
{
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
LUserFile UserLeadFile ;

UserLeadFile.SetBitmap(&LeadBitmap);
// 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 = UserLeadFile.SaveOffset(OffsetFile,
 30, &SizeWritten,
FILE_BMP,
 8, 0, SAVEFILE_FIXEDPALETTE, NULL);

// Close the file
_lclose(OffsetFile);

// Notify the user with a message box
if (nRet == SUCCESS)
{
MessageBox (hWnd, TEXT("File
 was saved"), TEXT("Notice"), MB_OK);
}
else
{
wsprintf (szMessage, TEXT("Error
 %d saving the file"), nRet);
MessageBox (hWnd, szMessage,
 TEXT("Error"), MB_OK);
return;
}

// Free the bitmap
LeadBitmap.Free();

/***** 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 = UserLeadFile.LoadOffset(
 OffsetFile, 30, SizeWritten,
0, ORDER_BGR, LOADFILE_ALLOCATE
 | LOADFILE_STORE, 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.GetBitsPerPixel());
MessageBox (NULL, szMessage,
 TEXT("Notice"), MB_OK);
}
else
{
wsprintf (szMessage, TEXT("Error
 %d loading the file"), nRet);
MessageBox (NULL, szMessage,
 TEXT("Error"), MB_OK);
}
}


LFile::LoadTile

#include "ltwrappr.h"

virtual L_INT LFile::LoadTile(nCol, nRow, uWidth, uHeight, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE, pLoadFileOption=NULL, pFileInfo=NULL)

L_INT nCol; | /* left column of the tile */
L_INT nRow; | /* top row of the 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 indicate the function behavior */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */
pFILEINFO pFileInfo; | /* pointer to a structure */

Loads a section of an image file (any format). The section begins at (nCol, nRow) and extends uWidth pixels across and uHeight pixels down.

Parameter | Description
nCol | Left column of the tile.
nRow | Top row of the tile.
uWidth | Tile width in pixels.
uHeight | Tile height in pixels.
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
uFlags | Binary flags that determine the behavior of LFile::LoadTile. 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 multipage file. Use this flag only if you are creating a bitmap list using the LPlayBack::Append 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, and 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.
pLoadFileOption | 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 LFile::GetInfo.
 | 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 LFile::GetInfo has been called previously, but values that affect the size of the image loaded have been changed (for example, by calling LFileSettings::SetPCDResolution or LFileSettings::SetWMFResolution). In this case the FILEINFO structure pointed to by pFileInfo will be updated with the results of LFile::GetInfo.
 | If LFile::GetInfo has been called prior to calling this function, and no changes have been made to the contents of the structure filled by LFile::GetInfo, 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 LFile::GetInfo function will set the FILEINFO.Flags to FILEINFO_INFOVALID. In this case the load will be faster since this function does not have to query the file filters for the file type.

Returns

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

Comments

This function supports the LFile::LoadFileTileCallBack virtual function.

Note: More information is available in the LOADFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

Note: For information on 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.

See Also

Functions: | Class Members, LBitmapBase::GetLoadStatus, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

class LUserFile : public LFile
{
public:
LUserFile() ;
virtual ~LUserFile () ;
virtual L_INT LoadFileTileCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
 LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines);
virtual L_INT SaveFileTileCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uRow,
L_UINT uLines);
};

LUserFile::LUserFile ()
{
}

LUserFile::~LUserFile ()
{
}

L_INT LUserFile::LoadFileTileCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines)
{
MessageBox(NULL,TEXT("Here the user can set his code for LoadTile"),
TEXT("LoadTile"),MB_OK);

return SUCCESS ;
}

L_INT LUserFile::SaveFileTileCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uRow,
L_UINT uLines)
{
MessageBox(NULL,TEXT("Here the user can set his code for SaveTile"),
TEXT("SaveTile"),MB_OK);

return SUCCESS ;
}

L_VOID LoadSaveTileFunction()
{
LUserFile UserLeadFile ;
LBitmapBase LeadBitmap;
FILEINFO FileInfo;

UserLeadFile.SetBitmap(&LeadBitmap) ;
UserLeadFile.SetFileName(TEXT("Image10.fpx")) ;
UserLeadFile.EnableCallBack(TRUE);

L_INT nRet = UserLeadFile.GetInfo( &FileInfo ,sizeof(FILEINFO), 0);

UserLeadFile.LoadTile( FileInfo.Width/4, FileInfo.Height/4,
(FileInfo.Width)/2, (FileInfo.Height)/2, 0, ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE) ;

UserLeadFile.SetFileName(TEXT("TEST.FPX")) ;

// Save a bitmap in the center of the image
UserLeadFile.SaveTile((FileInfo.Width - LeadBitmap.GetWidth())/2,
(FileInfo.Height - LeadBitmap.GetHeight())/2, NULL);
}


LFile::ReadComment

#include "ltwrappr.h"

virtual L_INT LFile::ReadComment(uType, pLBuffer, pLoadFileOption=NULL)

L_UINT uType; | /* type of comment*/
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Gets a single comment, a group of comments or several groups of comments from a file.

Parameter | Description
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.
pLBuffer | Pointer to the buffer object that will hold all the comments.
pLoadFileOption | 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

The basic order of function calls to retrieve comments is as follows:

Get the size of the comments with LFile::GetCommentSize

Allocate a buffer of a corresponding size.

Read the comments with LFile::ReadComment

Free the buffer

To write comments to a file, all the comments you wish to add to a new file must be set. LFileSettings::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 LFile::SaveFile or LFile::SaveBitmap when creating a new file. If you wish to change a comment in an existing file, use LFile::WriteComment.

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.

See Also

Functions: | LFile::ReadCommentOffset, Class Members
Topics: | Raster Image Functions: Maintaining File Comments
 | Loading and Saving Images

Example

void Readcomment()
{
// 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.

L_INT CommentLength;
LBitmap LeadBitmap;
LFileSettings fileSettings;
L_INT nRet;
HGLOBAL hTextToGet;
L_CHAR *pTextToSet = "Susie, the artist";
L_CHAR *pTextToGet;

L_TCHAR message[200];

   //Set
 the comment
fileSettings.SetComment(CMNT_SZARTIST,
 (L_UCHAR *)pTextToSet, strlen(pTextToSet) + 1);

//Get the length of a comment
CommentLength = fileSettings.GetComment(CMNT_SZARTIST,
 NULL, 0);

//Allocate and lock a zero-filled buffer for the
 comment
hTextToGet = GlobalAlloc(GPTR, CommentLength);
pTextToGet = (L_CHAR *)GlobalLock(hTextToGet);

//Get the actual comment
fileSettings.GetComment(CMNT_SZARTIST, (L_UCHAR
 *)pTextToGet, CommentLength);

//Show the comment that will be saved

   wsprintf(message,TEXT("
 %hs"),pTextToGet);
::MessageBox(NULL, message, TEXT("Saving
 Artist Comment"), MB_OK);

// Free memory
GlobalUnlock(hTextToGet);
GlobalFree(hTextToGet);

//Load, and then save the image with the new comment
LeadBitmap.SetFileName(TEXT("test.tif"));
nRet = LeadBitmap.Load();
nRet = LeadBitmap.Save(FILE_TIF,
 8, 0, NULL, NULL);

//Get the length of a comment in the file
CommentLength = LeadBitmap.File()->ReadComment(CMNT_SZARTIST,
 NULL);

//Get the actual comment from the file
LBuffer LeadBuffer(CommentLength);
nRet = LeadBitmap.File()->ReadComment(CMNT_SZARTIST,
 &LeadBuffer);

//Show the comment that was saved in the file

   wsprintf(message,TEXT("
 %hs"),LeadBuffer.Lock());
::MessageBox (NULL, message, TEXT("Artist
 comment"), MB_OK);
LeadBuffer.Unlock();
}


LFile::ReadCommentExt

#include "ltwrappr.h"

virtual L_INT LFile::ReadCommentExt(uType, pComments, pBuffer, puLength, pLoadFileOption=NULL)

L_UINT uType; | /* type of comment*/
LPFILECOMMENTS pComments; | /* pointer to a structure */
L_UCHAR L_HUGE * pBuffer; | /* pointer to a buffer */
L_UINT L_FAR puLength; | /* pointer to a variable to be updated */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Gets a single comment, a group of comments or several groups of comments from a file.

Parameter | Description
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 object that will hold all the comments.
puLength | Pointer to a variable to be updated with the size of the buffer that will hold all the comments.
pLoadFileOption | 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 LFile::GetCommentSize

Allocate a buffer of a corresponding size.

Read the comments with LFile::ReadComment

Free the buffer

To write comments to a file, all the comments you wish to add to a new file must be set. LFileSettings::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 LFile::SaveFile or LFile::SaveBitmap when creating a new file. If you wish to change a comment in an existing file, use LFile::WriteComment.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Maintaining File Comments
 | Loading and Saving Images

Example

L_UINT uLength;
L_TCHAR szMessage[80];
L_CHAR L_FAR *pTextToGet;
L_UINT32 L_FAR *pLong;
L_CHAR L_FAR *pString;
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:*/
L_INT nStatus;
LFile file;
LBuffer Buff;
/* Determine the size, in bytes, of the desired group of comments. */

file.SetFileName(TEXT("TEST.FPX"));
nStatus = file.GetCommentSize(CMNT_FPXSUMMARYINFORMATION, &uLength);

/* Allocate a buffer based on the size of the comments obtained by LFile::GetCommentSize and stored in uLength. */
Buff.Reallocate(uLength);
pTextToGet = (L_CHAR L_FAR *)Buff.Lock();

/* Initialize the FileComments structure. */
FileComments.count = CMNT_LAST + 1;
FileComments.pointer = pPointer;
FileComments.size = uSize;

/* Read the group of comments into the buffer. */
nStatus = file.ReadCommentExt(CMNT_FPXSUMMARYINFORMATION,&FileComments,(L_UCHAR L_FAR*) pTextToGet, &uLength);

/* 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*)(pArray + 1);
pLong = (L_UINT32 L_FAR *)(pElement + 1);
wsprintf(szMessage, TEXT("%hs-%ul"), pString, *pLong);
MessageBox(NULL, szMessage, TEXT("Title & Security"), MB_OK);
}


LFile::ReadCommentOffset

#include "ltwrappr.h"

L_INT LFile::ReadCommentOffset(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. For a list of possible values, refer to Types of File Comments.
pComment | Pointer to the buffer that will hold the comment field, including the terminating NULL. Pass NULL to get only the length of the field (the return value).
uLength | The size of the 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 LFile::ReadComment function, this function lets you read comments that are already saved in a file header. The only difference between the LFile::ReadComment function and this function is that this function allows you to specify an offset for the image data. For more information refer to the LFileSettings::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 LBaseFile::EnableRedirectIO) 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, use the LFileSettings::SetComment function to specify the comments to be saved.

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.

See Also

Functions: | LFile::ReadComment, LFile::SaveOffset, LFileSettings::SetComment, LMemoryFile::ReadComment
Topics: | Raster Image Functions: Maintaining File Comments and Tags
 | Types of File Comments
 | Implementing TIFF Comments and Tags

Example

#define COMMENT TEXT("I am the artist!")
void ReadfilecommentoffsetExample()
{
/* The following sample will create a file with an offset and will read a comment from the file it just saved: */
LBitmap Bitmap;
LFile lf;
HFILE OffsetFile; /* File handle */
L_INT32 SizeWritten; /* Variable to be updated with the size written */
L_INT nRet = 0 ; /* Return value */

/* Load an existing bitmap */
nRet = Bitmap.Load(TEXT("C:\\Optimized.gif"), 0, ORDER_BGR);
if(nRet != SUCCESS)
{
MessageBox(TEXT("Load has failed!"), TEXT("FAILURE"), MB_OK|MB_ICONERROR);
return;
}

lf.SetBitmap(&Bitmap) ;
lf.SetFileName(TEXT("C:\\Optimized.gif")) ;

#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 */
nRet = _lwrite(OffsetFile, TEXT("This is a 29-character string"), 30);
if (nRet == HFILE_ERROR) return ;
/* set and save a comment into a file with an offset */
nRet = LFileSettings::SetComment(CMNT_SZARTIST, (L_UCHAR L_FAR*)COMMENT, sizeof(COMMENT));

/* Save the image file with an offset inside the TOFFSET.TST file */
nRet = lf.SaveOffset(OffsetFile, 30, &SizeWritten, FILE_TIF);

/* Close the file */
_lclose(OffsetFile);

/* free the bitmap */
Bitmap.Free();

/* Notify the user with a message box */
if (nRet != SUCCESS)
{
MessageBox (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 = lf.ReadCommentOffset( 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 = lf.ReadCommentOffset(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((LPSTR)pComment, TEXT("SUCCESS"), MB_OK);
#endif
}
free(pComment);
}

/* Close the file */
_lclose(OffsetFile);
}


LFile::ReadFileExtensions

#include "ltwrappr.h"

virtual L_INT LFile::ReadFileExtensions(ppExtensionList, pLoadOptions=NULL)

pEXTENSIONLIST * ppExtensionList; | /* pointer to a pointer to a structure */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Loads extensions from an Exif file. Please note that not all Exif files have extensions.

Parameter | Description
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 LFile::LoadExtensionStampfunction can be used to load a stamp from the extension and LFile::GetExtensionAudio can be used to get embedded audio data.

When the memory allocated by this function is no longer needed, call LFile::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.

See Also

Functions: | LFile::LoadExtensionStamp, LFile::GetExtensionAudio, LFile::FreeExtensions, LFile::ReadStamp, Class Members
Topics: | Raster Image Functions: Getting and Setting File Information
 | Exif File Extensions
 | Implementing Exif Features

Example

#include <stdio.h>

L_VOID GetExifInfo(L_TCHAR * pszFile, L_CHAR * pszInfoFile)
{
LFile File;
pEXTENSIONLIST pExtensionList;
L_CHAR szBuffer[512];
L_CHAR szName[128];
L_CHAR szCLSID[64];

FILE * fd;

File.SetFileName(pszFile);

if (File.ReadFileExtensions(&pExtensionList) != SUCCESS)
{
MessageBox(NULL, TEXT("Error getting extensions!"),
TEXT("Getting Extensions"), MB_OK);
return;
}

// Open the info .txt file
fd = fopen(pszInfoFile, "wt");

if(!fd)
{
MessageBox(NULL, TEXT("Error opening info file!"),
TEXT("Getting Extensions"), MB_OK);
return;
}

// Do we have a stamp, audio, or both?
switch(pExtensionList->uFlags & (EXTENSION_STAMP | EXTENSION_AUDIO))
{
case 0:
strcpy(szBuffer, ""); break;

case EXTENSION_STAMP:
strcpy(szBuffer, ", EXTENSION_STAMP"); break;

case EXTENSION_AUDIO:
strcpy(szBuffer, ", EXTENSION_AUDIO"); break;

case EXTENSION_STAMP | EXTENSION_AUDIO:
strcpy(szBuffer, ", EXTENSION_STAMP | EXTENSION_AUDIO"); break;
}

fprintf(fd, "Extension count: %d%s\n",pExtensionList->uCount, szBuffer);

for (L_UINT 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
szName, // Buffer for new string
sizeof(szName), // Size of buffer
NULL, // Default for unmappable chars
NULL)) // Sset when default char used
{
strcpy(szName, "ERROR decoding the Unicode string");
}

if (pExtensionList->aList[u].pClsid)
{
StringFromGUID2((REFGUID) pExtensionList->aList[u].pClsid,
(LPWSTR) szBuffer, sizeof(szBuffer));
WideCharToMultiByte(CP_ACP, // Code page
0, // Performance and mapping flags
(LPWSTR) szBuffer, // Wide-character string
-1, // Number of chars in string
szCLSID, // Buffer for new string
sizeof(szCLSID), // Size of buffer
NULL, // Default for unmappable chars
NULL); // Set when default char used
}
else
strcpy(szCLSID, "NULL");

// Write information about stream 'u'
fprintf(fd, "[%d]: Name = %s, DataSize = %d, CLSID = %s\n", u,
szName, pExtensionList->aList[u].uDataSize, szCLSID);

}

fclose(fd);

// Run notepad to show the info file
sprintf(szBuffer, "notepad %s", pszInfoFile);
WinExec(szBuffer, SW_SHOW);

File.FreeExtensions(pExtensionList);
}


LFile::ReadFileTransforms

#include "ltwrappr.h"

virtual L_INT LFile::ReadFileTransforms(pTransforms, pLoadFileOption=NULL)

pFILETRANSFORMS pTransforms; | /* pointer to a transform structure */
pLOADFIlEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Reads the transforms stored with an image in a FlashPix file.

Parameter | Description
pTransforms | Pointer to a transform structure.
pLoadFileOption | 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.

See Also

Functions: | LBitmap::HighPassFilter, Class Members
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

Example

L_VOID MyFunction()
{
LFile LeadFile ;
FILETRANSFORMS FileTransforms;

LeadFile.SetFileName(TEXT("TEST.FPX")) ;

LeadFile.ReadFileTransforms( &FileTransforms, NULL);

//Increase the contrast by 20%
FileTransforms.fContrastAdjustment *= (L_FLOAT)1.2;

LeadFile.WriteFileTransforms( &FileTransforms, FALSE, NULL);
}


LFile::ReadGeoKey

#include "ltwrappr.h"

virtual L_INT LFile::ReadGeoKey(uTag, puType, puCount, pData, pLoadOptions)

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 *puCount; | /* 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
uTag | GeoKey ID that you set by calling LFile::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

Obtains 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, passing NULL to 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 LFile::EnumGeoKeys and then read each GeoKey with LFile::ReadGeoKey.

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.

See Also

Functions: | LFile::SetGeoKey, LFile::GetGeoKey, LFile::WriteGeoKey, LFile::WriteMetaData, LFile::EnumGeoKeys, LFile::SaveFile, LFile::SaveBitmap
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

For an example, refer to LFile::WriteGeoKey function.


LFile::ReadLoadResolutions

#include "ltwrappr.h"

virtual L_INT LFile::ReadLoadResolutions(pDimensions, pDimensionCount, pLoadFileOption)

pDIMENSION pDimensions; | /* pointer to the array to be updated */
L_INT L_FAR * pDimensionCount; | /* address of the variable to be updated */
pLOADFIlEOPTION pLoadFileOption | /* pointer to optional extended load options */

Examines a FlashPix, PhotoCD, or JBIG file to determine which resolutions it contains.

Parameter | Description
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.
pLoadFileOption | 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 use an older function (LFile::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 LFileSettings::SetLoadResolution function to specify the one to be loaded.

Before you can call this function, you must set the filename for the class object.

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.

See Also

Functions: | Class Members, LFile::GetPCDResolution
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing PhotoCD and FlashPix Features
 | Implementing JBIG Features

Example

L_VOID TestLoad( HWND hWnd)
{
pDIMENSION pDimensions; // Pointer to the array to be updated
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
LFile LeadFile ;
FILEINFO FileInfo ;
LBitmapBase LeadBitmap;

LeadFile.SetBitmap(&LeadBitmap) ;
LeadFile.SetFileName(TEXT("Img0024.pcd")) ;

LeadFile.GetInfo(&FileInfo, sizeof(FILEINFO)) ;

LeadFile.ReadLoadResolutions(NULL, &DimensionCount, NULL) ;

// Fill the array
LeadFile.ReadLoadResolutions( 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
LFileSettings::SetLoadResolution(FileInfo.Format, pDimensions[0].nWidth, pDimensions[0].nHeight);

// Get the dimensions that we just set and display them
LFileSettings::GetLoadResolution(FileInfo.Format, &uWidth, &uHeight);

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
LeadFile.LoadBitmap ();

// Update the paint palette to force a repaint
SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);
}


LFile::ReadStamp

#include "ltwrappr.h"

virtual L_INT LFile::ReadStamp(pLoadFileOption=NULL)

pLOADFILEOPTION pLoadFileOption;

/* pointer to optional extended load options */

Reads a thumbnail image stored in a file and loads it into a specified bitmap.

Parameter | Description
pLoadFileOption | 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 files 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Loading and Saving Stamp Images
 | Loading and Saving Images

Example

L_VOID StampTestFunction()
{
LFile LeadFile;
LBitmapBase LeadBitmap;
L_INT nRet = 0 ;

LeadFile.SetBitmap(&LeadBitmap);
LeadFile.SetFileName(TEXT("Image10.fpx"));

//Reads a thumbnail image stored in a FlashPix file and loads it into a specified bitmap.
nRet = LeadFile.ReadStamp();

if (nRet == SUCCESS)
{
//Puts a stamp, in an existing FlashPix file "IMAGE11.FPX"
LeadFile.SetFileName(TEXT("IMAGE11.FPX"));
LeadFile.WriteStamp(NULL);
}
else
MessageBox(NULL,TEXT("File has no thumbnail image"),TEXT("Stamp"),MB_OK);
}


LFile::ReadTag

#include "ltwrappr.h"

virtual L_INT LFile::ReadTag(uTag, pType, pCount, pLBuffer, pLoadFileOption=NULL)

L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16 L_FAR * pType; | /* address of the variable to be updated with the data type */
L_UINT32 L_FAR * pCount; | /* Address of the variable to be updated with the count */
LBuffer L_FAR * pLBuffer; | /* Pointer to the buffer to be updated with the data */
pLOADFILEOPTION pLoadFileOption; | /* 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
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the LFileSettings::SetTag function. Examples of registered tags are:
 | 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.
pLBuffer | 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.
pLoadFileOption | 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

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
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: | LFile::DeleteTag, Class Members
Topics: | Implementing TIFF Comments and Tags

Example

L_VOID TestReadTag()
{
L_UINT16 LogoPosition = 0x8001; // my private
 tag
L_UINT16 TagType; // tagged data type
L_UINT32 TagCount; // count of data items
L_INT32 BufferSize; // required size of the buffer
LFile LeadFile;
LBuffer LeadBuffer;

LeadFile.SetFileName(TEXT("1.tif"));

// Get the required buffer size
BufferSize = LeadFile.ReadTag(
 LogoPosition, &TagType, &TagCount, NULL);

// Allocate and lock the buffer
if ((TagType == TAG_SSHORT) && (BufferSize
 > 0))
LeadBuffer.Reallocate(BufferSize);
else
return;

// Get the tagged data
LeadFile.ReadTag(
 LogoPosition, &TagType, &TagCount, &LeadBuffer);
}


LFile::SaveBitmap

#include "ltwrappr.h"

virtual L_INT LFile::SaveBitmap(nFormat, nBitsPerPixel, nQFactor, nPageNumber, uFlags)

virtual L_INT LFile::SaveBitmap(nFormat, nBitsPerPixel=0, nQFactor=2, uFlags=SAVE_OVERWRITE, pSaveFileOption=NULL)

L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_INT nPageNumber; | /* number of the page on which to save the bitmap */
L_UINT uFlags; | /* flag that indicates how to save the page */
SAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves an image contained in the class object's associated bitmap to a file, in any of the supported compressed or uncompressed formats.

Parameter | Description
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 LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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.
nPageNumber | The number of the page on which to save the bitmap.
uFlags | Flag that indicates how to save the bitmap. Possible values are:
 | Value | Meaning
 | SAVE_OVERWRITE | [0] No insert/replace/append is performed. An existing file is overwritten.
 | SAVE_APPEND | [1] or [-1] The page is appended if the file exists.
 | SAVE_REPLACE | [2] Replace the page specified in the nPageNumber variable.
 | SAVE_INSERT | [3] Insert the bitmap at the specified page number.
pSaveFileOption | 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 toolkits.

For information on saving annotations as a tag in a TIFF file, refer to LAnnContainer::SaveTag.

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.

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.

See Also

Functions: | LAnnContainer::SaveTag, Class Members
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

Example

For an example, refer to LFile::LoadBitmap.


LFile::SaveBitmapList

#include "ltwrappr.h"

virtual L_INT LFile::SaveBitmapList(pList, nFormat, nBits=0, nQFactor=2, pSaveFileOption=NULL)

LBitmapList L_FAR * pList; | /* pointer to the LBitmapList object */
L_INT nFormat; | /* output file format */
L_INT nBits; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves the specified list of bitmaps in a multipage file.

Parameter | Description
pList | Pointer to the LBitmapList object that holds the list of bitmaps.
nFormat | Output file format. You can save multipage 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 closest BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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.
pSaveFileOption | 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Playing Animated Images
 | Implementing Animation

Example

For an example, refer to LFile::LoadBitmapList.


LFile::SaveBitmapWithLayers

#include "ltwrappr.h"

virtual L_INT LFile::SaveBitmapWithLayers(nFormat, nBitsPerPixel, nQFactor, pLayers, pLayerInfo=NULL, nLayers=0, pSaveOptions=NULL)

L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
LBitmapList pLayers; | /* handle to an LBitmapList object */
pLAYERINFO pLayerInfo; | /* pointer to a structure */
L_INT nLayers; | /* number of layers in pLayerInfo */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves the class object's associated bitmap to a file, along with the specified layers.

Parameter | Description
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.
pLayers | Pointer to an LBitmapList object 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.

See Also

Functions: | LFile::LoadLayer, LFile::SaveBitmap, LFile::SaveFile, LFile::SaveOffset, LFile::FileConvert, LFileSettings::SetComment, LDialogFile::DoModalSave , Class Members
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

L_VOID TestFunction(L_TCHAR * pszOutFile, L_TCHAR * pszFile,
L_TCHAR * pszLayers[], L_INT nLayers)
{
LBitmapBase Bitmap;
LBitmapList Layers;
LFile File;

Layers.Create();

for (L_INT i = 0; i < nLayers; i++)
{
Bitmap.Load(pszLayers[i]);
Layers.InsertItem(&Bitmap);
}

Bitmap.Load(pszFile);
File.SetFileName(pszOutFile);
File.SetBitmap(&Bitmap);

File.SaveBitmapWithLayers(FILE_PSD,
 0, 0, &Layers);
}


LFile::SaveCMYKArray

#include "ltwrappr.h"

L_INT LFile::SaveCMYKArray(ppBitmapArray, uBitmapArrayCount, nFormat, nBitsPerPixel, nQFactor, uFlags, pSaveOptions)

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 */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

This function saves an array of bitmaps as a CMYK TIFF file.

Parameter | Description
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. The uBitmapArrayCount parameter 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 LFile::GetInfo 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 LFile::GetInfo will report 16 bits less (48 or 64-bit).
nQFactor | Reserved for future use. Pass 2.
uFlags | Binary flags that determine the behavior of LFile::SaveCMYKArray. 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.
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 LFile::LoadCMYKArray.

To save the array of bitmaps as a file format not supported by this function, call LBitmap::ColorMerge to create a BGR bitmap and save the generated bitmap using LFile::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.

See Also

Functions: | LFile::LoadCMYKArray, LBitmap::ColorMerge, LBitmap::ColorSeparate, LFile::SaveFile, LBuffer::ConvertColorSpace
Topics: | Handling CMYK Files as Separate Bitmaps
 | Loading and Saving Images
 | Raster Image Functions: Saving Files

Example

For an example, refer to LFile::LoadCMYKArray.


LFile::SaveFile

#include "ltwrappr.h"

virtual L_INT LFile::SaveFile(nFormat, nBitsPerPixel=0, nQFactor=2, uFlags=0, pSaveFileOption=NULL)

L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that indicate the behavior of the function */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Creates a file in any of the supported compressed or uncompressed formats.

Parameter | Description
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 LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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.
uFlags | Binary flags that determine the behavior of LFile::SaveFile. Possible values are:
 | 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 multipage file. It appends the image as the last one in the file. You can save multipage images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pSaveFileOption | 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 can override the LFile::SaveFileCallBack virtual function to supply the image data.

If you do not override the callback function, this function saves data from the class object's associated 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 toolkits.

Note: More options are available in the SAVEFILEOPTION structure.

Note: If SAVE_MULTIPAGE is passed in uFlags, this takes precedence over the EFO_REPLACEPAGE or EFO_INSERTPAGE flags set in SAVEFILEOPTION.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

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.

See Also

Functions: | LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFile::Compact, Class Members
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 an example, refer to LFile::LoadFile.


LFile::SaveFileCallBack

#include "ltwrappr.h"

virtual L_INT LFile::SaveFileCallBack(pLBitmap, pLBuffer, uRow, uLines)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uRow; | /* first line to write to the buffer */
L_UINT uLines; | /* number of lines to write to the buffer */

Provides input to the LFile::SaveFile function.

Parameter | Description
pLBitmap | Pointer to the bitmap object that contains the image information.
pLBuffer | Pointer to the caller's input buffer object 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.

Returns

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

Comments

If you override this function, you must supply the image data that the function will save. The base class implementation saves data from the class object's associated bitmap.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM 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.

See Also

Functions:

LFile::~LFile, Class Members

Example

For an example, refer to LFile::LoadFile.


LFile::SaveFileOffsetCallBack

#include "ltwrappr.h"

virtual L_INT LFile::SaveFileOffsetCallBack(pLBitmap, pLBuffer, uRow, uLines)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uRow; | /* first line to write to the buffer */
L_UINT uLines; | /* number of lines to write to the buffer */

Provides input to LFile::SaveOffset.

Parameter | Description
pLBitmap | Pointer to the bitmap object that contains the image information.
pLBuffer | Pointer to the caller's input buffer object 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.

Returns

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

Comments

Override this function to provide input to LFile::SaveOffset.

If you override this function, you must supply the image data that the function will save. The base class implementation saves data from the class object's associated bitmap.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM 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.

See Also

Functions:

LFile::~LFile, Class Members

Example

For an example, refer to LFile::LoadOffset.


LFile::SaveFileTileCallBack

#include "ltwrappr.h"

virtual L_INT LFile::SaveFileTileCallBack(pLBitmap, pLBuffer, uRow, uLines)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a bitmap object */
LBuffer L_FAR * pLBuffer; | /* pointer to a buffer object */
L_UINT uRow; | /* first line to write to the buffer */
L_UINT uLines; | /* number of lines to write to the buffer */

Provides input to the LFile::SaveTile function.

Parameter | Description
pLBitmap | Pointer to the bitmap object that contains the image information.
pLBuffer | Pointer to the caller's input buffer object 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.

Returns

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

Comments

If you override this function, you must supply the image data that the function will save. The base class implementation saves data from the class object's associated bitmap.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM 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.

See Also

Functions:

LFile::~LFile, Class Members

Example

For an example, refer to LFile::LoadTile.


LFile::SaveICCProfile

#include "ltwrappr.h"
#include "ltclr.h"

L_INT LFile::SaveICCProfile(pICCProfile, pSaveOptions)

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
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 LFile::InitICCProfileExt. If LFile::SaveICCProfileExt succeeds, free the ICC profile by calling LFile::FreeICCProfileExt. In fact, when any ICCPROFILEEXT structure initialized by LFile::InitICCProfileExt is no longer needed, the memory must be freed by calling LFile::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.

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: | LFile::FreeICCProfile, LFile::InitICCProfile, LFile::LoadICCProfile, LFile::InitICCProfileExt, LFile::FreeICCProfileExt, LFile::LoadICCProfileExt, Class Members
Topics: | Using ICC Profile Functions
 | Raster Image Functions: ICC Profile Functions

Example

For an example, refer to LFile::InitICCProfileExt.


LFile::SaveOffset

#include "ltwrappr.h"

virtual L_INT LFile::SaveOffset(fd, nOffsetBegin, pnSizeWritten, nFormat, nBitsPerPixel=0, nQFactor=2, uFlags=0, pSaveFileOption=NULL)

L_INT fd; | /* file handle */
L_INT32 nOffsetBegin; | /* offset within the specified file */
L_INT32 L_FAR * pnSizeWritten; | /* address of a variable to be updated */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality control */
L_INT uFlags; | /* flags that indicate the behavior of the function */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves a bitmap to a file in any supported format 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.
pnSizeWritten | Address of a variable to be updated with the size of the embedded image file.
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 LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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 LFile::SaveFile. Possible values are:
 | 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 multipage file. It appends the image as the last one in the file. You can save multipage images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
pSaveFileOption | 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 LFile::LoadOffset 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).

You can override the LFile::SaveFileCallBack virtual function to supply the image data.

If you do not override the callback function, this function saves data from the class object's associated 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 toolkits.

Note: More options are available in the SAVEFILEOPTION structure.

Note: If SAVE_MULTIPAGE is passed in uFlags, this takes precedence over the EFO_REPLACEPAGE or EFO_INSERTPAGE flags set in SAVEFILEOPTION.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

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.

See Also

Functions: | LFile::ReadCommentOffset, LFile::Compact, Class Members
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

Example

For an example, refer to LFile::LoadOffset.


LFile::SaveTile

#include "ltwrappr.h"

virtual L_INT LFile::SaveTile(nCol, nRow, pSaveFileOption=NULL)

L_INT nCol; | /* left column number of the tile */
L_INT nRow; | /* top row number of the tile */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves the class object's associated 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
nCol | Left column number of tile.
nRow | Top row number of tile.
pSaveFileOption | 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 supports the LFile::SaveFileTileCallBack virtual function.

This function only works with uncompressed FlashPix files.

Note: More information is available in the SAVEFILEOPTION structure.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

For an example, refer to LFile::LoadTile.


LFile::SetBitmap

#include "ltwrappr.h"

L_VOID LFile::SetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to a bitmap object */

Sets the bitmap object to be used by the file functions.

Parameter | Description
pBitmap | Pointer to the bitmap object to set.

Returns

None

Comments

Before you can use some of the file functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LFile object, the object is considered invalid.

If the filename of the LBitmapBase object is enabled, then the bitmap filename will be transferred to the class object.

For more information, see LFile::IsValid .

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::GetFileName .


LFile::SetFileName

#include "ltwrappr.h"

L_VOID LFile::SetFileName(pFileName)

L_TCHAR L_FAR * pFileName;

/* file name */

Sets the internal file used by the class object for loading and saving images on disk.

Parameter | Description
pFileName | Character string that contains the name of the file used by the class object for loading and saving images on disk.

Returns

None

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.

See Also

Functions:

Class Members

Example

For an example, refer to LFile::GetFileName .


LFile::SetGeoKey

#include "ltwrappr.h"

virtual L_INT LFile::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 LFile::SetGeoKey(uTag, 0, 0, NULL).

To clear all the GeoKeys, call LFile::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.

LFile::SetGeoKey will overwrite any values saved for these tags previously using LFileSettings::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 LFile::SetGeoKey by using LFile::GetGeoKey.

To write the GeoKey data directly to an existing file, call LFile::WriteGeoKey.

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.

See Also

Functions: | LFile::GetGeoKey, LFile::WriteGeoKey, LFile::ReadGeoKey, LFile::EnumGeoKeys, LFile::SaveFile, LFile::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_VOID SetGeoKeyExample(LFile& file)
{
L_UINT16 uProjectCoordinationSystem = 1;
L_INT nRet = file.SetGeoKey(1024,
 TAG_SHORT, 1, &uProjectCoordinationSystem);
if (nRet == SUCCESS)
MessageBox(NULL, TEXT("works Fine!"),
 TEXT("SUCCESS"), MB_OK);
//Every GeoTIFF file I save from now on will contain
 this GeoKey
}


LFile::StartFeedLoad

#include "ltwrappr.h"

virtual L_INT LFile::StartFeedLoad(nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE, pLoadFileOption=NULL)

L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine the behavior of LFile::FeedLoad */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Initializes a file-load process in which you control the input stream. You must call the LFile::FeedLoad function to supply buffered data, and you must call LFile::StopFeedLoad when the loading is complete.

Parameter | Description
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant bitmap
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmap
 | 24 | 24 bits per pixel in the resultant bitmap
 | 32 | 32 bits per pixel in the resultant bitmap
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 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 toolkits.
 | 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 toolkits 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 toolkits only.
uFlags | Binary flags that determine the behavior of LFile::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 multipage file. Use this flag only if you are creating a bitmap list using the LPlayback::Append 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.
pLoadFileOption | 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

This file-load process is useful when receiving transmitted images, such as those on the Internet. It works the same way as the LFile::LoadFile function, except that your code supplies the image data. The file-load process works as follows:

1. | You call the LFile::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 LFile::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 LFile::LoadFile function. It allocates and begins loading the bitmap, according to the flags that you specify in the LFile::StartFeedLoad function. It calls LFile::FeedLoadCallBack callback function if the callback is enabled , 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 the callback function whenever this information is available.
4. | To end the file-load process, you call the LFile::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 toolkits.

This function cannot be used in combination with the Redirect input / output functions.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

typedef struct tagDATA
{
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.
} DATA, L_FAR * LPDATA;

// define user LFile class to override CallBacks

class LUserFile : public LFile
{
private:
DATA Data;

public:
HDC m_hDC ;
public:
LUserFile() ;
virtual ~LUserFile() ;
virtual L_INT FeedLoadCallBack(pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines);

virtual L_INT LoadInfoCallBack(L_INT fd,pLOADINFO pInfo);
virtual L_INT RedirectOpenCallBack(
L_TCHAR L_FAR *pFile,
L_INT nMode,
L_INT nShare);
virtual L_INT RedirectCloseCallBack(L_INT FD);
virtual L_UINT RedirectReadCallBack(
L_INT FD,
L_CHAR L_FAR *pBuf,
L_INT nCount);
virtual L_UINT RedirectWriteCallBack(
L_INT FD,
L_CHAR L_FAR *pBuf,
L_INT nCount);
virtual L_INT32 RedirectSeekCallBack(
L_INT FD,
L_INT32 lnPos,
L_INT nCount);
};

LUserFile::LUserFile()
{
}

LUserFile::~LUserFile()
{
}

L_INT LUserFile::FeedLoadCallBack(pFILEINFO pFileInfo, LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer, L_UINT uFlags,
L_INT nRow, L_INT nLines)
{
pLBitmap->Paint()->SetDC(m_hDC);
pLBitmap->Paint()->PaintDCBuffer( *pLBuffer, nRow);

return SUCCESS ;
}

/* 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 LUserFile::LoadInfoCallBack(L_INT fd,pLOADINFO pInfo)
{
// Set the LOADINFO structure's fields
pInfo->BitsPerPixel = 1;
pInfo->Flags = LOADINFO_TOPLEFT;
pInfo->Format = FILE_FAX_G3_2D;
pInfo->Height = m_pBitmap->GetHeight(); // Value set before we created the file
pInfo->Offset = 0;
pInfo->Width = m_pBitmap->GetWidth(); // Value set before we created the file
return SUCCESS;

}

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

L_INT LUserFile::RedirectOpenCallBack( L_TCHAR L_FAR *pFile,
L_INT nMode, L_INT nShare)
{
Data.pCurData = Data.pData;
Data.dwUsed = 0;
return (5);
}

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

L_INT LUserFile::RedirectCloseCallBack(L_INT FD)
{
Data.pCurData = Data.pData;
Data.dwUsed = 0;
return (TRUE);
}

/* This procedure is a replacement to the built in read procedure.
It reads the data from the allocated memory and adjusts the internal data. */

L_UINT LUserFile::RedirectReadCallBack( L_INT FD,
L_CHAR L_FAR *pBuf, L_INT uCount)
{
// Is the request for more data than is left in memory?
if (uCount + Data.pCurData > Data.pData + Data.dwSize)
uCount = (L_UINT) (Data.dwSize - Data.dwUsed); // adjust request

// Copy data to the buffer of the caller.
memcpy (pBuf, Data.pCurData, uCount);
// Adjust internal data.
Data.pCurData += uCount;
Data.dwUsed += uCount;

return ((L_UINT)uCount);
}

/* 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 LUserFile::RedirectWriteCallBack( L_INT FD,
L_CHAR L_FAR *pBuf, L_INT uCount)
{
return ((L_UINT)uCount);
}

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

L_INT32 LUserFile::RedirectSeekCallBack( L_INT FD,
L_INT32 lnPos, L_INT nCount)
{
switch (nCount)
{
case 0: /* SEEK_SET */
Data.pCurData = Data.pData + lnPos;
Data.dwUsed = lnPos;
break;
case 1: /* SEEK_CUR */
Data.pCurData += lnPos;
Data.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. */
Data.pCurData = Data.pData + Data.dwSize - lnPos;
Data.dwUsed = Data.dwSize - lnPos;
break;
}
return (Data.pCurData - Data.pData);
}

L_VOID TestFunction(HWND hWnd)
{
HFILE hf; // File handle
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
RECT rClientSize; // RECT for the client area
RECT rLeadDest; // Destination rectangle for painting
LBitmapBase LeadBitmap ;
LUserFile userFile ;
L_INT nRet = 0 ;

if (userFile.IsLoadInfoCallBackEnabled() == FALSE)
userFile.EnableLoadInfoCallBack(TRUE);

if (userFile.IsRedirectIOEnabled() == TRUE)
userFile.EnableRedirectIO(TRUE) ;

// 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;

userFile.SetBitmap(&LeadBitmap) ;
userFile.SetFileName(TEXT("image1.cmp")) ;
userFile.EnableCallBack(TRUE) ;

userFile.m_hDC = GetDC(hWnd) ;

// Initialize the file-load process
userFile.StartFeedLoad ( 0, ORDER_BGR,
LOADFILE_ALLOCATE | LOADFILE_STORE, 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;

LBuffer LeadBuffer(cBuf,1024) ;
// Supply image data from cBuf to the file-load process
userFile.FeedLoad ( &LeadBuffer);

// 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);
userFile.StopFeedLoad ();

// Avoid an unnecessary repaint
ValidateRect(hWnd, &rLeadDest);

ReleaseDC( hWnd, userFile.m_hDC);
return;
}


LFile::StopFeedLoad

#include "ltwrappr.h"

virtual L_INT LFile::StopFeedLoad(L_VOID)

Ends a file-load process in which you control the input stream. This cleans up all the variables and buffers allocated by the LFile::StartFeedLoad and LFile::FeedLoad functions and resets all internal variables to their default settings.

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 LFile::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 LFile::StartFeedLoad.

This function cannot be used in combination with the Redirect input / output functions.

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.

See Also

Functions: | Class Members
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 an example, refer to LFile::StartFeedLoad.


LFile::TransformFile

#include "ltwrappr.h"

virtual L_INT LFile::TransformFile(pszFileDst, uTransform, pLoadOptions=NULL)

L_TCHAR * pszFileDst; | /* name of the destination file */
L_UINT uTransform; | /* the transformation to perform */
pLOADFILEOPTION pLoadOptions; | /* pointer to optional extended load options */

Performs a lossless transformation for certain formats. The specified file is the destination file, while the internal file used by the class object is the source file. Currently, only JPEG, CMP and JPEG TIFF formats are supported.

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

This function calls the LFile:TransformFileCallBack, if the callback function has been enabled by calling the LBase::EnableCallBack. The callback function is provided for processing custom markers. (This is useful for rotating JPEG files only.) When transforming JPEG files, LFile::TransformFile 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.

To customize this callback, derive a new class from LFile and override LFile::TransformFileCallBack, providing the needed functionality. (Create the object from the new class.)

The files transformed by this function will be read transformed by other applications capable of reading these file formats.

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 LBitmapBase::Rotate, LBitmapBase::Flip or LBitmapBase::Reverse 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
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: | LFile::LoadFile, LBitmapBase::Rotate, LBitmapBase::Flip, LBitmapBase::Reverse, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Raster Image Functions: Processing an Image

Example

L_VOID TestFunction(L_TCHAR * pszFileSrc, L_TCHAR * pszFileDst)
{
LFile File;

File.SetFileName(pszFileSrc);
File.TransformFile(pszFileDst, FILE_TRANSFORM_ROTATE90);
}


LFile::TransformFileCallBack

#include "ltwrappr.h"

virtual L_INT LFile::TransformFileCallBack (uMarker, uMarkerSize, pMarkerData, uTransform, pfnLEADCallback, pLEADUserData)

L_UINT uMarker; | /* ID of the JPEG marker */
L_UINT uMarkerSize; | /* size of the JPEG marker */
L_UCHAR * pMarkerData; | /* marker data */
L_UINT uTransform; | /* transformation to perform */
LEADMARKERCALLBACK pfnLEADCallback; | /* pointer to a LEAD callback function */
L_VOID * pLEADUserData; | /* pointer to additional parameters for pfnLEADCallback */

Handles the processing of every JPEG marker present in the file transformed by LFile::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.
uTransform | Binary flags that indicate the transform to be performed. These are the same flags passed to the LFIle::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 *. 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 LFile::TransformFile function. The LFile implementation for this callback function simply returns SUCCESS; it does nothing else. Refer to the LFile::TransformFile function for more information.

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 LFile::TransformFileCallBack function. If SUCCESS is returned by the LFile::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.

pfnLEADCallback is a pointer to a callback function that is provided by LEADTOOLS. The code for this function resides entirely within LEADTOOLS; no code for it is provided by the user. The function is used to write the updated marker data to the destination file specified in the LFile::TransformFile function. This is the prototype of the function (named here as FunctionName):

L_INT pEXT_CALLBACK FunctionName(L_UINT uMarker, L_UINT uMarkerSize, L_UCHAR * pMarkerData, L_VOID * pLEADUserData);

where the marker data passed to the function is supposed to be updated. The void pointer pLEADUserData received by LFile::TransformFileCallBack is used to pass required data to the pfnLEADCallback function, so just pass the pointer to it. If successful, the pfnLEADCallback function returns SUCCESS. Otherwise, it returns an error.

If LFile::TransformFileCallBack returns an error code, the transformation is aborted and LFile::TransformFile will return the error code returned by this callback 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.

See Also

Functions

LFile::TransformFile, LEADMARKERCALLBACK, Class Members

Example

#define APP0 0xE0

class UserFile : public LFile
{
virtual L_INT TransformFileCallBack(
L_UINT uMarker,
L_UINT uMarkerSize,
L_UCHAR * pMarkerData,
L_UINT uTransform,
LEADMARKERCALLBACK pfnLEADCallback,
L_VOID * pLEADUserData)
{
// We will transform only the APP0 marker
if (uMarker != APP0)
return SUCCESS;

/* Transform the marker data. Do your transformation here... */

// Write the transformed data
L_INT nRet = pfnLEADCallback(uMarker, uMarkerSize, pMarkerData,
pLEADUserData);

if (nRet != SUCCESS)
return nRet;

// Since we wrote the marker, tell LEADTOOLS not to transform it
return SUCCESS_IGNOREMARKER;
}
};

L_VOID TestFunction(L_TCHAR * pszFileSrc, L_TCHAR * pszFileDst)
{
UserFile File;

File.SetFileName(pszFileSrc);

File.TransformFile(pszFileDst, FILE_TRANSFORM_ROTATE90);
}


LFile::WriteComment

#include "ltwrappr.h"

virtual L_INT LFile::WriteComment(uType, pComments, pSaveFileOption=NULL)

L_UINT uType; | /* type of comment */
LPFILECOMMENTS pComments; | /* pointer to a structure */
pSAVEFILEOPTION pSaveFileOption; | /* 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
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.
pSaveFileOption | 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 you wish to add to the file must be set using LFileSettings::SetComment. Once all comments are set, the comments are saved using any function which saves files, such as LFile::SaveFile or LFile::SaveBitmap when creating a new file, or LFile::WriteComment when changing a comment in an existing file. LFileSettings::SetComment, by itself, does not write a comment to a file, it prepares the values for the next save.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Maintaining File Comments
 | Loading and Saving Images

Example

LFile file;
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 *)(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;
file.SetFileName(TEXT("TEST.FPX"));
file.WriteComment(CMNT_FPXFILMDESCRIPTIONGROUP, &FileComments, NULL);


LFile::WriteFileTransforms

#include "ltwrappr.h"

virtual L_INT LFile::WriteFileTransforms(pTransforms, nFlags=0, pSaveFileOption=NULL)

pFILETRANSFORMS pTransforms; | /* pointer to a transform structure */
L_INT nFlags; | /* flag that indicates how the image will be viewed */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Writes transforms to a FlashPix file.

Parameter | Description
pTransforms | Pointer to a transform structure
nFlags | Flag used to determine how the image will be viewed. If nFlags is set, LFile::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 LFile::WriteFileTransforms so that the entire image falls within the view frame. The translation and scaling are incorporated into the matrix stored with the image.
pSaveFileOption | 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.

See Also

Functions: | LBitmap::HighPassFilter, Class Members
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

Example

For an example, refer to LFile::ReadFileTransforms.


LFile::WriteGeoKey

#include "ltwrappr.h"

virtual L_INT LFile::WriteGeoKey(pSaveOptions)

pSAVEFILEOPTION pSaveOptions;

/* pointer to optional extended save options */

Writes GeoKeys to a file or changes the existing GeoKeys in a file.

Parameter | Description
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 LFile::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 LFile::WriteMetaData 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.

See Also

Functions: | LFile::SetGeoKey, LFile::GetGeoKey, LFile::ReadGeoKey, LFile::EnumGeoKeys, LFile::SaveFile, LFile::SaveBitmap, LFile::WriteMetaData
Topics: | Implementing GeoKeys (GeoTIFF tags)
 | Implementing TIFF Comments and Tags
 | Raster Image Functions: Working with GeoKeys

Example

/* Displays
 a GeoKey in a message box*/
static L_VOID DisplayKey(L_UINT16 uTag,L_UINT16 uType,L_UINT32 uCount,L_VOID
 L_FAR*pData)
{
L_TCHAR s[500];
wsprintf(s, TEXT("Key = %d, Type = %s, Count = %d"),
 uTag,
uType == TAG_ASCII ? TEXT("ASCII") : (uType
 == TAG_SHORT ? TEXT("SHORT") : TEXT("DOUBLE")),uCount);
MessageBox(NULL, s, TEXT("Key Info"), MB_OK);
/* 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*/
if(uType == TAG_ASCII)
MessageBox(NULL, (LPSTR)pData, TEXT("Key
 Value"), MB_OK);
else
{
if(uType == TAG_SHORT)
{
if(uCount == 1)
wsprintf(s,
 TEXT("%d"), *(L_UINT16 L_FAR*)pData);
else
wsprintf(s,
 TEXT("{%d, ...}"), *(L_UINT16 L_FAR*)pData);
}
else
{
if(uCount == 1)
sprintf(s,
 TEXT("%g"), *(L_DOUBLE L_FAR*)pData);
else
sprintf(s,
 TEXT("{%g, ...}"), *(L_DOUBLE L_FAR*)pData);
}
MessageBox(NULL, s, TEXT("Key
 Value"), MB_OK);
}
}

#define FILENAME "C:\\GeoTIFF.tif"
/* This example sets the GTModelTypeGeoKey key (1024), writes it to an
 existing file and reads the key back */
L_VOID WriteGeoKeyExample(LFile& file)
{
/* This example sets the GTModelTypeGeoKey key,
saves a GeoTIFF file and reads the key back */
L_VOID L_FAR*pData;
L_INT nRet;
L_UINT uType;
L_UINT uCount;
L_INT nSize;
L_UINT16 uProjectCoordinationSystem = 95;

file.SetFileName(TEXT(FILENAME));

// set the GTModelTypeGeoKey key
nRet = file.SetGeoKey(1024,
 TAG_SHORT, 1, &uProjectCoordinationSystem);

// write the GeoKey to an existing file
nRet = file.WriteGeoKey(NULL);

if(nRet == SUCCESS)
{
nSize = file.ReadGeoKey(1024,
 &uType, &uCount, NULL, NULL);
if(nSize > 0)
{
pData = malloc(nSize);
if(pData != NULL)
{
/*
 read the GeoKey */
nRet
 = file.ReadGeoKey(1024,
 &uType, &uCount, pData, NULL);
DisplayKey(1024,
 uType, uCount, pData);
free(pData);
}
}
}
return ;
}


LFile::WriteMetaData

#include "ltwrappr.h"

virtual L_INT LFile::WriteMetaData(uFlags, pSaveFileOption)

L_UINT uFlags; | /* type of metadata */
pSAVEFILEOPTION pSaveOption; | /* reserved for future use */

Writes metadata of the specified type to the file specified for this file object.

Parameter | Description
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

LFile::WriteMetaData can be used to update an existing file with comments, tags and/or markers.

Before calling this function, the user should set:

Comments using the LFileSettings::SetComment function.

Tags using the LFileSettings::SetTag function.

Markers using the LMarker::SetAsGlobalMarkers 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::GetGlobalMarkers, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, LFile::WriteComment, LFile::WriteTag, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

L_INT nVal = 1234;
LFile MyFile;
LFileSettings MyFileSettings;
MyFileSettings.SetTag(0x8001, TAG_LONG, 1, &nVal);
MyFileSettings.SetComment(CMNT_SZDESC, (unsigned char *) TEXT("Comment written with WriteMetaData"), 37);
MyFile.SetFileName(TEXT("e:\\i\\1.tif"));
MyFile.WriteMetaData(METADATA_ALL, NULL);


LFile::WriteStamp

#include "ltwrappr.h"

virtual L_INT LFile::WriteStamp(pSaveFileOption=NULL)

pSAVEFILEOPTION pSaveFileOption;

/* pointer to optional extended save options */

Writes a stamp in an existing FlashPix file.

Parameter | Description
pSaveFileOption | 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.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Loading and Saving Stamp Images
 | Loading and Saving Images

Example

For an example, refer to LFile::ReadStamp.


LFile::WriteTag

#include "ltwrappr.h"

virtual L_INT LFile::WriteTag(pSaveOptions)

pSAVEFILEOPTION pSaveOptions;

/* pointer to optional extended save options */

Writes tags to a file or changes existing tags in a file.

Parameter | Description
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 LFileSettings::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
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: | LFile::DeleteTag, LFileSettings::SetTag, LFileSettings::GetTag, SAVEFILEOPTION, LFile::SaveFile, LFile::ReadTag, Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

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;
LFileSettings MyFileSettings;
LFile MyFile;
/* Set the tag data to be saved */
MyFileSettings.SetTag(LogoPosition,
 TagType, TagCount, pTagData);

MyFile.GetDefaultSaveFileOption (&SaveFileOption, sizeof(SAVEFILEOPTION));
SaveFileOption.PageNumber = 1;

MyFile.SetFileName(TEXT("TEST.TIF"));

/* Save the file with the tag. Note that TEST.TIF must exist and contain
 at least one page! */
MyFile.WriteTag(&SaveFileOption);

/* Clear the tag from memory */
MyFileSettings.SetTag(0,
 0, 0, NULL);


LFileSettings::LFileSettings

#include "ltwrappr.h"

L_VOID LFileSettings::LFileSettings(void)

Constructs and initializes the member variables of the LFileSettings object.

Returns

None

Comments

This is the constructor for the LFileSettings class.

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:

LFileSettings::~LFileSettings, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LFileSettings fileSettings;

//…
//…
}


LFileSettings::~LFileSettings

#include "ltwrappr.h"

virtual L_VOID LFileSettings::~LFileSettings(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LFileSettings class.

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:

LFileSettings::LFileSettings, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LFileSettings fileSettings;

//…
}


LFileSettings::GetAutoCADFilesColorScheme

#include "ltwrappr.h"

static L_INT LFileSettings::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 file

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 LFileSettings::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
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: | LFileSettings::SetAutoCADFilesColorScheme, LFileSettings::SetViewMode2D, LFileSettings::GetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewport2D
Topics: | Raster Image Functions: Loading Files
 | Vector Images

Example

For an example, refer to LFileSettings::SetAutoCADFilesColorScheme.


LFileSettings::GetComment

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::SetComment function.

Parameter | Description
uType | The type of comment. For a list of available types, refer to Types of File Comments.
pComment | Pointer to the 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 the 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 LFileSettings::SetComment function to specify the comments to be saved.

The LFileSettings::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 LFile::ReadComment function lets you read comments that are already saved in a file header. For more information refer to the LFileSettings::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.

See Also

Functions: | LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment, LMemoryFile::ReadComment, LFileSettings::GetPCDResolution, LFileSettings::SetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetWMFResolution, LFileSettings::SetExtFileOption, LFileSettings::SetComment
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that use either the LOADFILEOPTION structure or the SAVEFILEOPTION structure, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION Structures.

Example

For an example, refer to LFile::ReadComment.


LFileSettings::GetDefaultJ2KOptions

#include "ltwrappr.h"

static L_INT LFileSettings::GetDefaultJ2KOptions(pOptions, nSize, uStructSize)

pFILEJ2KOPTIONS pOptions; | /* pointer to a structure */
L_INT nSize; | /* size of the 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.
nSize | Size of the structure pointed to by pOptions.
uStructSize | Size of the structure pointed to by pOptions. Use the sizeof() macro to calculate this value.

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.

See Also

Functions: | LFileSettings::GetJ2KOptions, LFileSettings::SetJ2KOptions, Class Members
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
void CDemoView::OnTestGetdefaultj2koptions()
{
FILEJ2KOPTIONS J2KOptions;

// get the default values.
LFileSettings::GetDefaultJ2KOptions(&J2KOptions, sizeof(FILEJ2KOPTIONS));

// make the default values the current values.
// The next time a JPEG2000 file is saved, it will be saved using the default options
LFileSettings::SetJ2KOptions(&J2KOptions);
}


LFileSettings::GetDJVOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::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.

See Also

Functions: | LFileSettings::SetDJVOptions
Topics: | Loading and Saving Images Raster Image Functions: Loading Files

Example

For an example, refer to LFileSettings::SetDJVOptions.


LFileSettings::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:

LAnnContainer::Load

LAnnContainer::LoadOffset

LFile::ReadLoadResolutions

LFile::FileConvert

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::GetInfo

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadFileTransforms

LFile::ReadTag

LFile::ReadStamp

LFile::StartFeedLoad

LFileSettings::GetLoadResolution

LMemoryFile::Decompress

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadComment

LMemoryFile::ReadTag

The following functions now take an optional pSAVEFILEOPTION argument:

LFile::FileConvert

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LMemoryFile::SaveBitmap

LFile::SaveFile

LFile::SaveTile

LFile::SaveOffset

LMemoryFile::StartCompressBuffer

LFile::WriteComment

LFile::WriteStamp

See Also

Functions:

LBaseFile::GetDefaultLoadFileOption, LBaseFile::GetDefaultSaveFileOption


LFileSettings::GetJ2KOptions

#include "ltwrappr.h"

static L_INT LFileSettings::GetJ2KOptions(pOptions, uStructSize)

pFILEJ2KOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Gets the file options used by LEADTOOLS when saving JP2 or J2K files.

Parameter | Description
pOptions | Pointer to a structure to be updated with the options used when saving JP2 or J2K files.
uStructSize | Size of the structure pointed to by pOptions. Use the sizeof() macro to calculate this value.

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.

See Also

Functions: | LFileSettings::SetJ2KOptions, LFileSettings::GetDefaultJ2KOptions, Class Members
Topics: | Raster Image Functions: Saving Files
 | Implementing JPEG 2000 Plug in Features

Example

For an example, refer to LFileSettings::SetJ2KOptions.


LFileSettings::GetJBIG2Options

#include "ltwrappr.h"

static L_INT LFileSettings::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

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: | LFileSettings::SetJBIG2Options
Topics: | Raster Image Functions: Saving Files
 | Loading and Saving Images

Example

For an example, refer to LFileSettings::SetJBIG2Options.


LFileSettings::GetLoadResolution

#include "ltwrappr.h"

static L_INT LFileSettings::GetLoadResolution(nFormat, pWidth, pHeight, pLoadFileOption=NULL)

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 pLoadFileOption; | /* pointer to optional extended load options */

Gets the last values set by the LFileSettings::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.
pLoadFileOption | 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.

See Also

Functions: | LFileSettings::SetLoadResolution, Class Members, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Loading Files
 | Raster Image Functions: Getting and Setting File Information
 | Implementing PhotoCD and FlashPix Features
 | Implementing JBIG Features

Example

L_VOID MyFunction(HWND hWnd)

{

pDIMENSION pDimensions; /* Pointer to the array to be updated */

HGLOBAL hDimensions; /* Handle to the buffer for the array */

L_UINT 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 */

L_TCHAR *pszFileName= TEXT("img0024.pcd");

LFileSettings fileSettings;

/* Count the number of sizes */

LBitmap LeadBitmap;

LeadBitmap.Load(pszFileName, 0, ORDER_RGB);

fileSettings.GetSaveResolution(&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 */

fileSettings.GetSaveResolution(&DimensionCount, pDimensions);

/* 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 */

fileSettings.SetLoadResolution(FILE_PCD, 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 */

fileSettings.GetLoadResolution(FILE_PCD, &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 */

LeadBitmap.Load(pszFileName,0, ORDER_BGR);

/* Update the paint palette to force a repaint */

SendMessage (hWnd, WM_QUERYNEWPALETTE, 0, 0L);

return;

}


LFileSettings::GetPCDResolution

#include "ltwrappr.h"

static L_INT LFileSettings::GetPCDResolution(pszFile, pPCDInfo)

L_TCHAR L_FAR * pszFile; | /* name of the PhotoCD file */
pPCDINFO pPCDInfo; | /* pointer to the LEAD PCDINFO 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

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: | LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment , LFileSettings::SetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetWMFResolution, LFileSettings::SetExtFileOption, LFileSettings::GetComment, LFileSettings::SetComment, Class Members, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that use either the LOADFILEOPTION structure or the SAVEFILEOPTION structure, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION Structures.

Example

L_VOID TestFunction()
{
LBitmap LeadBitmap;
LFileSettings fileSettings;
/* This example checks for a high resolution PCD image and loads it if possible */
PCDINFO PCDinfo; /* PCD information structure */
/* Get the PCD resolution information. (LEADTOOLS does not supply PCD files.) */
fileSettings.GetPCDResolution(TEXT("IMG0024.PCD"), &PCDinfo);
/* Use high resolution if possible */
if (PCDinfo.resolution[L_PCD_4BASE])
{
fileSettings.SetPCDResolution(L_PCD_4BASE);
MessageBox( NULL, TEXT("Loading 1024 x 1536"), TEXT("Notice"), MB_OK );
}
else
{
fileSettings.SetPCDResolution(L_PCD_BASE);
MessageBox( NULL, TEXT("Loading 512 x 768"), TEXT("Notice"), MB_OK );
}

/* Load the bitmap at its own bits per pixel */
LeadBitmap.Load(TEXT("IMG0024.PCD"), 0, ORDER_BGR);
/* Reset the default PCD resolution */
fileSettings.SetPCDResolution(L_PCD_BASE);
}


LFileSettings::GetPDFOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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. Use the sizeof() macro to calculate this value.

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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPDFOptions
Topics: | Raster Image Functions: Loading Files
 | Implementing PDF Plug in Features

Example

For an example, refer to LFileSettings::SetPDFOptions.


LFileSettings::GetPDFSaveOptions

#include "ltwrappr.h"

static L_INT LFileSettings::GetPDFSaveOptions(pOptions, uStructSize)

pFILEPDFSAVEOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the structure */

Retrieves the current PDF saving options.

Parameter | Description
pOptions | Pointer to a structure to be updated with the current PDF saving options.
uStructSize | Size of the structure pointed to by pOptions. Use sizeof(FILEPDFSAVEOPTIONS).

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.

See Also

Functions: | LFileSettings::SetPDFSaveOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing PDF Plug in Features

Example

For an example, refer to LFileSettings::SetPDFSaveOptions.


LFileSettings::GetPLTOptions

#include "ltwrappr.h"

static L_INT LFileSettings::GetPLTOptions(pOptions, uStructSize)

pFILEPLTOPTIONS pOptions; | /* pointer to a structure */
L_UINT uStructSize; | /* size of the 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 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 to use when loading HPGL files, use LFileSettings::SetPLTOptions.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPDFOptions
Topics: | Raster Image Functions: Loading Files

Example

For an example, refer to LFileSettings::SetPLTOptions.


LFileSettings::GetPTKOptions

#include "ltwrappr.h"

static L_INT LFileSettings::GetPTKOptions(pOptions, uStructSize)

pFILEPTKOPTIONS pOptions; | /* pointer to a structure */
L_UINT 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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPTKOptions
Topics: | Raster Image Functions: Loading Files

Example

For an example, refer to LFileSettings::SetPTKOptions.


LFileSettings::GetRTFOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::SetRTFOptions.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPDFOptions
Topics: | Raster Image Functions: Loading Files

Example

For an example, refer to LFileSettings::SetRTFOptions.


LFileSettings::GetSaveResolution

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::SetSaveResolution.

Parameter | Description
puCount | Address of the puCount variable to be updated with the number of resolutions set by LFileSettings::SetSaveResolution.
pResolutions | Pointer to the array of DIMENSION structures to be updated with the physical resolutions set by the last call to LFileSettings::SetSaveResolution. You can pass NULL if you only want to get the number of resolutions.

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 LFileSettings::SetSaveResolution are returned.

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: | Class Members
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 LFileSettings::SetSaveResolution and
// displays them

L_TCHAR szMessage[256]; // MessageBox string
L_UINT uCount; // variable to be updated with the number of resolutions
pDIMENSION pDimensions=NULL;// Pointer to the array to be updated
HGLOBAL hDimensions=NULL; // Handle to the buffer for the array
L_UINT i; // loop variable
LFileSettings FileSet;
L_INT nRet;

// Count the number of dimensions
nRet = FileSet.GetSaveResolution (&uCount, NULL);
if(nRet && (uCount>0))
{
// 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 LFileSettings::SetSaveResolution
nRet = FileSet.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 );
if(hDimensions)
{
// Free the memory that we allocated
GlobalUnlock (hDimensions);
GlobalFree (hDimensions);
}


LFileSettings::GetTag

#include "ltwrappr.h"

static L_INT32 LFileSettings::GetTag(uTag, pType, pCount, pData)

L_UINT16 uTag; | /* tag to identify data in a TIFF file */
L_UINT16 L_FAR * pType; | /* data type of the tagged data */
L_UINT32 L_FAR * pCount; | /* number of data items */
L_VOID L_FAR * pData; | /* pointer to a buffer */

Parameter | Description
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the LFileSettings::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 LFileSettings::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.

See Also

Functions: | LFile::DeleteTag, LFileSettings::SetTag, Class Members
Topics: | Implementing TIFF Comments and Tags

Example

L_VOID TestGetSetTag()
{
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 */

LBitmap LeadBitmap;
LFileSettings fileSettings;

/* Set the tag data to be saved */
fileSettings.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 */
fileSettings.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 */
LeadBitmap.SetFileName(TEXT("Test.tif"));
LeadBitmap.Save(FILE_TIF,
 LeadBitmap.GetBitsPerPixel(), 0, 0);
/* Clear the tag from memory */
fileSettings.SetTag(0,
 0, 0, NULL);
return;
}


LFileSettings::GetTempDirectory

#include "ltwrappr.h"

static L_INT LFileSettings::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

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: | LMemoryFile::SetMemoryThresholds, LMemoryFile::GetMemoryThresholds, LFileSettings::SetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Image Functions: Creating and Deleting Images

Example

L_TCHAR aTempDir[_MAX_PATH];
LFileSettings::GetTempDirectory(aTempDir, sizeof(aTempDir));
MessageBox(NULL, aTempDir, TEXT("Current temporary directory"), MB_OK);


LFileSettings::GetTXTOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::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.

See Also

Functions: | LFileSettings::SetTXTOptions
Topics: | Raster Image Functions: Loading Files
 | Loading and Saving Images

Example

For an example, refer to LFileSettings::SetTXTOptions.


LFileSettings::GetViewMode2D

#include "ltwrappr.h"

static L_INT LFileSettings::GetViewMode2D(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 LFileSettings::SetViewMode2D.

When working with DXF files, you can use the Vector features, available in selected products, or you can use the Main Class Library. If you use the Main Class Library for loading, using the standard loading functions, you can modify the view port and view mode using the following functions:

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D

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
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: | LFileSettings::SetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewport2D, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution
Topics: | Raster Image Functions: Rasterizing Files

Example

void CheckViewportSettings(HWND hWnd)
{
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 = LFileSettings::GetViewMode2D();
LFileSettings::GetViewport2D( &nViewportWidth, &nViewportHeight );

/* format into a message box */
wsprintf( szBuffer,
TEXT("Viewport mode = %d\nWidth = %d\nHeight = %d"),
nViewportMode, nViewportWidth, nViewportHeight );
MessageBox( hWnd, szBuffer, TEXT("Viewport Settings"), 0 );
}


LFileSettings::GetViewport2D

#include "ltwrappr.h"

static L_INT LFileSettings::GetViewport2D(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 LFileSettings::SetViewport2D.

When working with DXF files, you can use the Vector features, available in selected products, or you can use the Main Class Library. If you use the Main Class Library for loading, using the standard loading functions, you can modify the view port and view mode using the following functions:

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D

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
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: | LFileSettings::GetViewMode2D, LFileSettings::SetViewport2D, LFileSettings::SetViewMode2D, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution
Topics: | Raster Image Functions: Rasterizing Files

Example

For an example, refer to LFileSettings::SetViewMode2D.


LFileSettings::GetWMFResolution

#include "ltwrappr.h"

static L_INT LFileSettings::GetWMFResolution(lpResolution)

L_INT L_FAR * lpResolution;

/* address of the variable to be updated */

Gets the current DPI (dots per inch) value that LEADTOOLS uses when loading WMF files.

Parameter | Description
lpResolution | Address of the variable, to be updated with the current value that LEADTOOLS uses for WMF resolution.

Returns

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

Comments

For an explanation of how LEADTOOLS uses the WMF file resolution value, refer to LFileSettings::SetWMFResolution.

Before calling this function, you must declare a variable of data type L_INT. You can then pass the address of the variable in the pResolution parameter.Tthis function will update the variable with the current value that LEADTOOLS uses for WMF resolution.

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: | LFileSettings::~LFileSettings, LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment, LFileSettings::GetPCDResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::SetExtFileOption, LFileSettings::GetComment, LFileSettings::SetComment, Class Members, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that use either the LOADFILEOPTION structure or the SAVEFILEOPTION structure, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION Structures.

Example

L_VOID TestFunction()
{
LFileSettings fileSettings;
L_INT nResolution;

fileSettings.GetWMFResolution(&nResolution);

//…
//…
}


LFileSettings::IgnoreFilters

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::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 LFileSettings::PreLoadFilters take priority over the files specified in LFileSettings::IgnoreFilters. This means that if the filter is present in pszFilters for both methods, then the filter will be loaded and will not be ignored.

Note that LFileSettings::IgnoreFilters has effect only if called prior to loading, saving or getting information about a file. In addition, LFileSettings::PreLoadFilters must be called before LFileSettings::IgnoreFilters for LFileSettings::IgnoreFilters to work properly. 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.

See Also

Functions: | LFileSettings::PreLoadFilters, Class Members
Topics: | Raster Image Functions: Input/Output File Filters, Files To Be Included With Your Application

Example

L_VOID TestFunction()
{
LFileSettings fileSettings;

//Ignore CMP filter
fileSettings.IgnoreFilters(TEXT("CMP"));

//…
}


LFileSettings::PreLoadFilters

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFxyz13W.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 LFileSettings::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 LFileSettings::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.

See Also

Functions: | LFileSettings::IgnoreFilters, Class Members
Topics: | Raster Image Functions: Input/Output File Filters

Example

L_VOID MyFunc()
{
//This example preloads the BMP, PCX, and TIFF filters, and allows 1 filter to be cached, while always keeping 2 loaded.
LFileSettings::PreLoadFilters( 2, 1, TEXT("BMP,PCX,TIF"));

//…
}


LFileSettings::SetAutoCADFilesColorScheme

#include "ltwrappr.h"

static L_INT LFileSettings::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 affects colors number 0 and 7 in the standard AutoCAD color profile. Other colors will not be affected.

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.

See Also

Functions: | LFileSettings::GetAutoCADFilesColorScheme, LFileSettings::SetViewMode2D, LFileSettings::GetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewport2D
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 */
void TestLoad(LBitmap * pLeadBitmap,L_TCHAR L_FAR *pszDXFFileName)
{
L_UINT32 dwFlags;

/* If the current AutoCAD color scheme is not black on white, change it */
LFileSettings::GetAutoCADFilesColorScheme(&dwFlags);
if(dwFlags != AUTOCADFILES_COLORSCHEME_BLACKONWHITE)
LFileSettings::SetAutoCADFilesColorScheme(AUTOCADFILES_COLORSCHEME_BLACKONWHITE);

/* Load the DXF file */
pLeadBitmap->Load(pszDXFFileName, 0, ORDER_BGR, NULL, NULL);
}


LFileSettings::SetComment

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::SetComment function to specify any of the comments that you want to save in a file header.
2. | Use the LFileSettings::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 LFileSettings::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 LFile::ReadComment 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

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: | LFile::ReadCommentOffset, LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment, LMemoryFile::ReadComment, LFileSettings::GetPCDResolution, LFileSettings::SetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetWMFResolution, LFileSettings::GetExtFileOption, LFileSettings::SetExtFileOption, LFileSettings::GetComment, Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LFile::ReadComment.


LFileSettings::SetDJVOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFileSettings::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.

See Also

Functions: | LFileSettings::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,
LBitmap * pBitmap
)

{
FILEDJVOPTIONS DJVOptions;

/* Get the current DJV option */
LFileSettings::GetDJVOptions(&DJVOptions,sizeof(FILEDJVOPTIONS));

/*Change Resolution */
DJVOptions.nResolution = 120;

/* Set new DJV option */
LFileSettings::SetDJVOptions(&DJVOptions);

/* Now load the DJV file */
pBitmap->Load(pszDJVFileName,
0,
ORDER_RGB,
NULL,
NULL );
}


LFileSettings::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:

LAnnContainer::Load

LAnnContainer::LoadOffset

LFile::ReadLoadResolutions

LFile::FileConvert

LFile::GetCompressStamp

LFile::GetCommentSize

LFile::GetInfo

LFile::LoadBitmap

LFile::LoadBitmapList

LFile::LoadFile

LFile::LoadTile

LFile::LoadOffset

LFile::ReadComment

LFile::ReadCommentExt

LFile::ReadFileTransforms

LFile::ReadTag

LFile::ReadStamp

LFile::StartFeedLoad

LFileSettings::GetLoadResolution

LMemoryFile::Decompress

LMemoryFile::GetInfo

LMemoryFile::LoadBitmap

LMemoryFile::LoadMemory

LMemoryFile::ReadComment

LMemoryFile::ReadTag

The following functions now take an optional pSAVEFILEOPTION argument:

LFile::FileConvert

LFile::DeletePage

LFile::WriteFileTransforms

LFile::SaveBitmap

LFile::SaveBitmapList

LMemoryFile::SaveBitmap

LFile::SaveFile

LFile::SaveTile

LFile::SaveOffset

LMemoryFile::StartCompressBuffer

LFile::WriteComment

LFile::WriteStamp

See Also

Functions:

LBaseFile::GetDefaultLoadFileOption, LBaseFile::GetDefaultSaveFileOption


LFileSettings::SetJ2KOptions

#include "ltwrappr.h"

static L_INT LFileSettings::SetJ2KOptions(pOptions)

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

See Also

Functions: | LFileSettings::GetJ2KOptions, LFileSettings::GetDefaultJ2KOptions, Class Members
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
void CDemoView::OnTestSetj2koptions()
{
int nRet;

FILEJ2KOPTIONS J2KOptions;

// Get the current values. Change the
// compression ratio
nRet = LFileSettings::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
LFileSettings::SetJ2KOptions(&J2KOptions);
}


LFileSettings::SetJBIG2Options

#include "ltwrappr.h"

static L_INT LFileSettings::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

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: | LFileSettings::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
void JBIG2OptionsExample()
{
L_INT nRet = FAILURE;
FILEJBIG2OPTIONS JBIG2Options;
// get the current values. I only want to change the
 template
nRet = LFileSettings::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
nRet = LFileSettings::SetJBIG2Options(&JBIG2Options);
}


LFileSettings::SetLoadResolution

#include "ltwrappr.h"

static L_INT LFileSettings::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 LFile::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 LFile::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 LFile::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.

See Also

Functions:

LFileSettings::GetLoadResolution, Class Members, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D

Example

For an example, refer to LFileSettings::GetLoadResolution.


LFileSettings::SetPCDResolution

#include "ltwrappr.h"

static L_INT LFileSettings::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. Possible 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 LFileSettings::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.

See Also

Functions: | LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetWMFResolution, LFileSettings::GetExtFileOption, LFileSettings::SetExtFileOption, LFileSettings::GetComment, LFileSettings::SetComment, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

For a list of functions that use either the LOADFILEOPTION structure or the SAVEFILEOPTION structure, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION Structures.

Example

For an example, refer to LFileSettings::GetPCDResolution.


LFileSettings::SetPDFOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::GetPDFOptions
Topics: | Raster Image Functions: Loading Files
 | Implementing PDF Plug in Features

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, LBitmap * pBitmap,L_INT nDisplayDepth)
{
FILEPDFOPTIONS PdfOptions;

/* Get the current PDF options */
LFileSettings::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 */
LFileSettings::SetPDFOptions(&PdfOptions);

/* Now load the PDF file */
pBitmap->Load( pszPDFFileName,
0,
ORDER_RGB,
NULL,
NULL );
}


LFileSettings::SetPDFSaveOptions

#include "ltwrappr.h"

static L_INT LFileSettings::SetPDFSaveOptions(pOptions)

pFILEPDFSAVEOPTIONS pOptions;

/* pointer to a structure */

Sets the file options used by LEADTOOLS when saving PDF files.

Parameter | Description
pOptions | 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.

Comments

The uStructSize member of the FILEPDFSAVEOPTIONS structure must be set before calling 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.

See Also

Functions: | LFileSettings::GetPDFSaveOptions
Topics: | Raster Image Functions: Saving Files
 | Implementing PDF Plug in Features

Example

void SetPDFSaveOption()
{
FILEPDFSAVEOPTIONS pdfSaveOptions;

LFileSettings::GetPDFSaveOptions( &pdfSaveOptions, sizeof( pdfSaveOptions ) );
if( strlen( (char *)pdfSaveOptions.szOwnerPassword ) > 0 ||
strlen( (char *)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;
}

LFileSettings::SetPDFSaveOptions( &pdfSaveOptions );
}
}


LFileSettings::SetPLTOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPDFOptions
Topics: | Raster Image Functions: Loading Files
 | Using Color Values in LEADTOOLS

Example

/* This example loads a PLT file, with a pen widths and pen colors
defined by the user */
void LoadPLTFile
(
L_TCHAR *pszPLTFileName,
LBitmap* plBitmap,
L_INT *pPenWidths,
COLORREF *pPenColors
)
{
FILEPLTOPTIONS PltOptions;
L_INT nPen;

/* Get the current PLT options */
LFileSettings::GetPLTOptions(&PltOptions, sizeof(PltOptions));

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 */
LFileSettings::SetPLTOptions(&PltOptions);

/* Now load the PLT file */
plBitmap->Load( pszPLTFileName,
0,
ORDER_RGB,
NULL,
NULL );
}


LFileSettings::SetPTKOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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 FILEPTKOPTIONS 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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::GetPTKOptions
Topics: | Raster Image Functions: Loading Files

Example

/* This example loads a PTK file, with a resolution
defined by the user */
void LoadPTKFile
(
L_TCHAR * pszPTKFileName,
LBitmap * pBitmap,
L_INT nDisplayDepth
)

{
FILEPTKOPTIONS PtkOptions;

/* Get the current PTK option */
LFileSettings::GetPTKOptions(&PtkOptions,sizeof(FILEPTKOPTIONS));

/*Change Resolution */
PtkOptions. nPTKResolution = 120;

/* Set new PTK option */
LFileSettings::SetPTKOptions(&PtkOptions);

/* Now load the PTK file */
pBitmap->Load(pszPTKFileName,
0,
ORDER_RGB,
NULL,
NULL );
}


LFileSettings::SetRTFOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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.

For a list of functions that utilize the LOADFILEOPTION or SAVEFILEOPTION structures, refer to Functions Utilizing the LOADFILEOPTION or SAVEFILEOPTION structures.

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.

See Also

Functions: | LFileSettings::SetPDFOptions
Topics: | Raster Image Functions: Loading Files

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,
LBitmap * plBitmap,
L_DOUBLE dTopMarg,
L_DOUBLE dBottomMarg,
L_DOUBLE dLeftMarg,
L_DOUBLE dRightMarg
)
{
FILERTFOPTIONS RtfOptions;

/* Get the current RTF options */
LFileSettings::GetRTFOptions(&RtfOptions,sizeof(FILERTFOPTIONS));

/*Change margin values */
RtfOptions.dTopMarg = dTopMarg;
RtfOptions.dBottomMarg = dBottomMarg;
RtfOptions.dLeftMarg = dLeftMarg;
RtfOptions.dRightMarg = dRightMarg;

/* Set new RTF options */
LFileSettings::SetRTFOptions(&RtfOptions);

/* Now load the RTF file */
plBitmap->Load( pszRTFFileName,
0,
ORDER_RGB,
NULL,
NULL );
}


LFileSettings::SetSaveResolution

#include "ltwrappr.h"

static L_INT LFileSettings::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

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: | Class Members
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
LFileSettings FileSet;
pDIMENSION pRes;
HGLOBAL hRes;
int nRet;
int x;

hRes = GlobalAlloc(GMEM_MOVEABLE, sizeof(DIMENSION)* 4);
pRes = (pDIMENSION)GlobalLock( hRes );
/* store four resolution layers */
for(x=0;x<4;x++)
{
pRes[x].nWidth = (int)(1600/(x+1));
pRes[x].nHeight = (int)( 800/(x+1));
}
nRet = FileSet.SetSaveResolution(4, pRes);

GlobalUnlock (hRes);
GlobalFree (hRes);


LFileSettings::SetTag

#include "ltwrappr.h"

static L_INT LFileSettings::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:

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 LFileSettings::SetTag) or indirectly (by calling LAnnContainer::SaveTag). 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 LFileSettings::SetTag(uTag, 0, 0, NULL). LFileSettings::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.

See Also

Functions: | LFile::DeleteTag, LFileSettings::GetTag
Topics: | Implementing TIFF Comments and Tags

Example

For an example, refer to LFileSettings::GetTag.


LFileSettings::SetTempDirectory

#include "ltwrappr.h"

static L_INT LFileSettings::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.

Returns

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

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

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: | LMemoryFile::SetMemoryThresholds, LMemoryFile::GetMemoryThresholds, LFileSettings::GetTempDirectory
Topics: | Memory Storage Types for Bitmaps
 | Image Functions: Creating and Deleting Images

Example

/* Set the current directry to c:\temp */
LFileSettings::SetTempDirectory(TEXT("c:\\temp"));


LFileSettings::SetTXTOptions

#include "ltwrappr.h"

static L_INT LFileSettings::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.

See Also

Functions: | LFileSettings::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, LFile* pLeadFile, L_DOUBLE dTopMarg,
 L_DOUBLE dBottomMarg, L_DOUBLE dLeftMarg, L_DOUBLE dRightMarg)
{
L_INT nRet = FAILURE;
FILETXTOPTIONS TxtOptions;
/* Get the current TXT options */
nRet = LFileSettings::GetTXTOptions(&TxtOptions,sizeof(FILETXTOPTIONS));
/*Change margin values */
TxtOptions.uStructSize = sizeof(TxtOptions);
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 */
nRet = LFileSettings::SetTXTOptions(&TxtOptions);
/* Now load the TXT file */
pLeadFile->SetFileName(pszTXTFileName);
nRet = pLeadFile->LoadBitmap( );
}


LFileSettings::SetViewMode2D

#include "ltwrappr.h"

static L_INT LFileSettings::SetViewMode2D(nViewMode)

L_INT nViewMode;

/* viewport mode */

Sets the current viewport mode used when loading 3D file formats.

Parameter | Description
nViewMode | 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 up to which the drawing can be rendered) with LFileSettings::SetViewport2D . How the drawing is to be rendered inside this viewport depends on the current viewport mode set with LFileSettings::SetViewMode2D. Default viewport size is 640x480 pixels.

When working with DXF files, you can use the Vector features, available in selected products, or you can use the Main Class Library. If you use the Main Class Library for loading, using the standard loading functions, you can modify the view port and view mode using the following functions:

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D

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
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: | LFileSettings::GetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewport2D, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution
Topics: | Raster Image Functions: Rasterizing Files

Example

void SetViewportSettings( HWND hWnd )
{
/* Set viewport mode to L2D_USE_WIDTH_AND_HEIGHT */
LFileSettings::SetViewMode2D( L2D_USE_WIDTH_HEIGHT );

/* Set viewport size to 400*400 pixels */
LFileSettings::SetViewport2D( 400, 400 );
}


LFileSettings::SetViewport2D

#include "ltwrappr.h"

static L_INT LFileSettings::SetViewport2D(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 up to which the drawing can be rendered) with LFileSettings::SetViewport2D. How the drawing is to be rendered inside this viewport depends on the current viewport mode set with LFileSettings::SetViewMode2D. Default viewport size is 640x480 pixels.

When working with DXF files, you can use the Vector features, available in selected products, or you can use the Main Class Library. If you use the Main Class Library for loading, using the standard loading functions, you can modify the view port and view mode using the following functions:

LFileSettings::GetViewMode2D

LFileSettings::SetViewMode2D

LFileSettings::GetViewport2D

LFileSettings::SetViewport2D

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
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: | LFileSettings::GetViewMode2D, LFileSettings::GetViewport2D, LFileSettings::SetViewMode2D, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution
Topics: | Raster Image Functions: Rasterizing Files

Example

For an example, refer to LFileSettings::SetViewMode2D.


LFileSettings::SetWMFResolution

#include "ltwrappr.h"

static L_INT LFileSettings::SetWMFResolution(nResolution)

L_INT nResolution;

/* resolution value */

Sets the DPI (dots per inch) value that LEADTOOLS uses when loading WMF files.

Parameter | Description
nResolution | The 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 value that this function sets is valid for the current thread, and you can change the value 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 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 LFileSettings::GetWMFResolution
 and LFileSettings::SetWMFResolution,
 along with the LFile::GetInfo
 or LMemoryFile::GetInfo
 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 LFileSettings::SetWMFResolution with nResolution set to 0.
2. | Call LFile::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 LFileSettings::SetWMFResolution with nResolution set to 0.
2. | Call LFile::GetInfo, 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 Width field is D, the calculation is as follows: A = B * C / D.
4. | Call LFileSettings::SetWMFResolution to set the desired resolution.
5. | Call LFile::LoadBitmap to load the file.

Some WMF files contain viewport information, which requires a device context of a particular size. LEADTOOLS always loads these files using the resolution specified in the file. In this case, the value specified by LFileSettings::SetWMFResolution has no effect.

Note: | When saving WMF files, LEADTOOLS saves the current resolution value in the file.
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.

See Also

Functions: | LFile::GetInfo, LMemoryFile::GetInfo, LFile::ReadComment, LFileSettings::GetPCDResolution, LFileSettings::SetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::GetExtFileOption, LFileSettings:SetExtFileOption, LFileSettings::GetComment, LFileSettings::SetComment, Class Members, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

L_VOID TestFunction()
{
//…

LFileSettings fileSettings;
fileSettings.SetWMFResolution(150);
}


LImageListControl::LImageListControl

#include "ltwrappr.h"

L_VOID LImageListControl::LImageListControl(L_VOID)

L_VOID LImageListControl::LImageListControl(hWndParent, nID, dwStyle=WS_CHILD|WS_VISIBLE|WS_BORDER, x=0, y=0, nCx=200, nCy=200, cbBackground=RGB(128,128,128))

HWND hWndParent; | /* handle to the parent window */
L_INT nID; | /* control’s id */
DWORD dwStyle; | /* the control’s style */
L_INT x; | /* x position */
L_INT y; | /* y position */
L_INT nCx; | /* width of the control window */
L_INT nCy; | /* height of the control window */
COLORREF crBackground | /* background color */

Constructs and initializes the member variables of an LImageListControl object.

Parameter | Description
hWndParent | Handle of the parent window.
nID | The control’s ID.
dwStyle | Specifies the control's style, for example WS_VISIBLE, WS_BORDER, or WS_CHILD. For more information on Windows styles, refer to your compiler’s help file.
x | The starting x position.
y | The starting y position.
nCx | The width of the bitmap window.
nCy | The height of the bitmap window.
crBackground | The background color of the control.

Returns

None

Comments

LImageListControl::LImageListControl() is the default constructor for the LImageListControl class.

LImageListControl::LImageListControl(hWndParent, nID, dwStyle, x, y, nCX, nCY, crBackground) creates the image list control using the specified options. This will fill in the m_hWnd data member with the handle to the new control window.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::~LImageListControl, Class Members
Topics: | Using Color Values in LEADTOOLS

Example

This is an example for LImageListControl::LImageListControl():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LImageListControl MyLImageListControl;

//…
}

This is an example for LImageListControl::LImageListControl(hWndParent, nID, dwStyle, x, y, nCX, nCY, crBackground):

L_VOID MyFunction(HWND hParentWnd)
{
// this will call the constructor and will initialize the image list control with the specified parameters.

/*initialize hParentWnd with the handle of the parent window*/
LImageListControl MyLImageListControl(hParentWnd,15,WS_VISIBLE,0,0,100,100);

//…
}


LImageListControl::~LImageListControl

#include "ltwrappr.h"

L_VOID LImageListControl::~LImageListControl(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LImageListControl class.

Required DLLs and Libraries

LTDIS
LTFIL
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:

LImageListControl::LImageListControl, Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LImageListControl MyLImageListControl;

//…
}


LImageListControl::Clear

#include "ltwrappr.h"

L_INT LImageListControl::Clear(L_VOID)

Clears all items from the ImageList Control.

Returns

None

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// clear all items
m_ImgList.Clear();


LImageListControl::CreateControl

#include "ltwrappr.h"

HWND LImageListControl::CreateControl(hWndParent, nID=0,
 dwStyle=WS_CHILD|WS_TABSTOP|WS_VISIBLE|WS_BORDER,
 x=0, y=0,
 nCx=200, nCy=200,
 crBackground=RGB(128,128,128))

HWND hWndParent; | /* handle of the parent window */
L_INT nID; | /* control’s ID */
L_UINT32 dwStyle; | /* control’s style */
L_INT x; | /* x coordinate for the window origin */
L_INT y; | /* y coordinate for the window origin */
L_INT nCx; | /* window width */
L_INT nCy; | /* window height */
COLORREF crBack; | /* background color of control */

Creates the image list control using the specified parameters.

Parameter | Description
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.
dwStyle | Specifies the control's style, for example WS_VISIBLE, WS_BORDER, or WS_CHILD. For more information on Windows styles, refer to your compiler’s help file.
x | X coordinate for the origin of the ImageList Control window.
y | Y coordinate for the origin for the ImageList Control window.
nCx | The width of the ImageList Control window.
nCy | The height for the ImageList Control window.
crBackground | The background color for the ImageList Control window.

Returns

!= NULL | The function was successful and the return value is the window handle for the created control.
NULL | An error occurred, and the control could not be created. Refer to Return Codes.

Comments

This function causes the class object to create the control window using the specified parameters.

This will fill in the m_hWnd data member with the handle to the new window.

If you call this function for a class object that already has a created window, the function will simply return m_hWnd.

You can destroy the ImageListControl window using the Windows function DestroyWindow.

NOTE: The window is created with the WS_EX_CLIENTEDGE style by default. To change this, you can use the Windows function SetWindowLong. For a list of available styles, refer to LTIMAGELISTCLASS Registered Class: Styles.

The ImageListControl window will send command notification messages to its parent window. For a table of the available command notifications, refer to ImageList Control Command Notifications.

The ImageList Control's parent window will receive these notifications in the form of a WM_COMMAND message.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | ImageList Control Command Notifications, Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

LImageListControl m_ImgList;

void CreateImgListControl(HWND hParent)
{
HWND hCtl = NULL;
hCtl = m_ImgList.CreateControl(hParent,
 0);
if(!::IsWindow(hCtl))
AfxMessageBox(TEXT("Failed to
 create control!"));
}


LImageListControl::DrawItem

#include "ltwrappr.h"

L_INT LImageListControl::DrawItem (pDrawItem)

pLILDRAWITEM pDrawItem;

/* pointer to structure */

Gets the specified item from the ImageList Control.

Parameter | Description
pDrawItem | Pointer to an LILDRAWITEM structure that contains information about the item to be painted.

Returns

ERROR_USER_ABORT | The ImageListControl will not perform any further painting on the current item.
<> ERROR_USER_ABORT | Returning any other value will cause the ImageListControl to paint the current item normally.

Comments

This function gets called whenever an item in the image list needs to be painted/repainted, such as when the item is first drawn, when part of it is covered by a window, or when its selection state changes. The function is passed a pointer to an LILDRAWITEM structure which contains information about the item. The passed information is necessary to paint the item.

The LImageListControl version of this function simply returns SUCCESS, which is not ERROR_USER_ABORT, and so the ImageList control paints the items normally. In order to customize the function, derive a new class from LImageListControl and override LImageListControl::DrawItem, adding the necessary code for drawing the items. (Create the object from the new class.) The overriding version should return ERROR_USER_ABORT so that the ImageList control doesn’t perform any further painting for the current item.

NOTE: This function will be called as described above only if the ImageList control has the L_ILS_OWNERDRAWITEM style. In other words, in order to make the control an owner-drawn one, use that style. The style can be assigned to the control when it is first created (using LImageListControl::CreateControl) or after it has been created (using SetWindowLong). For a list of available styles, refer to LTIMAGELISTCLASS Registered Class: Styles.

NOTE: Before returning from the function, ensure that the device context identified by the hDC member of the LILDRAWITEM structure has been returned to the state in which it was received.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

The following example creates a new class derived from LImageListControl and overrides the LImageListControl::DrawItem function to draw the items of an image list in its own way.

class LUserImageListControl : public LImageListControl
{
virtual L_INT DrawItem(pLILDRAWITEM pDrawItem)
{
if (!pDrawItem)
return SUCCESS;

if (!pDrawItem->pItem)
return SUCCESS;

LBitmapBase Bitmap;
HRGN hRgn;
RECT rcImage, rcText;

CopyRect(&rcImage, &pDrawItem->rcItem);
rcImage.bottom = rcImage.top
+ 3 * (rcImage.bottom - rcImage.top) / 4;
SubtractRect(&rcText, &pDrawItem->rcItem, &rcImage);
InflateRect(&rcImage, -1, -1);

hRgn = CreateEllipticRgn(rcImage.left, rcImage.top,
rcImage.right, rcImage.bottom);

SaveDC(pDrawItem->hDC);

if (pDrawItem->pItem->bSelected)
{
SelectObject(pDrawItem->hDC,
(HBRUSH) GetStockObject(WHITE_BRUSH));
SetTextColor(pDrawItem->hDC, RGB(0, 0, 0));
}
else
{
SelectObject(pDrawItem->hDC,
(HBRUSH) GetStockObject(BLACK_BRUSH));
SetTextColor(pDrawItem->hDC, RGB(255, 255, 255));
}

Rectangle(pDrawItem->hDC, pDrawItem->rcItemBack.left,
pDrawItem->rcItemBack.top,
pDrawItem->rcItemBack.right,
pDrawItem->rcItemBack.bottom);

SetBkMode(pDrawItem->hDC, TRANSPARENT);
if (pDrawItem->pItem->pText && lstrlen(pDrawItem->pItem->pText))
DrawText(pDrawItem->hDC, pDrawItem->pItem->pText,
lstrlen(pDrawItem->pItem->pText), &rcText,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);

SelectObject(pDrawItem->hDC, hRgn);
Bitmap.SetHandle(pDrawItem->pItem->pBitmap);
Bitmap.SetSrcRect(NULL);
Bitmap.SetClipSrcRect(NULL);
Bitmap.SetDstRect(&rcImage);
Bitmap.SetClipDstRect(NULL);
Bitmap.Paint()->SetDC(pDrawItem->hDC);
Bitmap.Paint()->PaintDC();

MoveMemory(pDrawItem->pItem->pBitmap, Bitmap.GetHandle(),
sizeof(BITMAPHANDLE));
Bitmap.SetHandle(NULL, FALSE);

RestoreDC(pDrawItem->hDC, -1);
DeleteObject(hRgn);

return ERROR_USER_ABORT;
}
};


LImageListControl::EnableKeyboard

#include "ltwrappr.h"

L_BOOL LImageListControl::EnableKeyboard(bEnable)

BOOL bEnable;

/* flag that indicates whether or not to enable the keyboard */

Enables or disables the ImageList control's automatic processing of the keyboard.

Parameter | Description
bEnable | Flag that indicates whether or not to enable automatic processing of the keyboard. Possible values are:
 | Value | Meaning
 | TRUE | ImageList Control will process the keyboard.
 | FALSE | ImageList Control will not process the keyboard.

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// disable auto keyboard processing
m_ImgList.EnableKeyboard(FALSE);


LImageListControl::EnsureVisible

#include "ltwrappr.h"

L_BOOL LImageListControl::EnsureVisible(nIndex)

L_INT nIndex;

/* index of the item to which to scroll */

Scrolls the image list to make the specified item visible.

Parameter | Description
nIndex | 0-based index that indicates the item to which to scroll.

Returns

<>0 | The number of rows/columns scrolled to make the specified item visible.
0 | Did not scroll OR an error occurred.

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::Insert.


LImageListControl::ExportBitmapList

#include "ltwrappr.h"

L_INT LImageListControl::ExportBitmapList(pExportList)

pLILEXPORTBITMAPLIST pExportList;

/* pointer to structure */

Exports a number of bitmaps from the ImageList Control to a Bitmap List.

Parameter | Description
pExportList | Pointer to the LILEXPORTBITMAPLIST structure that contains the list of bitmaps to be exported.

Returns

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

Comments

You must set the uStructSize member of the LILEXPORTBITMAPLIST structure before using this function.

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.

Required DLLs and Libraries

LTDISLTFILLTIMG

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: | LImageListControl::ImportBitmapList, LImageListControl::GetItemOptions, LImageListControl::SetItemOptions
Topics: | Using the ImageList Control
 | Raster Image Functions: Displaying Images

Example

L_VOID TestExportList(HWND hWnd, LBitmapList& BitmapList,
 LImageListControl& ImgList)
{
L_INT nRet ;
LILEXPORTBITMAPLIST ExportList;

// Check if the ImageList control has any images.
nRet = ImgList.GetItemCount() ;
if( nRet > 0)
{
ZeroMemory(&ExportList, sizeof(LILEXPORTBITMAPLIST));
ExportList.uStructSize = sizeof(LILEXPORTBITMAPLIST);
ExportList.nStartIndex = 0; // Start
 from index 1
ExportList.nItemsToExport = 1; // Export
 only 2 images.

// Export images
nRet = ImgList.ExportBitmapList(&ExportList)
 ;

// Check if the images exported successfully
if(ExportList.hList)
{
// Save the exported
 images to a disk-file
nRet = BitmapList.Save(TEXT("C:\\outputfile.gif"),
 FILE_GIF, 0, 2, NULL);
}
}
}


LImageListControl::GetBackColor

#include "ltwrappr.h"

L_INT LImageListControl::GetBackColor(pcrBack)

COLORREF L_FAR * pcrBack;

/* pointer to variable to be updated */

Gets the current ImageList Control’s background color.

Parameter | Description
pcrBack | Pointer to a variable to be updated with the background color of the control.

Returns

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

Comments

Before using this function, you must allocate a variable of type COLORREF and pass the address of this variable in pcrBack.

The variable pointed to by pcrBack will be updated with the ImageList Control's current background color.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

LImageListControl m_ImgList;

// set back color to RED
COLORREF crTest;
m_ImgList.GetBackColor(&crTest);
if(crTest != RGB(255,0,0))
{
m_ImgList.SetBackColor(RGB(255,0,0));
::RedrawWindow(m_ImgList.m_hWnd, NULL, NULL, RDW_INVALIDATE);
}


LImageListControl::GetBorderColor

#include "ltwrappr.h"

L_INT LImageListControl::GetBorderColor(pcrBorder)

COLORREF L_FAR * pcrBorder;

/* pointer to variable to be updated */

Gets the current ImageList Control’s border color.

Parameter | Description
pcrBorder | Pointer to a variable to be updated with the border color of the control.

Returns

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

Comments

Before using this function, you must allocate a variable of type COLORREF and pass the address of this variable in pcrBorder.

The variable pointed to by pcrBorder will be updated with the ImageList Control's current border color.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

LImageListControl m_ImgList;

// set border color to GREEN
COLORREF crTest;
m_ImgList.GetBorderColor(&crTest);
if(crTest != RGB(0,255,0))
{
m_ImgList.SetBorderColor(RGB(0,255,0));
::RedrawWindow(m_ImgList.m_hWnd, NULL, NULL, RDW_INVALIDATE);
}


LImageListControl::GetColumnCount

#include "ltwrappr.h"

L_INT LImageListControl::GetColumnCount(L_VOID)

Gets the current number of item columns in the ImageList Control.

Returns

>= 0 | The number of item columns.
<0 | An error occurred. Refer to Return Codes.

Comments

This message will return the total number of item columns in the ImageList Control.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::GetRowCount.


LImageListControl::GetFirstVisible

#include "ltwrappr.h"

L_INT LImageListControl::GetFirstVisible (L_VOID)

Gets the index of the first visible item in the ImageList Control. This item is the one at the upper left corner of the control's view.

Returns

>= 0 | The zero-based index of the first visible item.
< 0 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

L_INT GetLastVisible(LImageListControl & ImageList)
{
L_INT nViewSize, nFirstVisible, nLastVisible;
L_INT nColsOrRowsCount, nItemsCount;

nViewSize = ImageList.GetViewSize();
nFirstVisible = ImageList.GetFirstVisible();

if (ImageList.GetScrollStyle() == SCROLLSTYLE_VERTICAL)
nColsOrRowsCount = ImageList.GetColumnCount();
else
nColsOrRowsCount = ImageList.GetRowCount();

nLastVisible = nFirstVisible + (nViewSize * nColsOrRowsCount) - 1;

nItemsCount = ImageList.GetItemCount();

if (nLastVisible > nItemsCount - 1)
nLastVisible = nItemsCount - 1;

return nLastVisible;
}


LImageListControl::GetItem

#include "ltwrappr.h"

L_INT LImageListControl::GetItem (pItem, nIndex)

pLILITEM pItem; | /* pointer to structure to be filled with the specified item */
L_INT nIndex; | /* index of the item to get */

Gets the specified item from the ImageList Control.

Parameter | Description
pItem | Pointer to an LILITEM structure to be filled with the specified item.
nIndex | 0-based index of the item to get.

Returns

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

Comments

The LILITEM structure pointed to by pItem 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.

After this function returns, the LILITEM structure pointed to by pItem 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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::Update.


LImageListControl::GetItemCount

#include "ltwrappr.h"

L_INT LImageListControl::GetItemCount (L_VOID)

Gets the current number of items in the ImageList Control.

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::Insert.


LImageListControl::GetItemOptions

#include "ltwrappr.h"

L_INT LImageListControl::GetItemOptions(pItemOptions)

pLILITEMOPTION pItemOptions;

/* pointer to structure to be filled with the options */

Gets the current ImageList Control item display options.

Parameter | Description
pItemOptions | Pointer to an LILITEMOPTIONstructure that will be filled with the current ImageList Control item display options.

Returns

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

Comments

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

LILITEMOPTION ItemOpt;
// get current options
m_ImgList.GetItemOptions(&ItemOpt);

// set some options
if(ItemOpt.crBackground != RGB(0,0,0))
ItemOpt.crBackground = RGB(0,0,0);
if(!ItemOpt.bDisplayItemText)
ItemOpt.bDisplayItemText = TRUE;
m_ImgList.SetItemOptions(&ItemOpt);


LImageListControl::GetRowCount

#include "ltwrappr.h"

L_INT LImageListControl::GetRowCount(L_VOID)

Gets the current number of item rows in the ImageList Control.

Returns

>= 0 | The number of item rows.
<0 | An error occurred. Refer to Return Codes.

Comments

This message will return the total number of item rows in the ImageList Control.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// get the current rows/columns
L_INT nRows, nCols;
nRows = m_ImgList.GetRowCount();
nCols = m_ImgList.GetColumnCount();

CString csOut;
csOut.Format(TEXT("Rows: %ld\nCols: %ld"), nRows, nCols);
AfxMessageBox(csOut);


LImageListControl::GetScrollStyle

#include "ltwrappr.h"

L_INT LImageListControl::GetScrollStyle(L_VOID)

Gets the current ImageList Control scroll style.

Returns

The current scroll style. Possible values are:

Value | Meaning
SCROLLSTYLE_VERTICAL | [0] scrolling vertically
SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontal

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// set for Horz. Scrolling
if(m_ImgList.GetScrollStyle() != SCROLLSTYLE_HORIZONTAL)
{
m_ImgList.SetScrollStyle(SCROLLSTYLE_HORIZONTAL);
::RedrawWindow(m_ImgList.m_hWnd, NULL, NULL, RDW_INVALIDATE);
}


LImageListControl::GetSelectCount

#include "ltwrappr.h"

L_INT LImageListControl::GetSelectCount(L_VOID)

Gets the current number of selected items in the ImageList Control.

Returns

>= 0 | The number of selected items.
<0 | An error occurred. Refer to Return Codes.

Comments

Call this function, before calling LImageListControl::GetSelectedItems, to get the number of selected items. You can then use this number for allocating storage for the LILITEM structures.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

L_INT nCount;

// get selected count
nCount = m_ImgList.GetSelectCount();

if(nCount>0)
{
pLILITEM pItems=NULL;
pItems = (pLILITEM)GlobalAlloc(GMEM_MOVEABLE, sizeof(LILITEM)*nCount);
pItems->uStructSize = sizeof(LILITEM);
pItems->uBitmapStructSize = sizeof(BITMAPHANDLE);

if(pItems)
{
// get the selected items
m_ImgList.GetSelectedItems(pItems);

int x;
CString csOut;
csOut.Format(TEXT("%ld items selected!"), nCount);
AfxMessageBox(csOut);
for(x=0; x<nCount; x++)
{
csOut.Format(TEXT("Item#%ld with text=%s"), pItems[x].lIndex, pItems[x].pText);
AfxMessageBox(csOut);
}
GlobalFree(pItems);
}
}


LImageListControl::GetSelectedItems

#include "ltwrappr.h"

L_INT LImageListControl::GetSelectedItems(pItems=NULL)

pLILITEM pItems;

pointer to a structure to be filled with the selected items */

Gets the currently selected items in the ImageList Control.

Parameter | Description
pItems | Pointer to a caller-allocated array of LILITEM structures to be filled with the selected items.

Returns

>= 0 | The number of selected items.
< 0 | An error occurred. Refer to Return Codes.

Comments

The return value is the number of items pointed to by pItems.

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 pItems, the function will simply return the current number of selected items.

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::GetSelectCount.


LImageListControl::GetSelectionOptions

#include "ltwrappr.h"

L_INT LImageListControl::GetSelectionOptions(pSelOptions)

pLILSELOPTION pSelOptions;

/* pointer to a structure to be filled with the selection options */

Gets the current ImageList Control selection options.

Parameter | Description
pSelOptions | Pointer to an LILSELOPTION structure that will be filled with the current ImageList Control selection options.

Returns

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

LILSELOPTION SelOpt;
// get current options
m_ImgList.GetSelectionOptions(&SelOpt);
// set some options
if(SelOpt.uAllowSelection != ALLOWSELECTION_SINGLE)
SelOpt.uAllowSelection = ALLOWSELECTION_SINGLE;
if(SelOpt.uSelectionStyle != SELECTIONSTYLE_PRESSEDBUTTON)
SelOpt.uSelectionStyle = SELECTIONSTYLE_PRESSEDBUTTON;
m_ImgList.SetSelectionOptions(&SelOpt);


LImageListControl::GetViewSize

#include "ltwrappr.h"

L_INT LImageListControl::GetViewSize (L_VOID)

Gets the view size of the ImageList Control.

Returns

>= 0 | The number of rows or columns of items that can be viewed.
< 0 | An error occurred. Refer to Return Codes.

Comments

The view size returned by the function is expressed in terms of rows or columns of items; it represents the number of rows or columns, or partial rows or columns) that can be viewed within the ImageList control.

Whether the returned view size is expressed in terms of rows or columns depends on the current scroll style of the ImageList control (see LImageListControl::SetScrollStyle). If the scroll style is set to SCROLLSTYLE_VERTICAL, then the size is expressed in terms of rows. If it is set to SCROLLSTYLE_HORIZONTAL, then the size is expressed in terms of columns.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::GetFirstVisible, Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::GetFirstVisible.


LImageListControl::HitTest

#include "ltwrappr.h"

L_INT LImageListControl::HitTest(pPoint)

POINT L_FAR * pPoint;

/* coordinate to test */

Queries the ImageList Control for the index of the item at the specified location.

Parameter | Description
pPoint | Pointer to a POINT structure containing the location to test.

Returns

>=0 | The index of the item at the specified location.
< SUCCESS | An error occurred. Refer to Return Codes.

Comments

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::MsgProcCallBack.


LImageListControl::ImportBitmapList

#include "ltwrappr.h"

L_INT LImageListControl::ImportBitmapList(pImportList)

pLILIMPORTBITMAPLIST pImportList;

/* pointer to structure */

Inserts a list of bitmaps into the ImageList Control.

Parameter | Description
pImportList | Pointer to the LILIMPORTBITMAPLIST structure that contains the list of bitmaps to be inserted.

Returns

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

Comments

You must set the uStructSize member of the LILIMPORTBITMAPLIST structure before using this function.

The list of bitmaps found in the passed LILIMPORTBITMAPLIST structure 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.

Required DLLs and Libraries

LTDISLTFILLTIMG

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: | LImageListControl::ExportBitmapList, LImageListControl::GetItemOptions, LImageListControl::SetItemOptions
Topics: | Using the ImageList Control
 | Raster Image Functions: Displaying Images

Example

L_VOID TestImportList(HWND hWnd, LBitmapList& BitmapList,
 LImageListControl& ImgList)
{
L_INT nRet ;
if(IsWindow(hWnd) && BitmapList.GetHandle())
{
LILIMPORTBITMAPLIST ImportList;
HWND handle = ImgList.CreateControl(hWnd,
 0) ;

// Getting the number of bitmaps in
 the list.

if(BitmapList.GetItemsCount() >
 0) // There are some bitmaps
{
ZeroMemory(&ImportList,
 sizeof(LILIMPORTBITMAPLIST));
ImportList.uStructSize
 = sizeof(LILIMPORTBITMAPLIST);
ImportList.hList
 = BitmapList.GetHandle() ;
ImportList.nStartIndex
 = 0; // Start from Index 0.
ImportList.nItemsToInsert
 = BitmapList.GetItemsCount();// Import all the list bitmaps.
ImportList.pText
 = _T("Imported Bitmap-Text");
ImportList.pTextExt
 = _T("Imported Bitmap-TextExt");

nRet = ImgList.ImportBitmapList(&ImportList);
/* update the control
 */
RedrawWindow(hWnd,
 NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
}
}
}


LImageListControl::ItemSelected

#include "ltwrappr.h"

virtual L_VOID LImageListControl::ItemSelected (nCtlID, pItemSel)

L_INT nCtlID; | /* the control’s ID */
pLILITEMSEL pItemSel; | /* pointer to a structure that contains information about the selected item */

Override this function to be notified when the user selects an item in the ImageList Control.

Parameter | Description
nCtlID | Identifier of the control.
pItemSel | Pointer to an LILITEMSEL structure containing information about the selected item.

Returns

None

Comments

This function is called when an Item is selected by the user.

You can override this function instead of processing the L_ILN_ITEMSEL command notification when you are sub-classing the ImageList Control.

The lIndex member of the LILITEMSEL structure pointed to by pItemSel will contain the 0-based index of the selected item.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::MsgProcCallBack.


LImageListControl::Insert

#include "ltwrappr.h"

L_INT LImageListControl::Insert(pItem, nIndex=-1)

pLILITEM pItem; | pointer to the item to insert */
L_INT nIndex; | /* index at which to insert the item */

Inserts an item into the ImageList Control.

Parameter | Description
pItem | Pointer to an LILITEM structure containing the item to be inserted.
nIndex | 0-based index at which to insert the item. Pass -1 to insert item at the end of the list.

Returns

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

Comments

All items beyond the specified index are pushed up by one.

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

LILITEM Item;
LBitmapBase Bitmap;

Bitmap.Load(TEXT("v:\\images\\babe.cmp"));

Item.uStructSize = sizeof(LILITEM);
Item.pBitmap = Bitmap.GetHandle();
Item.pText = TEXT("v:\\images\\babe.cmp");
Item.lData = 0;
Item.bSelected = TRUE;
Item.uMask = LILITEM_BITMAP |
LILITEM_TEXT |
LILITEM_DATA |
LILITEM_SELECTED;

m_ImgList.Insert(&Item);//
 at end of list
int nItem = m_ImgList.GetItemCount()-1;
// make it visible
m_ImgList.EnsureVisible(nItem);


LImageListControl::m_hWnd

#include "ltwrappr.h"

HWND m_hWnd

Comments

This is the window handle of the class object's ImageList window control. This data member will be filled when LImageListControl::CreateControl is called.

You can use this member variable if you derive a class from LImageListControl.

Required DLLs and Libraries

LTDIS
LTFIL
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:

Class Members

Example

For an example, refer to LImageListControl::GetBorderColor.


LImageListControl::MsgProcCallBack

#include "ltwrappr.h"

virtual LRESULT LImageListControl::MsgProcCallBack(hWnd, uMsg, wParam, lParam)

HWND hWnd; | /* handle to the bitmap window */
UINT uMsg; | /* the window message */
DWORD dwStyle; | /* the control’s style */
WPARAM wParam; | /* the first parameter of the window message */
LPARAM lParam; | /* the second parameter of the window message */

This function is called for each message the image list control receives.

Parameter | Description
hWnd | Handle to the bitmap window.
uMsg | The window message.
wParam | The first parameter of the window message.
lParam | The second parameter of the window message.

Returns

The result of processing a specific message.

Comments

Override this function to do your own processing of window events and messages. If you override this function you will be called prior to the image list control's own message processing.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

// define user LImageListControl class to override CallBack
class LMyImgList : public LImageListControl
{
public:
LMyImgList();
virtual ~LMyImgList();

virtual LRESULT MsgProcCallBack( HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM
lParam);

virtual L_VOID ItemSelected(L_INT nCtlID, pLILITEMSEL pItemSel);
};

LMyImgList::LMyImgList()
{
}

LMyImgList::~LMyImgList()
{
}

LRESULT LMyImgList::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM
lParam)
{
CString csOut;
if(uMsg == WM_MOUSEMOVE)
{
L_INT nIndex;
POINT Point;
Point.x = LOWORD(lParam);
Point.y = HIWORD(lParam);
nIndex = HitTest(&Point);
if(nIndex >= 0)
{
csOut.Format(TEXT("Item# %ld at X: %ld , Y: %ld"), nIndex, LOWORD(lParam), HIWORD(lParam));
::SetWindowText(::GetParent(hWnd), csOut);
}
else
{
csOut.Format(TEXT("X: %ld , Y: %ld"), LOWORD(lParam), HIWORD(lParam));
::SetWindowText(::GetParent(hWnd), csOut);
}
return TRUE;
}
return FALSE;
}

L_VOID LMyImgList::ItemSelected(L_INT nCtlID, pLILITEMSEL pItemSel)
{
CString csOut;
csOut.Format(TEXT("Item #%ld Selected!"), pItemSel->lIndex);
AfxMessageBox(csOut);
}

// create an instance of the user defined object
LMyImgList m_MyImgList;

// create the control
void TestFunc(HWND hParent)
{
// create the control
m_MyImgList.CreateControl(hParent, 0, WS_VISIBLE|WS_BORDER|WS_CHILD|WS_TABSTOP,
100, 300);
}


LImageListControl::Remove

#include "ltwrappr.h"

L_INT LImageListControl::Remove(nIndex)

L_INT nIndex;

/* index of the item to remove */

Removes the specified item from the ImageList Control.

Parameter | Description
nIndex | 0-based index that indicates which item to remove.

Returns

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

Comments

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// remove the first item from the control
m_ImgList.Remove(0);


LImageListControl::ScrollItems

#include "ltwrappr.h"

L_INT LImageListControl::ScrollItems(nCount)

L_INT nCount;

/* the amount to scroll */

Scrolls the items in the ImageList Control.

Parameter | Description
nCount | The number of rows or columns to scroll.

Returns

<>0 | The number of rows or columns scrolled.
0 | Did not scroll OR an error occurred.

Comments

Depending on the current setting for the control's ScrollStyle, the specified number of rows or columns will be scrolled if possible. The actual number or rows/columns scrolled will be returned.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

//Scroll Items by 2
m_ImgList.ScrollItems(-2);

AfxMessageBox(TEXT("wait"));

//now scroll back
m_ImgList.ScrollItems(2);


LImageListControl::SelectAll

#include "ltwrappr.h"

L_INT LImageListControl::SelectAll(bFlag=TRUE);

L_BOOL bFlag;

/* flag that indicates whether or not to select all items */

Selects all items in the ImageList control.

Parameter | Description
bFlag | Flag that indicates whether or not to select all items in the ImageList control. Possible values are:
Value | Meaning
TRUE | Select all items.
FALSE | De-select all items.

Returns

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

Comments

This message will set the select flag for all items in the ImageList control. If bFlag is TRUE, all items will be selected, otherwise all items will be de-selected.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// select all items
m_ImgList.SelectAll(TRUE);

AfxMessageBox(TEXT("wait"));

// now de-select all items
m_ImgList.SelectAll(FALSE);


LImageListControl::SetBackColor

#include "ltwrappr.h"

L_INT LImageListControl::SetBackColor(crBack)

COLORREF crBack;

/* new background color */

Sets the ImageList Control’s background color.

Parameter | Description
crBack | COLORREF value to be used as the new background color of the control.

Returns

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LImageListControl::GetBackColor.


LImageListControl::SetBorderColor

#include "ltwrappr.h"

L_INT LImageListControl::SetBorderColor(crBorder)

COLORREF crBorder;

/* new border color */

Sets the ImageList Control’s border color.

Parameter | Description
crBorder | COLORREF value to be used as the new border color of the control.

Returns

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LImageListControl::GetBorderColor.


LImageListControl::SetItemOptions

#include "ltwrappr.h"

L_INT LImageListControl::SetItemOptions(pItemOptions)

pLILITEMOPTION pItemOptions;

/* pointer to structure with the new options */

Sets the ImageList Control item display options.

Parameter | Description
pItemOptions | Pointer to an LILITEMOPTIONstructure that contains the new ImageList Control item display options.

Returns

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

Comments

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::GetItemOptions.


LImageListControl::SetScrollStyle

#include "ltwrappr.h"

L_INT LImageListControl::SetScrollStyle(nScrollStyle=SCROLLSTYLE_VERTICAL)

L_INT nScrollStyle;

/* new scroll style */

Sets the ImageList Control’s scroll style.

Parameter | Description
nScrollStyle | The new scroll style for the control. Possible values are:
Value | Meaning
SCROLLSTYLE_VERTICAL | [0] scrolling vertically.
SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontally.

Returns

The previous scroll style. Possible values are:

Value | Meaning
SCROLLSTYLE_VERTICAL | [0] scrolling vertically
SCROLLSTYLE_HORIZONTAL | [1] scrolling horizontal

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LImageListControl::GetScrollStyle.


LImageListControl::SetSelectionBitmap

#include "ltwrappr.h"

L_INT LImageListControl::SetSelectionBitmap(crTransparent, pBitmap)

COLORREF crTransparent; | /* transparent color */
LBitmapBase *pBitmap; | /* pointer to an LBitmapBase object */

Displays selected items using the specified user-defined bitmap.

Parameter | Description
crTransparent | Color value of the transparent color.
pBitmap | Pointer to an LBitmapBase object that references the bitmap to use as the selection bitmap.

Returns

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

Comments

Displays selected items using the specified user-defined bitmap when the selection style has been set to SELECTIONSTYLE_USERBITMAP using LImageListControl::SetSelectionOptions. The specified bitmap will be drawn with the specified color as transparent, and will be centered around each selected item.

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control
 | Using Color Values in LEADTOOLS

Example

LImageListControl m_ImgList;
LILSELOPTION SelOpt;
// get current options
m_ImgList. GetSelectionOptions (&SelOpt);
// set some options
if(SelOpt.uAllowSelection != ALLOWSELECTION_SINGLE)
SelOpt.uAllowSelection = ALLOWSELECTION_SINGLE;
LBitmapBase SelBitmap;
SelBitmap.Load(TEXT("d:\\temp\\flagsel2.bmp"));
m_ImgList.SetSelectionBitmap(RGB(255,255,255), &SelBitmap);
if(SelOpt.uSelectionStyle != SELECTIONSTYLE_USERBITMAP)
SelOpt.uSelectionStyle = SELECTIONSTYLE_USERBITMAP;
m_ImgList. SetSelectionOptions (&SelOpt);


LImageListControl::SetSelectionOptions

#include "ltwrappr.h"

L_INT LImageListControl::SetSelectionOptions(pSelOptions)

pLILSELOPTION pSelOptions;

/* pointer to a structure with new options */

Sets the ImageList Control selection options.

Parameter | Description
pSelOptions | Pointer to an LILSELOPTION structure that contains the new ImageList Control selection options.

Returns

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

Required DLLs and Libraries

LTDIS
LTFIL
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: | Class Members
Topics: | Using the ImageList Control

Example

For an example, refer to LimageListControl::GetSelectionOptions.


LImageListControl::Sort

#include "ltwrappr.h"

L_INT LImageListControl::Sort(bAscending=TRUE);

L_BOOL bAscending;

/* sort direction flag */

Sorts the items in the ImageList Control based on their text attribute.

Parameter | Description
bAscending | Flag that indicates the direction for sorting. Possible values are:
Value | Meaning
TRUE | Ascending sort.
FALSE | Descending sort.

Returns

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

Comments

If bAscending is TRUE, items will be sorted in ascending order, otherwise, items will be sorted in descending order.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

// sort descending order
m_ImgList.Sort(FALSE);


LImageListControl::SortExt

#include "ltwrappr.h"

L_INT LImageListControl::SortExt(pSortOptions)

pLILSORTOPTIONS pSortOptions;

/* pointer to a structure */

Sorts 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
pSortOptions | Pointer to the LILSORTOPTIONS structure that contains the sorting options to be used.

Returns

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

Comments

The ImageList Control items will be sorted according to the options in the structure pointed to by pSortOptions.

You must set the uStructSize member of the LILSORTOPTIONS structure before using this function.

Required DLLs and Libraries

LTDISLTFILLTIMG

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: | LImageListControl::Sort, LImageListControl::GetColumnCount, LImageListControl::Clear
Topics: | Using the ImageList Control
 | Raster Image Functions: Displaying Images

Example

L_VOID TestSortExt(HWND hWnd, LImageListControl& ImgList)
{
HWND hList;
LILSORTOPTIONS SortOptions;
L_INT nRet ;
if(IsWindow(hWnd))
{
hList = ImgList.CreateControl(hWnd,
 0) ;

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 */
nRet = ImgList.SortExt(&SortOptions);

/* update the control */
RedrawWindow( hWnd, NULL, NULL, RDW_INVALIDATE
 | RDW_UPDATENOW | RDW_ERASE);
}
}


LImageListControl::Update

#include "ltwrappr.h"

L_INT LImageListControl::Update(pItem, nIndex)

pLILITEM pItem; | /* pointer to a pItem structure */
L_INT nIndex; | /* index of the item to update */

Updates the specified item in the ImageList Control.

Parameter | Description
pItem | Pointer to an LILITEM structure that contains new attributes for the item at the specified index.
nIndex | 0-based index that indicates which item to update.

Returns

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

Comments

The LILITEM structure pointed to by pItem specifies the information to with which to update the specified item. The uMask member of the LILITEM structure indicates the attributes of the item to update.

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.

Required DLLs and Libraries

LTDIS
LTFIL
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: | LImageListControl::ExportBitmapList, LImageListControl::ImportBitmapList, LImageListControl::SortExt. Class Members
Topics: | Using the ImageList Control

Example

LImageListControl m_ImgList;

LILITEM Item;
LBitmapBase Bitmap;

// get the item's image
Item.uMask = LILITEM_BITMAP;
m_ImgList.GetItem(&Item,
 0);// get first item
// flip the image
Bitmap.SetHandle(Item.pBitmap);
Bitmap.Flip();

Item.pBitmap = Bitmap.GetHandle();
// change the item's image and text
Item.pText = TEXT("Flipped Image");
Item.uMask = LILITEM_BITMAP |
LILITEM_TEXT ;
m_ImgList.Update(&Item, 0);//
 update the item


LIsis::LIsis

#include "Ltwrappr.h"

L_VOID LIsis::LIsis(void)

L_VOID LIsis::LIsis(hWnd, pBitmap)

HWND hWnd; | /* handle to the parent window */
LBitmapBase L_FAR * pBitmap; | /* pointer to a bitmap object */

Constructs and initializes the different member variables of the LIsis object.

This function is available in the Document/Medical Toolkits.

Parameter | Description
hWnd | Handle to the parent window for the scanning operations.
pBitmap | Pointer to a bitmap object that will be used for the scanning operations.

Returns

None

Comments

LIsis::LIsis() is a constructor for the LIsis class.

LIsis::LIsis(hWnd, pBitmap) constructs and initializes the member variables of the LIsis object using the hWnd and pBitmap parameters.

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.

See Also

Functions:

LIsis::~LIsis, Class Members

Example

This is an example, for LIsis::LIsis():

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LIsis MyIsis ;

//…
}

This is an example for LIsis::LIsis(hWnd, pBitmap):

L_VOID MyISIS(HWND hWnd)
{
LBitmapBase LeadBitmap ;
LeadBitmap.Load("Image1.cmp", 0, ORDER_RGB);

LIsis LeadIsis(hWnd, &LeadBitmap) ;
}


LIsis::~LIsis

#include "Ltwrappr.h"

virtual L_VOID LIsis::~LIsis(void)

Destroys the object and frees any resources associated with it.

This function is available in the Document/Medical Toolkits.

Returns

None

Comments

This is the destructor for the LIsis class.

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.

See Also

Functions:

LIsis::LIsis, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LIsis MyIsis ;

//…
}


LIsis::Acquire

#include "Ltwrappr.h"

virtual L_INT LIsis::Acquire(uFlags=0)

L_UINT uFlags;

/* option flags */

Loads the associated bitmap object with a scanned image from the currently loaded ISIS scanner driver.

This function is available in the Document/Medical Toolkits.

Parameter | Description
uFlags | Option flags. Possible 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.

See Also

Functions: | LIsis::AcquireMulti, LIsis::AcquireMultiCallBack, LTwain::Acquire , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS,
 | Using ISIS to Scan Images

Example

L_INT MyFunction(HWND hWnd, LBitmapBase *pBitmap)
{
LIsis MyIsis ;
L_CHAR szDriverName[255];
memset(szDriverName,0,sizeof(szDriverName));

if (MyIsis.IsAvailable() != TRUE)
{
MessageBox( hWnd, "Isis is not available", "Isis Error", MB_OK) ;
return FAILURE ;
}

MyIsis.Select(szDriverName) ;

if (MyIsis.LoadDriver(szDriverName) == SUCCESS)
{
MyIsis.SetBitmap(pBitmap) ;
MyIsis.Acquire(ISIS_SHOWUI) ;
}

MyIsis.UnloadDriver() ;

return SUCCESS ;
}


LIsis::AcquireMulti

#include "Ltwrappr.h"

virtual L_INT LIsis::AcquireMulti(pszBaseFileName, uFlags=0, nFormat=FILE_TIF, bMultiPageFile=TRUE, pnPagesDiscarded=NULL)

L_CHAR L_FAR * pszBaseFileName; | /* base string */
L_UINT32 uFlags; | /* option flags */
L_INT nFormat; | /* format type for saving the image */
L_BOOL bMultiPageFile; | /* flag that indicates whether to save as a multipage file */
L_INT L_FAR * pnPagesDiscarded; | /* pointer to a variable that is updated with the number of discarded pages */

Starts a multipage ISIS scan. Each page will be saved in the specified format in either a multipage file, or as individual files.

This function is available in the Document/Medical Toolkits.

Parameter | Description
pszBaseFileName | Character string containing the base string from which page names will be generated.
uFlags | Option flags. Possible 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 multipage file, or as individual files for each page. Possible values are:
 | Value | Meaning
 | TRUE | The scanned pages will be saved as pages in a multipage file.
 | FALSE | Each scanned page will be saved to an individual file.
pnPagesDiscarded | Pointer to an integer that holds the number of pages discarded if scanning were canceled while ScanAhead was enabled.

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 multipage 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 override LIsis::AcquireMultiCallBack if you want to process each image instead of or in addition to saving the page to disk.

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.

See Also

Functions: | LIsis::Acquire, LTwain::Acquire , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

// define user ISIS class
class LUserIsis : public LIsis
{
LEAD_DECLAREOBJECT(LUserIsis);
public:
LUserIsis();
LUserIsis(HWND hWnd,LBitmapBase L_FAR* pBitmap);
virtual ~LUserIsis();
virtual L_INT AcquireMultiCallBack(L_INT32 nPage,L_CHAR L_FAR* pszFileName);
};

LEAD_IMPLEMENTOBJECT(LUserIsis);

// constructor and destructor
LUserIsis::LUserIsis()
{

}

LUserIsis::LUserIsis(HWND hWnd,LBitmapBase L_FAR* pBitmap)
{

}

LUserIsis::~LUserIsis()
{

}
L_INT LUserIsis::AcquireMultiCallBack(L_INT32 nPage,L_CHAR L_FAR* pszFileName)
{
/* user receives a bitmap here, when he calls the AcquireMulti function .
for example he can display it or free it */

return SUCCESS ;
}

L_INT MyFunction(HWND hWnd, LBitmapBase *pBitmap)
{
LUserIsis UserIsis ;
L_CHAR szDriverName[255];
L_INT nRet = 0 ;

memset(szDriverName,0,sizeof(szDriverName));

if (UserIsis.IsAvailable() != TRUE)
{
MessageBox( hWnd, "Isis is not available", "Isis Error", MB_OK) ;
return FAILURE ;
}

nRet = UserIsis.Select(szDriverName) ;
if (UserIsis.LoadDriver(szDriverName) == SUCCESS)
{
L_INT32 lWidth ;
L_INT32 lLength ;
L_INT nMaxPages = 1 ;

UserIsis.GetTagLong(TAG_IMAGEWIDTH, &lWidth);
UserIsis.GetTagLong(TAG_IMAGELENGTH, &lLength);

lWidth += 20 ;
lLength += 20 ;

UserIsis.SetTagLong(TAG_IMAGEWIDTH, lWidth);
UserIsis.SetTagLong(TAG_IMAGELENGTH, lLength);

nRet = UserIsis.SetTagShort(TAG_SCANAHEAD, TAG_SCANAHEAD_YES);
if(nRet == SUCCESS)
{
UserIsis.GetTagShort(TAG_MAXPAGES, &nMaxPages);
UserIsis.SetTagShort(TAG_SCANAHEAD_MAXPAGES, (L_INT)(nMaxPages/2));
}

nRet = UserIsis.SetScanOptions() ;

UserIsis.SetBitmap(pBitmap) ;

UserIsis.AcquireMulti("Isis_TIF.TIF",ISIS_SHOWUI) ;
}

UserIsis.UnloadDriver() ;

return SUCCESS ;
}


LIsis::AcquireMultiCallBack

#include "Ltwrappr.h"

virtual L_INT LIsis::AcquireMultiCallBack(nPage, pszFileName)

L_INT32 nPage; | /* page number */
L_CHAR L_FAR * pszFileName; | /* name of the saved file */

Handles each image provided by the calling function, LIsis::AcquireMulti.

This function is available in the Document/Medical Toolkits.

Parameter | Description
nPage | Number of the page just acquired.
pszFileName | Character string containing the name of the file saved.

Returns

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

Comments

This callback function will be enabled only if you enabled the callback functions by calling LBase::EnableCallBack(TRUE). You can handle the image during this callback. After this function returns, the associated bitmap object's internal BITMAPHANDLE will be re-used for the next image that is acquired.

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.

See Also

Functions: | LIsis::AcquireMulti, Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::GetTagASCII

#include "ltwrappr.h"

virtual L_INT LIsis::GetTagASCII(uTag, pszValue, puSize, bDefault)

L_UINT uTag; | /* ASCII tag */
L_CHAR *pszValue; | /* character string */
L_UINT32 *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.

See Also

Functions: | LIsis::SetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLong, LIsis::SetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::SetTagShort, LIsis::GetTagShortChoice
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_VOID IsisASCIITagsExample(LIsis & Isis)
{
L_UINT32 uSize;
L_CHAR * pszTagValue;
L_CHAR szMessage[512];

// Set an ASCII tag (TAG_PAGESIZE) to a new value
Isis.SetTagASCII(TAG_PAGESIZE, "Scanner's Maximum");

/* Get the scanner's default value for TAG_PAGESIZE */
Isis.GetTagASCII(TAG_PAGESIZE, NULL, &uSize, TRUE);
pszTagValue = new L_CHAR[++uSize];
Isis.GetTagASCII(TAG_PAGESIZE, pszTagValue, &uSize, TRUE);
wsprintfA(szMessage,
"The scanner's default value for TAG_PAGESIZE is: %s\n",
pszTagValue);

delete [] pszTagValue;

/* Get the scanner's current value for TAG_PAGESIZE */
Isis.GetTagASCII(TAG_PAGESIZE, NULL, &uSize, FALSE);
pszTagValue = new L_CHAR[++uSize];
Isis.GetTagASCII(TAG_PAGESIZE, pszTagValue, &uSize, FALSE);
wsprintfA(szMessage,
"%sThe scanner’s current value for TAG_PAGESIZE is: %s",
szMessage, pszTagValue);

delete [] pszTagValue;

// Display the values
MessageBoxA(NULL, szMessage, "ASCII Tags Example", MB_OK);
}


LIsis::GetTagASCIIChoice

#include "ltwrappr.h"

virtual L_INT LIsis::GetTagASCIIChoice(uTag, nIndex, pszValue, puSize)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_CHAR *pszValue; | /* character string */
L_UINT32 *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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::SetTagASCII, LIsis::GetTagLong, LIsis::SetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::SetTagShort, LIsis::GetTagShortChoice
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_VOID IsisASCIITagsChoicesExample(LIsis & Isis)
{
L_UINT32 uSize;
L_CHAR * pszTagChoice;
L_UINT32 uChoicesCount;
L_CHAR szMessage[512];

// Get the number of choices available for TAG_PAGESIZE
Isis.GetTagASCIIChoice(TAG_PAGESIZE, ISIS_DEFAULT, NULL,
&uChoicesCount);

wsprintfA(szMessage, "There are %u choices for TAG_PAGESIZE",
uChoicesCount);
MessageBoxA(NULL, szMessage, "ASCII Tags Choices Example", MB_OK);

/* Get and display each choice of TAG_PAGESIZE */
for (L_UINT32 x = 0; x < uChoicesCount; x++)
{
Isis.GetTagASCIIChoice(TAG_PAGESIZE, x, NULL, &uSize);
if (uSize > 0)
{
pszTagChoice = new L_CHAR[++uSize];
Isis.GetTagASCIIChoice(TAG_PAGESIZE, x, pszTagChoice, &uSize);
wsprintfA(szMessage, "Choice %u is: %s", x, pszTagChoice);
MessageBoxA(NULL, szMessage, "ASCII Tags Choices Example",
MB_OK);
delete [] pszTagChoice;
}
}
}


LIsis::GetTagLong

#include "Ltwrappr.h"

virtual L_INT LIsis::GetTagLong(uTag, pnValue)

L_UINT uTag; | /* the long tag whose value you want to retrieve */
L_INT32 L_FAR * pnValue; | /* pointer to the variable to be updated */

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.
pnValue | Pointer to an L_INT32 variable to be updated with 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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::GetTagShortChoice, LIsis::SetTagASCII, LIsis::SetTagLong, LIsis::SetTagShort, LTwain::GetProperties , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::GetTagLongChoice

#include "ltwrappr.h"

virtual L_INT LIsis::GetTagLongChoice(uTag, nIndex, plValue)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_INT32 *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.

See Also

Functions: | LIsis::GetTagLong, LIsis::SetTagLong, LIsis::GetTagShort, LIsis::SetTagShort, LIsis::GetTagShortChoice, LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::SetTagASCII
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_VOID IsisLongTagsChoicesExample(LIsis & Isis)
{
L_INT32 lChoiceValue;
L_INT32 lChoicesCount;
L_CHAR szMessage[256];

// Get the number of choices available for TAG_IMAGEWIDTH
Isis.GetTagLongChoice(TAG_IMAGEWIDTH, ISIS_DEFAULT, &lChoicesCount);

wsprintfA(szMessage, "There are %d choices for TAG_IMAGEWIDTH",
lChoicesCount);

MessageBoxA(NULL, szMessage, "Long Tags Choices Example", MB_OK);

/* Get and display each choice for TAG_IMAGEWIDTH */
for (L_INT32 x = 0; x < lChoicesCount; x++)
{
Isis.GetTagLongChoice(TAG_IMAGEWIDTH, x, &lChoiceValue);
wsprintfA(szMessage, "Choice %d is: %d", x, lChoiceValue);
MessageBoxA(NULL, szMessage, "Long Tags Choices Example", MB_OK);
}
}


LIsis::GetTagShort

#include "Ltwrappr.h"

virtual L_INT LIsis::GetTagShort(uTag, pnValue)

L_UINT uTag; | /* the short tag whose value you want to retrieve */
L_INT L_FAR * pnValue; | /* pointer to the variable to be updated */

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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShortChoice, LIsis::SetTagASCII, LIsis::SetTagLong, LIsis::SetTagShort, LTwain::GetProperties , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::GetTagShortChoice

#include "ltwrappr.h"

virtual L_INT LIsis::GetTagShortChoice(uTag, nIndex, pnValue)

L_UINT uTag; | /* ASCII tag */
L_INT32 nIndex; | /* index value */
L_INT *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.

See Also

Functions: | LIsis::GetTagShort, LIsis::SetTagShort, LIsis::GetTagLong, LIsis::SetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::SetTagASCII
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

L_VOID IsisShortTagsChoicesExample(LIsis & Isis)
{
L_INT nChoiceValue;
L_INT nChoicesCount;
L_CHAR szMessage[256];

// Get the number of choices available for TAG_BRIGHTNESS
Isis.GetTagShortChoice(TAG_BRIGHTNESS, ISIS_DEFAULT,
&nChoicesCount);

wsprintfA(szMessage, "There are %d choices for TAG_BRIGHTNESS",
nChoicesCount);

MessageBoxA(NULL, szMessage, "Short Tags Choices Example", NULL);

/* Get and display each choice of TAG_BRIGHTNESS */
for (L_INT x = 0; x < nChoicesCount; x++)
{
Isis.GetTagShortChoice(TAG_BRIGHTNESS, x, &nChoiceValue);
wsprintfA(szMessage, "Choice %d is: %d", x, nChoiceValue);
MessageBoxA(NULL, szMessage, "Short Tags Choices Example",
MB_OK);
}
}


LIsis::IsAvailable

#include "Ltwrappr.h"

virtual L_BOOL LIsis::IsAvailable(void)

Determines if the ISIS support dlls are installed.

This function is available in the Document/Medical Toolkits.

Returns

TRUE | The ISIS support dlls are installed.
FALSE | The ISIS support dlls 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.

See Also

Functions: | LIsis::Select, LTwain::IsAvailable , LTwain::SelectSource , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::LoadDriver

#include "Ltwrappr.h"

virtual L_INT LIsis::LoadDriver(pszDriverName=0)

L_CHAR L_FAR * pszDriverName;

/* name of the ISIS Scanner Driver to load */

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 any of the following LIsis member functions:

LIsis::Acquire()

LIsis::AcquireMulti()

LIsis::UnloadDriver()

LIsis::SetTagShort()

LIsis::GetTagShort()

LIsis::SetTagLong()

LIsis::GetTagLong()

LIsis::SetTagShort()

LIsis::SetScanOptions()

When you are finished with ISIS support, you must call LIsis::UnloadDriver.

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.

See Also

Functions: | LIsis::Acquire, LIsis::AcquireMulti, LIsis::GetTagLong, LIsis::GetTagShort, LIsis::SetTagLong, LIsis::SetTagShort, Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::Select

#include "Ltwrappr.h"

virtual L_INT LIsis::Select(pszCurScanDriver)

L_CHAR L_FAR * pszCurScanDriver;

/* current selected 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
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

To get the current selected driver without showing the Select dialog box, call LScanner::SetWindow(hWnd) and pass hWnd = NULL, before calling this function.

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.

See Also

Functions: | LIsis::IsAvailable, LTwain::IsAvailable , LTwain::SelectSource , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::SetScanOptions

#include "Ltwrappr.h"

virtual L_INT LIsis::SetScanOptions(void)

Brings up the scan options dialog box.

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 LIsis::LoadDriver 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.

See Also

Functions: | LIsis::Acquire, LIsis::AcquireMulti, LIsis::GetTagLong, LIsis::GetTagShort, LIsis::IsAvailable, LIsis::LoadDriver, LIsis::Select, LIsis::SetTagLong, LIsis::SetTagShort, LIsis::UnloadDriver, Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::SetTagASCII

#include "ltwrappr.h"

virtual L_INT LIsis::SetTagASCII(uTag, pszValue)

L_UINT uTag; | /* ASCII tag */
L_CHAR * 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 LIsis::SetTagASCII 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 LIsis::SetTagLong.

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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::GetTagShortChoice, LIsis::SetTagLong, LIsis::SetTagShort
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::GetTagASCII.


LIsis::SetTagLong

#include "Ltwrappr.h"

virtual L_INT LIsis::SetTagLong(uTag, nValue)

L_UINT uTag; | /* the long tag to set */
L_INT32 nValue; | /* value used to set the long tag */

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.
nValue | Value used to set the tag.

Returns

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

Comments

If LIsis::SetTagLong() 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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::GetTagShortChoice, LIsis::SetTagASCII, LIsis::SetTagShort Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::SetTagShort

#include "Ltwrappr.h"

virtual L_INT LIsis::SetTagShort(uTag, nValue)

L_UINT uTag; | /* the short tag to set */
L_INT nValue; | /* the value used to set the short tag */

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.

See Also

Functions: | LIsis::GetTagASCII, LIsis::GetTagASCIIChoice, LIsis::GetTagLong, LIsis::GetTagLongChoice, LIsis::GetTagShort, LIsis::GetTagShortChoice, LIsis::SetTagASCII, LIsis::SetTagLong, LTwain::SetProperties , Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LIsis::UnloadDriver

#include "Ltwrappr.h"

virtual L_INT LIsis::UnloadDriver(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 an ISIS scanner driver using LIsis::LoadDriver.

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.

See Also

Functions: | LIsis::LoadDriver, Class Members
Topics: | Raster Image Functions: Scanning Images using ISIS
 | Using ISIS to Scan Images

Example

For an example, refer to LIsis::AcquireMulti.


LMemoryFile::LMemoryFile

#include "ltwrappr.h"

L_VOID LMemoryFile::LMemoryFile(L_VOID)

L_VOID LMemoryFile::LMemoryFile(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to a bitmap object */

Constructs and initializes the different variables of the class object.

Parameter | Description
pBitmap | Pointer to a LEAD bitmap object, used to initialize the LMemoryFile object.

Returns

None

Comments

LMemoryFile::LMemoryFile() is a constructor for the LMemoryFile class.

LMemoryFile::LMemoryFile(pLBitmap) initializes the member variables using the pLBitmap parameter.

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.

See Also

Functions:

LMemoryFile::~LMemoryFile, Class Members

Example

This is an example for LMemoryFile::LMemoryFile():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LMemoryFile memFile;

//…
}

This is an example for LMemoryFile::LMemoryFile(pLBitmap):

L_VOID MyFunction()
{
LBitmapBase LeadBitmap ;
LeadBitmap.Load (TEXT("Image1.cmp"),24,ORDER_RGB) ;

LMemoryFile memFile(&LeadBitmap) ;

//…
}


LMemoryFile::~LMemoryFile

#include "ltwrappr.h"

L_VOID virtual LMemoryFile::~LMemoryFile(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LMemoryFile class.

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.

See Also

Functions:

Class Members

Example

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LMemoryFile memFile;

//…
}


LMemoryFile::CompressBuffer

#include "ltwrappr.h"

virtual L_INT LMemoryFile::CompressBuffer(pLBuffer)

LBuffer L_FAR * pLBuffer;

/* pointer to an LBuffer object */

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
pLBuffer | 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: You must call the LMemoryFile::StartCompressBuffer function before using this function, and you must call the LMemoryFile::EndCompressBuffer function to end the compression process. For a description of how these functions work together, refer to LMemoryFile::StartCompressBuffer.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Saving Files

Example

For an example, refer to LMemoryFile::StartCompressBuffer.


LMemoryFile::CompressBufferCallBack

#include "ltwrappr.h"

virtual L_INT LMemoryFile::CompressBufferCallBack(pLBitmap, pLBuffer)

LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object that contains image information */
LBuffer L_FAR * pLBuffer; | /* pointer to an LBuffer object that contains compressed data */

Writes output from the LMemoryFile::CompressBuffer function

Parameter | Description
pLBitmap | Pointer to the bitmap object that contains the image information.
pLBuffer | Pointer to the caller's output buffer object containing compressed data.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LMemoryFile::StartCompressBuffer.


LMemoryFile::Decompress

This function has been removed. You can achieve the same functionality using LMemoryFile::Load.


LMemoryFile::DecompressMemoryCallBack

This function has been removed, along with LMemoryFile::Decompress. You can achieve the same functionality using LMemoryFile::LoadMemory.


LMemoryFile::EndCompressBuffer

#include "ltwrappr.h"

virtual L_INT LMemoryFile::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 LMemoryFile::CompressBuffer. For a detailed description of when to use this function, refer to LMemoryFile::StartCompressBuffer.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Saving Files

Example

For an example, refer to LMemoryFile::StartCompressBuffer.


LMemoryFile::GetBitmapMemoryInfo

#include "ltwrappr.h"

static L_INT LMemoryFile::GetBitmapMemoryInfo(pBitmap, puMemoryType, puTileSize, puTotalTiles, puConvTiles, puMaxTileViews, puTileViews)

static L_INT LMemoryFile::GetBitmapMemoryInfo(plBitmap, puMemoryType, puTileSize, puTotalTiles, puConvTiles, puMaxTileViews, puTileViews)

pBITMAPHANDLE pBitmap; | /* pointer to a bitmap handle*/
LBitmapBase *plBitmap; | /* pointer to a bitmap class object*/
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.
plBitmap | Pointer to the LBitmapBase object 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, 8-bit, or 1-bit Fax G4). The other parameters will be ignored.
 | TYPE_TILED | The bitmap is tiled 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.

Returns

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

Comments

You can pass NULL for all parameters except pBitmap/plBitmap and puMemoryType if you are not interested in some parameters.

This function is used for informational purposes. You can use LMemoryFile::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).

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.

See Also

Functions: | LFileSettings::SetTempDirectory, LFileSettings::GetTempDirectory, Class Members
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_INT TestGetBitmapMemInfoFunction(LBitmapBase* pLeadBitmap)
{
L_UINT uMemoryType;
L_UINT uMaxTileViews;
L_UINT uTotalTiles;
L_UINT uConvTiles;

L_UINT uTileViews;

LMemoryFile::GetBitmapMemoryInfo(pLeadBitmap, &uMemoryType, NULL, &uTotalTiles, &uConvTiles, &uMaxTileViews, NULL);

if(uMemoryType == TYPE_TILED)
{
uMaxTileViews = min(uTileViews * 2, uTotalTiles - uConvTiles);
LMemoryFile::SetBitmapMemoryInfo(pLeadBitmap, 0, 0, 0, 0, uMaxTileViews, 0, SETMEM_MAXTILEVIEWS);
}

return 0;
}


LMemoryFile::GetInfo

#include "ltwrappr.h"

virtual L_INT LMemoryFile::GetInfo(LMemoryBuffer, pFileInfo, uStructSize, uFlags=FILEINFO_TOTALPAGES, pLoadFileOption=NULL)

LBuffer& LMemoryBuffer; | /* an LBuffer object */
pFILEINFO pFileInfo; | /* pointer to a LEAD FILEINFO structure */
L_UINT uStructSize; | /* size in bytes, of the structure pointed to by pFileInfo */
L_UINT uFlags; | /* flag that indicates whether to update the TotalPages field */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Loads information about the file located in memory into a FILEINFO structure

Parameter | Description
LMemoryBuffer | A LEAD LBuffer object that holds the memory of the image file.
pFileInfo | Pointer to the LEAD FILEINFO structure to be filled with data from the image file. You must set the uStructSize member of pFileInfo before calling LMemoryFile::GetInfo.
uStructSize | Size in bytes, of the structure pointed to by pFileInfo. Use sizeof(FILEINFO).
uFlags | Flag that indicates 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.
pLoadFileOption | 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 LMemoryFile::GetInfo function, passing the file name and the address of the FILEINFO variable as parameters. When calling the function, use the sizeof macro to pass the size of the FILEINFO structure in the uStructSize parameter.
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.

The LMemoryBuffer parameter is passed by reference, and is a required parameter.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

For an example, refer to LMemoryFile::LoadMemory.


LMemoryFile::GetMemoryThresholds

#include "ltwrappr.h"

static L_INT LMemoryFile::GetMemoryThresholds(pnTiledThreshold, pnMaxConvSize, pnTileSize, pnConvTiles, pnConvBuffers)

L_INT L_FAR * pnTiledThreshold; | /* pointer to a variable to be updated with the minimum amount of free memory required to allow the allocation of conventional bitmaps */
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 LMemoryFile::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 LMemoryFile::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 LMemoryFile::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 LMemoryFile::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 LMemoryFile::SetMemoryThresholds.
pnConvBuffers | Pointer to a variable to be updated with the number of buffers in conventional memory. For more information, refer to LMemoryFile::SetMemoryThresholds.

Returns

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

Comments

This function will allow you to retrieve the parameters set with LMemoryFile::SetMemoryThresholds. For more information on the various thresholds, refer to LMemoryFile::SetMemoryThresholds.

Pass NULL for any parameter you are not interested in retrieving.

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.

See Also

Functions: | LFileSettings::SetTempDirectory, LFileSettings::GetTempDirectory, Class Members
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 */
LMemoryFile::GetMemoryThresholds (NULL, &nMaxConvSize, NULL, NULL, NULL);

/* Double the max conventional size value */
LMemoryFile::SetMemoryThresholds(0, nMaxConvSize * 2, 0, 0, 0, MEM_MAXCONVSIZE);


LMemoryFile::IsValid

#include "ltwrappr.h"

L_BOOL LMemoryFile::IsValid(L_VOID)

Determines whether the memory file object is ready to be used.

Returns

TRUE | The LMemoryFile object is ready to be used.
FALSE | The LMemoryFile object is not ready to be used.

Comments

Before you can use some of the memory file functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LMemoryFile object, the object is considered invalid.

Note that the following functions do not require the object to be valid:

LMemoryFile::GetInfo

LMemoryFile::ReadComment

LMemoryFile::ReadTag

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.

See Also

Functions:

Class Members

Example

For an example, refer to LMemoryFile::LoadMemory.


LMemoryFile::LoadBitmap

#include "ltwrappr.h"

virtual L_INT LMemoryFile::LoadBitmap(LMemoryBuffer, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, pLoadFileOption=NULL)

LBuffer& LMemoryBuffer; | /* an LBuffer object */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order for 16-, 24-, and 32-bit bitmaps */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Loads an image file from memory into the class object's associated bitmap. The file in memory can be in any supported image file format and bits per pixel, whether compressed or uncompressed.

Parameter | Description
LMemoryBuffer | A LEAD buffer that contains the file in memory to be loaded.
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
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. Possible values are:
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 toolkits.
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 toolkits 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 toolkits only.
pLoadFileOption | 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 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 multipage 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 LBitmapBase::Free.

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.

The LMemoryBuffer parameter is passed by reference, and is a required parameter.

This function cannot be used in combination with the Redirect input / output functions.

Note: For information on 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.

See Also

Functions: | Class Members, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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

L_VOID LoadSaveFunc(LBitmapBase& LeadBitmap)
{
LMemoryFile LeadMemFile ;
LBuffer LeadMemBuffer ;

LeadMemFile.SetBitmap(&LeadBitmap)
 ;
LeadMemFile.EnableCallBack(TRUE)
 ;

LeadMemFile.SaveBitmap(&LeadMemBuffer,FILE_LEAD,24,QS)
 ;

LeadBitmap.Free();

LeadMemFile.LoadBitmap(LeadMemBuffer,24,ORDER_BGR,
 NULL) ;
}


LMemoryFile::LoadMemory

#include "ltwrappr.h"

virtual L_INT LMemoryFile::LoadMemory(LMemoryBuffer, nBitsPerPixel=0, nOrder=ORDER_BGRORGRAY, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE, pLoadFileOption=NULL)

LBuffer& LMemoryBuffer; | /* an LBuffer object */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* color order */
L_UINT uFlags; | /* flags that indicate the behavior of the function */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Loads any supported file from memory.

Parameter | Description
LMemoryBuffer | A LEAD buffer into which the file in memory will be loaded.
nBitsPerPixel | Resulting bitmap pixel depth. Possible values are:
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 Document/Medical toolkits.
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 toolkits 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 toolkits only.
uFlags | Binary flags that determine the behavior of LMemoryFile::LoadMemory. You can specify one or more of the following values:
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 multipage file. Use this flag only if you are creating a bitmap list using the LPlayBack::Append 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.
pLoadFileOption | 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

This function supports the LMemoryFile::LoadMemoryCallBack virtual function.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

Before calling this function, you may need to get or set file information, such as the page number of a multipage file. Refer to Getting and Setting File Information.

Note: This function does not support Kodak PhotoCD (PCD), Kodak FlashPix (FPX), or Microsoft FAX (AWD) files.

Note: More options are available in the LOADFILEOPTION structure.

The LMemoryBuffer parameter is passed by reference, and is a required parameter.

This function cannot be used in combination with the Redirect input / output functions.

Note: For information on 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.

See Also

Functions: | Class Members, LBitmapBase::GetLoadStatus, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LFileSettings::GetLoadResolution, LFileSettings::GetPCDResolution, LFileSettings::GetWMFResolution, LFileSettings::SetLoadResolution, LFileSettings::SetPCDResolution, LFileSettings::SetWMFResolution, LFileSettings::GetViewMode2D, LFileSettings::GetViewPort2D, LFileSettings::SetViewMode2D, LFileSettings::SetViewPort2D
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

// define user LMemoryFile class to override its CallBacks
class LUserMemoryFile : public LMemoryFile
{
public:
LUserMemoryFile() ;
virtual ~LUserMemoryFile() ;
virtual L_INT LoadMemoryCallBack(pFILEINFO
 pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines);
};

LUserMemoryFile::LUserMemoryFile()
{
}

LUserMemoryFile::~LUserMemoryFile()
{
}

L_INT LUserMemoryFile::LoadMemoryCallBack(pFILEINFO
 pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines)
{
return SUCCESS ;
}

L_INT TestLoadMemFunction(LBitmapBase& LeadBitmap)
{
LUserMemoryFile userLeadMemFile ;
LBuffer LeadMemBuffer ;
FILEINFO FileInfo;

if (userLeadMemFile.IsValid()
 == FALSE)
userLeadMemFile.SetBitmap(&LeadBitmap)
 ;

userLeadMemFile.EnableCallBack(TRUE)
 ;

userLeadMemFile.SaveBitmap(&LeadMemBuffer,FILE_LEAD,24,QS,
 NULL) ;

userLeadMemFile.GetInfo
 (LeadMemBuffer,&FileInfo, sizeof(FILEINFO), NULL) ;

LeadBitmap.Free();

LeadBitmap.Initialize(FileInfo.Width,
 FileInfo.Height, FileInfo.BitsPerPixel) ;

userLeadMemFile.LoadMemory(
 LeadMemBuffer, 0, ORDER_BGR, LOADFILE_ALLOCATE | LOADFILE_STORE, NULL)
 ;

return SUCCESS ;
}


LMemoryFile::LoadMemoryCallBack

#include "ltwrappr.h"

virtual L_INT LMemoryFile::LoadMemoryCallBack(pFileInfo, pLBitmap, pLBuffer, uFlags, nRow, nLines)

pFILEINFO pFileInfo; | /* pointer to a FILEINFO structure */
LBitmapBase L_FAR * pLBitmap; | /* pointer to an LBitmapBase object */
LBuffer L_FAR * pLBuffer; | /* pointer to an LBuffer object */
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 */

Handles the output image data that the LMemoryFile::LoadMemory function has written to a buffer.

Parameter | Description
pFileInfo | Pointer to the FILEINFO structure that contains image information.
pLBitmap | Pointer to the bitmap object referencing the bitmap that contains the image information.
pLBuffer | Pointer to a buffer object 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. Possible values are:
 | Value | 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 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 pLBuffer buffer object.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LMemoryFile::LoadMemory.


LMemoryFile::ReadComment

#include "ltwrappr.h"

virtual L_INT LMemoryFile::ReadComment(LMemoryBuffer, pLCommentBuffer, uType, pLoadFileOption=NULL)

LBuffer& LMemoryBuffer; | /* an LBuffer object */
LBuffer L_FAR * pLCommentBuffer; | /* pointer to an LBuffer object */
L_UINT uType; | /* type of comment */
pLOADFILEOPTION pLoadFileOption; | /* pointer to optional extended load options */

Gets a comment field from a file in memory.

Parameter | Description
LMemoryBuffer | A LEAD LBuffer object that contains the file in memory.
pLCommentBuffer | A LEAD LBuffer object to be updated with 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).
uType | The type of comment. Refer to Types of File Comments.
pLoadFileOption | 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 LFileSettings::SetComment function to specify the comments to be saved.

The LMemoryFile::ReadComment function lets you read comments that are already saved in a file in memory. For more information refer to the LFileSettings::SetComment function.

Note: More options are available in the LOADFILEOPTION structure.

Note: This function does not support Kodak FlashPix files.

The LMemoryBuffer parameter is passed by reference, and is a required parameter.

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.

See Also

Functions: | LFile::ReadCommentOffset, Class Members
Topics: | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

L_VOID TestReadCommentMem()
{
L_TCHAR szMessage[80]; // MessageBox string
L_INT CommentLength; // Length of the comment string
 that we will get
LMemoryFile LeadMemFile ;
LBuffer LeadMemBuffer ;
LBuffer LeadCommBuffer ;
LFile LeadFile ;
LBitmapBase LeadBitmap;

LeadFile.SetBitmap(&LeadBitmap)
 ;
LeadFile.SetFileName(TEXT("1.tif"))
 ;

LeadFile.LoadBitmap()
 ;

LeadMemFile.SetBitmap(&LeadBitmap)
 ;
LeadMemFile.SaveBitmap(&LeadMemBuffer,FILE_LEAD,24,QS)
 ;

// Use the return value to get the length of a comment
 in the file
CommentLength = LeadMemFile.ReadComment
 (LeadMemBuffer, NULL, CMNT_SZDATETIME, NULL);

if (CommentLength < 0)
{
MessageBox(NULL,TEXT("File has
 not comment ..."), TEXT("Read Memory Comment"),MB_OK) ;
return ;
}

LeadCommBuffer.Reallocate((L_INT32)CommentLength);

// Get the actual comment from the file
LeadMemFile.ReadComment
 ( LeadMemBuffer, &LeadCommBuffer, CMNT_SZDATETIME);

// Show the comment that was saved in the file
wsprintf (szMessage, TEXT("DATE_TIME:\n %hs"),
 LeadCommBuffer.Lock());
MessageBox (NULL, szMessage, TEXT("Date_Time"),
 MB_OK);

LeadCommBuffer.Unlock()
 ;
}


LMemoryFile::ReadTag

#include "ltwrappr.h"

virtual L_INT32 LMemoryFile::ReadTag(LMemoryBuffer, pLTagDataBuffer, uTag, pType, pCount, pLoadFileOption=NULL)

LBuffer& LMemoryBuffer; | /* an LBuffer object */
LBuffer L_FAR * pLTagDataBuffer; | /* pointer to an LBuffer object */
L_UINT16 uTag; | /* tag to identify the data in the TIFF file */
L_UINT16 L_FAR * pType; | /* address of the variable to be updated with the data type */
L_UINT32 L_FAR * pCount; | /* address of the variable to be updated with the count */
pLOADFILEOPTION pLoadFileOption; | /* 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
LMemoryBuffer | A LEAD LBuffer object that contains the file in memory.
pLTagDataBuffer | 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.
uTag | Tag to identify the data in the TIFF file. Use the same tag that you specified in the LFileSettings::SetTag function.
pType | Address of the variable to be updated with the tagged data type. Possible 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.
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.
pLoadFileOption | 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 pLTagDataBuffer 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 pLTagDataBuffer parameter.

For general information about TIFF tags, refer to Implementing TIFF Comments and Tags.

The LMemoryBuffer parameter is passed by reference, and is a required parameter.

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.

See Also

Functions: | LFile::DeleteTag, Class Members
Topics: | Implementing TIFF Comments and Tags

Example

L_VOID TestReadTagMem()
{
LMemoryFile LeadMemFile ;
LBuffer LeadMemBuffer ;
LBuffer LeadCommBuffer ;
LFile LeadFile ;
LBitmapBase LeadBitmap;
L_UINT16 LogoPosition = 0x8001; // my private tags
L_UINT16 TagType = TAG_SSHORT; // tagged data type
L_UINT32 TagCount = 4; // count of data items
L_INT32 BufferSize ;

L_INT TagData[] = {5, 5, 24, 37,};
L_VOID L_FAR *pTagData = &TagData; // pointer to
 the buffer containing tagged data

LeadFile.SetBitmap(&LeadBitmap)
 ;
LeadFile.SetFileName(TEXT("1.tif"))
 ;

LeadFile.LoadBitmap()
 ;

// Set the tag data to be saved
LFileSettings::SetTag(LogoPosition, TagType, TagCount,
 pTagData);

LeadMemFile.SetBitmap(&LeadBitmap)
 ;
LeadMemFile.SaveBitmap(&LeadMemBuffer,FILE_LEAD,24,QS)
 ;

// Get the required size of the buffer for the tagged
 data
BufferSize = LeadMemFile.ReadTag(LeadMemBuffer,
 NULL, LogoPosition,
&TagType, &TagCount, NULL);

if ((TagType != TAG_SSHORT) || (BufferSize < 0))
return ;
else
// Allocate the buffer
LeadCommBuffer.Reallocate(BufferSize);

// Get the tagged data
BufferSize = LeadMemFile.ReadTag(LeadMemBuffer,
 &LeadCommBuffer, LogoPosition,
&TagType, &TagCount);

if (BufferSize >= 0)
MessageBox(NULL, TEXT("ReadTag successful"),
 TEXT("TAG Memory"),MB_OK) ;
}


LMemoryFile::SaveBitmap

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveBitmap(pLMemoryBuffer, nFormat, nBitsPerPixel=0, nQFactor=2, pSaveFileOption=NULL)

LBuffer L_FAR * pLMemoryBuffer; | /* pointer to an LBuffer object */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Saves the class object's associated bitmap to a file in memory. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
pLMemoryBuffer | Pointer to an LBuffer object into which the bitmap in memory will be saved. After successful completion of this function, the object pointed to by pLMemoryBuffer will contain the output file.
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 LBitmapBase::GetBitsPerPixel returns 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel returns 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.
pSaveFileOption | Pointer to optional extended save options. Pass NULL to use the default save options.

Returns

None

Comments

To use this function, do the following:

1. | Declare an LBuffer object. You can then pass its address in this function, which will allocate the memory, save the bitmap, and unlock the memory.
2. | Declare a long integer (L_UINT32) variable for the file-size. You can then pass its address in this function, which will update its value with the size of the file.
3. | Call this function to save the bitmap in the specified LBuffer object.

Support for 12 and 16-bit grayscale images is only available in the Document/Medical toolkits.

This function cannot be used in combination LBaseFile::EnableRedirectIO.

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 PhotoCD (PCD), FlashPix (FPX), or Microsoft FAX (AWD) files.

This function cannot be used in combination with the Redirect input / output functions.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Functions: | Class Members
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

Example

For an example, refer to LMemoryFile::LoadMemory.


LMemoryFile::SaveBitmapBuffer

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveBitmapBuffer(pLBuffer, puFileSize, nFormat, nBitsPerPixel, nQFactor, pSaveOptions)

LBuffer * pLBuffer; | /* pointer to an LBuffer object */
L_UINT32 * puFileSize; | /* pointer to a variable */
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 the class object's associated bitmap into an LBuffer object. The size of the LBuffer object's buffer must be specified by the user. The output can be in any of the supported compressed or uncompressed file formats.

Parameter | Description
pLBuffer | Pointer to an LBuffer object into which the bitmap will be saved. Note that if this object's buffer is not large enough to accommodate the file in memory, the LMemoryFile::SaveBitmapBufferCallBack is called to allow the user to reallocate the buffer.
puFileSize | Pointer to a variable that will contain the size of the file in memory. This is not the final size of the LBuffer buffer, which may be larger than the memory file.
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 LBitmapBase::GetBitsPerPixel gets the value 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel gets the value 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

LMemoryFile::SaveBitmapBuffer saves a class object's associated bitmap into an LBuffer object. The output can be in any of the supported, compressed or uncompressed file formats. This function is similar to LMemoryFile::SaveBitmap , except the user is responsible for allocating/reallocating buffers. If the buffer of the LBuffer object is not large enough to accommodate the file in memory, the LMemoryFile::SaveBitmapBufferCallBack is called so the user can re-allocate the buffer. This callback function must be enabled by calling LBase::EnableCallBack .

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 LMemoryFile::SaveBitmapBufferCallBack 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 toolkits.

This function cannot be used in combination with redirecting I/O functions.

Note: | More options are available in the SAVEFILEOPTION structure.
Note: | FPX, PCD, AWD and AVI files cannot be saved to memory.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Functions: | LMemoryFile::SaveFileBuffer, LMemoryFile::SaveBitmapBufferCallBack, LMemoryFile::SaveBitmap, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

Example

L_INT SaveBitmapBufferSample(LBitmapBase & Bitmap)
{
LMemoryFile MemoryFile;
LBuffer Buffer(1000); // 1000 bytes; supposed to be enough
L_UINT32 dwFileSize;
L_INT nRet;

MemoryFile.SetBitmap(&Bitmap);

nRet = MemoryFile.SaveBitmapBuffer(&Buffer,
&dwFileSize,
FILE_TIF,
0,
SAVEFILE_FIXEDPALETTE,
NULL);

if (nRet == SUCCESS)
{
L_TCHAR szFileSize[100];
wsprintf(szFileSize, TEXT("The
 file size in memory is: %d"), dwFileSize);
MessageBox(NULL, szFileSize, TEXT("Testing"),
 MB_OK);
}

return nRet;
}


LMemoryFile::SaveBitmapBufferCallBack

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveBitmapBufferCallBack(pLBuffer, uRequiredSize)

LBuffer * pLBuffer; | /* pointer to an LBuffer object */
L_UINT32 uRequiredSize; | /* buffer size */

This function is called if the buffer of the LBuffer object used by the LMemoryFile::SaveBitmapBuffer function is not large enough to accommodate the file in memory. This function gives the user the opportunity to reallocate the buffer to an adequate size.

Parameter | Description
pLBuffer | Pointer to an LBuffer object into which the bitmap will be saved. This pointer can be used to increase the size of the buffer of the LBuffer object.
uRequiredSize | Minimum buffer size required to save the bitmap or file.

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 provide the LMemoryFile::SaveBitmapBuffer function with a buffer that is large enough to hold the memory file. If the buffer is not large enough and the callback is not used, LMemoryFile::SaveBitmapBuffer will fail.

To use this function, the user must derive a new class from the LMemoryFile class and override this function. The use of this callback function must also be enabled by calling LBase::EnableCallBack .

If the callback successfully reallocates the buffer, it should return SUCCESS.

If the callback fails to successfully reallocate the buffer, it should return FAILURE.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this 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.

See Also

Functions: | LMemoryFile::SaveBitmapBuffer, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

// Derive a new class from LMemoryFile and
// override LMemoryFile::SaveBitmapBufferCallBack
class LUserMemoryFile : public LMemoryFile
{
virtual L_INT SaveBitmapBufferCallBack(LBuffer * pLBuffer,
L_UINT32 uRequiredSize)
{
L_TCHAR szMessage[128];
wsprintf(szMessage, TEXT("Initial LEAD buffer size: %d\n"),
pLBuffer->GetSize());
wsprintf(szMessage, TEXT("%sThe required size: %d"),
szMessage, uRequiredSize);

MessageBox(NULL, szMessage, TEXT("Buffer Info"), MB_OK);

// Try to reallocate the LEAD buffer
L_INT nRet = pLBuffer->Reallocate(uRequiredSize);

if (nRet == SUCCESS)
return SUCCESS;
else
return FAILURE;
}
};

L_INT SaveBitmapBufferSample(LBitmapBase & Bitmap)
{
LUserMemoryFile MemoryFile;
LBuffer Buffer(1000); // 1000 bytes initially
L_UINT32 dwFileSize;

MemoryFile.SetBitmap(&Bitmap);

if (!MemoryFile.IsCallBackEnabled())
MemoryFile.EnableCallBack(TRUE);

return MemoryFile.SaveBitmapBuffer(&Buffer,
&dwFileSize,
FILE_TIF,
0,
QS,
NULL);
}


LMemoryFile::SaveFileBuffer

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveFileBuffer(pLBuffer, puFileSize, nFormat, nBitsPerPixel, nQFactor, uFlags, pSaveOptions)

LBuffer * pLBuffer; | /* pointer to an LBuffer object */
L_UINT32 * puFileSize; | /* pointer to a variable */
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 */
pSAVEFILEOPTION pSaveOptions; | /* pointer to optional extended save options */

Saves the class object's associated bitmap into an LBuffer object. The size of the LBuffer object's buffer must be specified by the user. The output can be in any of the supported, compressed or uncompressed file formats.

Parameter | Description
pLBuffer | Pointer to an LBuffer object into which the bitmap will be saved. Note that if this object's buffer is not large enough to accommodate the file in memory, the LMemoryFile::SaveFileBufferCallBack is called to allow the user to reallocate the buffer.
puFileSize | Pointer to a variable that will contain the size of the file in memory. This is not the final size of the LBuffer buffer, which may be larger than the memory file.
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 LBitmapBase::GetBitsPerPixel gets the value 5, the file will be stored as 24 bit. Likewise, if LBitmapBase::GetBitsPerPixel gets the value 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 LMemoryFile::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 multipage file. It appends the image as the last one in the file. You can save multipage images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).
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

LMemoryFile::SaveFileBuffer saves the class object's associated bitmap to an LBuffer object. The output can be in any of the supported, compressed or uncompressed file formats. The user is responsible for allocating/reallocating buffers. If the buffer of the LBuffer object is not large enough, the LMemoryFile::SaveFileBufferCallBack is called so the user can re-allocate the buffer.

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 LMemoryFile::SaveFileBufferCallBack 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 toolkits.

This function cannot be used in combination with the redirecting I/O functions.

Note: | More options are available in the SAVEFILEOPTION structure.
Note: | FPX, PCD, AWD and AVI files cannot be saved to memory.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this function.

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.

See Also

Functions: | LMemoryFile::SaveBitmapBuffer, LMemoryFile::SaveFileBufferCallBack, LMemoryFile::SaveFileCallBack, LMemoryFile::SaveBitmapBufferCallBack, LMemoryFile::SaveBitmap, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images
 | Saving a Region

Example

L_INT SaveFileBufferSample(LBitmapBase & Bitmap)
{
LMemoryFile MemoryFile;
LBuffer Buffer(1000); // 1000 bytes; supposed to be enough
L_UINT32 dwFileSize;
L_INT nRet;

MemoryFile.SetBitmap(&Bitmap);

nRet = MemoryFile.SaveFileBuffer(&Buffer,
&dwFileSize,
FILE_TIF,
0,
QS,
SAVEFILE_FIXEDPALETTE,
NULL);

if (nRet == SUCCESS)
{
L_TCHAR szFileSize[100];
wsprintf(szFileSize, TEXT("The
 file size in memory is: %d"),
dwFileSize);
MessageBox(NULL, szFileSize, TEXT("Testing"),
 MB_OK);
}

return nRet;
}


LMemoryFile::SaveFileBufferCallBack

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveFileBufferCallBack(pLBuffer, uRequiredSize)

LBuffer * pLBuffer; | /* pointer to an LBuffer object */
L_UINT32 uRequiredSize; | /* buffer size */

This function is called if the buffer of the LBuffer object used by the LMemoryFile::SaveFileBuffer function is not large enough to accommodate the file in memory. This function gives the user the opportunity to reallocate the buffer to an adequate size.

Parameter | Description
pLBuffer | Pointer to an LBuffer object into which the bitmap will be saved. This pointer can be used to increase the size of the buffer of the LBuffer object.
uRequiredSize | Minimum buffer size, in bytes, required to save the bitmap or file.

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 provide the LMemoryFile::SaveFileBuffer function with a buffer that is large enough to hold the memory file. If the buffer is not large enough and the callback is not used, LMemoryFile::SaveFileBuffer will fail.

To use this function, the user must derive a new class from the LMemoryFile class and override this function. The use of this callback function must also be enabled by calling LBase::EnableCallBack .

If the callback successfully reallocates the buffer, it should return SUCCESS.

If the callback fails to successfully reallocate the buffer, it should return FAILURE.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM 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.

See Also

Functions: | LMemoryFile::SaveFileBuffer, LMemoryFile::SaveBitmapBuffer, LMemoryFile::SaveBitmapBufferCallBack, LMemoryFile::SaveFileCallBack, LBase::EnableCallBack, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

// Derive a new class from LMemoryFile and
// override LMemoryFile::SaveFileBufferCallBack
class LUserMemoryFile : public LMemoryFile
{
virtual L_INT SaveFileBufferCallBack(LBuffer * pLBuffer,
L_UINT32 uRequiredSize)
{
L_TCHAR szMessage[128];
wsprintf(szMessage, TEXT("Initial LEAD buffer size: %d\n"),
pLBuffer->GetSize());
wsprintf(szMessage, TEXT("%sThe required size: %d"),
szMessage, uRequiredSize);

MessageBox(NULL, szMessage, TEXT("Buffer Info"), MB_OK);

// Try to reallocate the LEAD buffer
L_INT nRet = pLBuffer->Reallocate(uRequiredSize);

if (nRet == SUCCESS)
return SUCCESS;
else
return FAILURE;
}
};

L_INT SaveFileBufferSample(LBitmapBase & Bitmap)
{
LUserMemoryFile MemoryFile;
LBuffer Buffer(1000); // 1000 bytes initially
L_UINT32 dwFileSize;

MemoryFile.SetBitmap(&Bitmap);

if (!MemoryFile.IsCallBackEnabled())
MemoryFile.EnableCallBack(TRUE);

return MemoryFile.SaveFileBuffer(&Buffer,
&dwFileSize,
FILE_TIF,
0,
QS,
SAVEFILE_FIXEDPALETTE,
NULL);
}


LMemoryFile::SaveFileCallBack

#include "ltwrappr.h"

virtual L_INT LMemoryFile::SaveFileCallBack(pLBitmap, pLBuffer, uRow, uLines)

LBitmapBase *pLBitmap; | /* pointer to an LBitmap object */
LBuffer * pLBuffer; | /* pointer to an LBuffer object */
L_UINT uRow; | /* row number */
L_UINT uLines; | /* number of lines to save */

This function is called by the LMemoryFile::SaveFileBuffer function to save the specified image data.

Parameter | Description
pLBitmap | Pointer to an LBitmapBase object that contains the image data.
pLBuffer | Pointer to an LBuffer object into which the bitmap will be saved.
uRow | Number of the first row of data that the callback will write to the buffer.
uLines | Number of lines that the callback will write to the buffer.

Returns

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

Comments

If this function is overridden, the user must supply the image data that the function will save. The base class implementation saves data from the class object's associated bitmap.

This function does not support signed data images, unless they are DICOM images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image that is not a DICOM image is passed to this 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.

See Also

Functions: | LMemoryFile::SaveFileBuffer, Class Members
Topics: | Raster Image Functions: Saving Files
 | Raster Image Functions: Redirecting Input and Output
 | Raster Image Functions: Input and Output
 | Loading and Saving Images

Example

class LUserMemoryFile : public LMemoryFile
{
virtual L_INT SaveFileCallBack(LBitmapBase * pLBitmap,
LBuffer * pLBuffer,
L_UINT uRow,
L_UINT uLines)
{
L_TCHAR szMessage[64];

wsprintf(szMessage, TEXT("The number of lines is %u."), uLines);
MessageBox(NULL, szMessage, TEXT("Testing"), MB_OK);

return SUCCESS;
}
};

L_INT SaveFileBufferSample(LBitmapBase & Bitmap)
{
LUserMemoryFile MemoryFile;
LBuffer Buffer(1000); // 1000 bytes; supposed to be enough
L_UINT32 dwFileSize;

MemoryFile.SetBitmap(&Bitmap);

if (!MemoryFile.IsCallBackEnabled())
MemoryFile.EnableCallBack(TRUE);

return MemoryFile.SaveFileBuffer(&Buffer,
&dwFileSize,
FILE_TIF,
0,
QS,
SAVEFILE_FIXEDPALETTE,
NULL);
}


LMemoryFile::SetBitmapMemoryInfo

#include "ltwrappr.h"

static L_INT LMemoryFile:: SetBitmapMemoryInfo(pBitmap, uMemory, uTileSize, uTotalTiles, uConvTiles, uMaxTileViews, uTileViews, uFlags)

static L_INT LMemoryFile::SetBitmapMemoryInfo(plBitmap, uMemory, uTileSize, uTotalTiles, uConvTiles, uMaxTileViews, uTileViews, uFlags)

pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
LBitmapBase *plBitmap; | /* pointer to a bitmap class object*/
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.
plBitmap | Pointer to the LBitmapBase object that references the bitmap for which to get the memory information. This bitmap must be allocated and this pointer cannot be NULL.
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. Use one or more values. You can use a bitwise OR ( | ) to combine values. Possible values are:
 | Value | Meaning
 | SETMEM_MEMORY | [0x0001] The uMemory parameter is valid
 | SETMEM_TILESIZE | [0x0002] The uTileSize parameter is valid
 | SETMEM_TOTALTILES | [0x0004] The uTotalTiles parameter is valid
 | SETMEM_CONVTILES | [0x0008] The uConvTiles parameter is valid
 | SETMEM_MAXTILEVIEWS | [0x0010] The uMaxTileViews parameter is valid
 | SETMEM_TILEVIEWS | [0x0020] The uTileViews parameter is valid

Returns

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

Comments

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

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: | LFileSettings::SetTempDirectory, LFileSettings::GetTempDirectory, Class Members
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:
LMemoryFile::SetBitmapMemoryInfo(
pBitmap,
0, // uMemory
0, // uTileSize
0, // uTotalTiles
0, // uConvTiles
(L_UINT)-1, // uMaxTileViews,
(L_UINT)-1, // uTileViews,
SETMEM_MAXTILEVIEWS | SETMEM_TILEVIEWS
);


LMemoryFile::SetMemoryThresholds

#include "ltwrappr.h"

static L_INT LMemoryFile::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. You can use a bitwise OR ( | ) to combine flags 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] The nTiledThreshold parameter is valid.
 | MEM_MAXCONVSIZE | [0x0002] The nMaxConvSize parameter is valid
 | MEM_TILESIZE | [0x0004] The nTileSize parameter is valid
 | MEM_CONVTILES | [0x0008] The nConvTiles parameter is valid
 | MEM_CONVBUFFERS | [0x0010] The nConvBuffers parameter is valid.
 | MEM_ALL | [0x001F] All parameters are valid. You do not need to bitwise 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

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.

See Also

Functions: | LFileSettings::SetTempDirectory, LFileSettings::GetTempDirectory, Class Members
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. */
LMemoryFile::SetMemoryThresholds(-25, 100 *1024 * 1024, 0, 0, 0, MEM_TILEDTHRESHOLD | MEM_MAXCONVSIZE);


LMemoryFile::StartCompressBuffer

#include "ltwrappr.h"

virtual L_INT LMemoryFile::StartCompressBuffer(uInputBytes, uOutputBytes, nOutputType, nQFactor=2, pSaveFileOption=NULL)

L_UINT32 uInputBytes; | /* size of the user allocated buffer that will hold the raw data */
L_UINT uOutputBytes; | /* size of the user allocated compressed buffer */
L_INT nOutputType; | /* type of compression to use */
L_INT nQFactor; | /* quality factor */
pSAVEFILEOPTION pSaveFileOption; | /* pointer to optional extended save options */

Initializes the buffered compression engine. The compression is then carried out using the LMemoryFile::CompressBuffer function. It is ended by the LMemoryFile::EndCompressBuffer function.

Parameter | Description
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.
nOutputType | Type of compression to use. Possible 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:
 | 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.
pSaveFileOption | 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 m_pBitmap 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 LMemoryFile::CompressBuffer. You must override LMemoryFile::CompressBufferCallBack, which will be 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.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Saving Files

Example

// define user LMemoryFile class to override its CallBacks
class LUserMemoryFile : public LMemoryFile
{
public:
LUserMemoryFile () ;
virtual ~LUserMemoryFile () ;
virtual L_INT CompressBufferCallBack(LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer);
};

LUserMemoryFile::LUserMemoryFile()
{

}

LUserMemoryFile::~LUserMemoryFile ()
{
}

L_INT LUserMemoryFile::CompressBufferCallBack(
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer)
{
MessageBox(NULL, TEXT("Here Compress Buffer CallBack"), TEXT("CompressBufferCallBack"), MB_OK);
return SUCCESS ;
}

L_VOID TestCompBuff(LBitmapBase& LeadBitmap)
{
LUserMemoryFile userLeadMemFile ;
LBuffer LeadBuffer ;
L_UINT uLineBytes ;
L_INT i;

userLeadMemFile.SetBitmap(&LeadBitmap) ;
userLeadMemFile.EnableCallBack(TRUE) ;

uLineBytes = LeadBitmap.GetWidth() * 3 ;

// Initialize the compression engine
userLeadMemFile.StartCompressBuffer(16 * uLineBytes,
1024,
LEAD,
QFS,
NULL);

// Compress the data
for( i = 0; i < LeadBitmap.GetHeight(); i++) // i is incremented at the end
{
// Get one line at time
LeadBitmap.GetRow(&LeadBuffer, i);

// This is the main function that will do the actual Compression.
userLeadMemFile.CompressBuffer(&LeadBuffer);
}

// Reset the compression engine
userLeadMemFile.EndCompressBuffer();
}


LMarker::LMarker

#include "ltwrappr.h"

L_VOID LMarker::LMarker(void)

Constructs and initializes the different member variables of the LMarker object.

Returns

None

Comments

LMarker::LMarker() is a constructor for the LMarker class.

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:

LMarker::~LMarker, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LMarker MyMarker;
//…
}


LMarker::~LMarker

#include "ltwrappr.h"

virtual L_VOID LMarker::~LMarker(void)

Destroys the object and frees any resources associated with the object.

Returns

None

Comments

This is the destructor for the LMarker class and will free 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.

See Also

Functions:

LMarker::LMarker, Class Members

Example

For an example, refer to LMarker::LMarker().


LMarker::Copy

#include "ltwrappr.h"

virtual L_INT LMarker::Copy(hMarkerSrc)

virtual L_INT LMarker::Copy(pMarkerSrc)

HANDLE hMarkerSrc; | /* handle to the marker object*/
LMarker *pMarkerSrc; | /* pointer to an LMarker object */

Copies the specified collection of metadata markers to this marker object.

Parameter | Description
hMarkerSrc | Handle to the collection of metadata markers to copy..
pMarkerSrc | Pointer to the LMarker object that contains the collection of metadata markers to be copied.

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.

See Also

Functions: | LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

This is an example for LMarker::Copy(hMarker):

L_INT MyCopy(LMarker *SrcMarkers)
{
HANDLE hMarkerObj;
L_INT nRet;

LMarker MyMarker;

hMarkerObj = SrcMarkers->GetHandle() ;
MyMarker.Copy(hMarkerObj) ;

//...
}

This is an example for LMarker::Copy(LMarker):

L_INT MyCopy(LMarker *SrcMarkers)
{
LMarker MyMarker;

MyMarker.Copy(SrcMarkers) ;

//...
}


LMarker::Create

#include "ltwrappr.h"

virtual L_INT LMarker::Create(void)

Creates an empty marker collection.

Returns

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

Comments

Markers can be added to this collection with LMarker::Insert.

When the marker collection is no longer needed, delete it by calling LMarker::Free.

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: | LMarker::Copy, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

// This example will copy all APPn markers from one marker collection to another
class CMarkerTest : public LMarker
{
private:
virtual L_INT EnumMarkersCallBack(
L_UINT uMarker,
L_UINT uMarkerSize,
L_VOID L_FAR*pMarkerData,
LEADMARKERCALLBACK pfnLEADCallback,
L_VOID L_FAR* pLEADUserData);
// Attributes

};
L_INT MyCopyMarkers(CMarkerTest SrcMarkers, LMarker *DstMarkers)
{
L_INT nRet = DstMarkers->Create();
if(nRet != SUCCESS)
return nRet;

// copy the APPn markers from hSrcMarkers
nRet = SrcMarkers.Enum(0);
if(nRet != SUCCESS)
{
// An error occurred. Free the marker list we have created
DstMarkers->Free();
}

return nRet;
}

L_INT CMarkerTest::EnumMarkersCallBack(L_UINT uMarker,
L_UINT uMarkerSize,
L_VOID L_FAR*pMarkerData,
LEADMARKERCALLBACK pfnLEADCallback,
L_VOID L_FAR* pLEADUserData)
{
if(uMarker >= 0xE0 && uMarker < 0xF0)
{
// just insert all the markers in the destination collection list
// Insert will never return SUCCESS_IGNOREMARKER,
// so the source collection list will not be changed.
return this->Insert(0xFFFFFFFF, uMarker, uMarkerSize, pMarkerData);
}
return SUCCESS;
}


LMarker::Delete

#include "ltwrappr.h"

virtual L_INT LMarker::Delete(uMarker, nCount)

L_UINT uMarker; | /* type of marker */
L_INT nCount; | /* number of markers to delete */

Deletes the specified number of markers of the specified type from the marker collection.

Parameter | Description
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 marker types are allowed.
nCount | Indicates the number of markers to delete. This value is useful only if there is more than one marker of the specified type in the file.
 | 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

#define APP2 0xE2

LMarker MarkerSrc;
MarkerSrc.Load(TEXT("e:\\1.jpg"),0);
MarkerSrc.Delete ( APP2, 0);


LMarker::DeleteIndex

#include "ltwrappr.h"

virtual L_INT LMarker::DeleteIndex(uIndex)

L_UINT uIndex;

/* index of the marker to delete */

Deletes the marker at the specified index from the marker collection.

Parameter | Description
uIndex | Value that represents the index of the marker to delete.

Returns

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

Comments

This function allows you to delete a marker with a certain index, regardless of the marker type.

The marker with the specified index MUST exist. Error ERROR_MARKER_INDEX will be returned if you attempt to delete a marker that does not exist.

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: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

LMarker MarkerSrc;
MarkerSrc.Load(TEXT("e:\\1.jpg"),0);
MarkerSrc.DeleteIndex ( 0);


LMarker::Enum

#include "ltwrappr.h"

virtual L_INT LMarker::Enum(uFlags)

L_UINT uFlags;

/* reserved flag */

Enumerates the markers in the object's marker collection.

Parameter | Description
uFlags | Reserved for future use. Pass 0.

Returns

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

Comments

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 may be different from the contents of the marker collection when LMarker::Enum was called..

This function can also be used to selectively delete markers from the object's marker collection.

LMarker::EnumMarkersCallBack will be called for every marker in the collection. 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 LMarker::EnumMarkersCallBack returns SUCCESS, the marker passed to it will be included in the resulting marker collection by pfnLEADCallback. This resulting marker collection will be contained by this object when the LMarker::Enum 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::Create.


LMarker::EnumMarkersCallBack

#include "ltwrappr.h"

virtual L_INT LMarker::EnumMarkersCallBack (uMarker, uMarkerSize, pMarkerData, pfnLEADCallback, pLEADUserData)

L_UINT uMarker; | /* marker type */
L_UINT uMarkerSize; | /* marker size */
L_VOID L_FAR * pMarkerData; | /* marker data */
LEADMARKERCALLBACK pfnLEADCallback; | /* LEADMARKERCALLBACK callback function */
L_VOID L_FAR * pLEADUserData; | /* pointer to additional parameters */

Handles each marker provided by the calling function LMarker::Enum.

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. Must be between 0 and 0xFFFD.
pMarkerData | A void pointer that you can use to access a variable or structure containing data associated with the marker 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.
pfnLEADCallback | Callback function for writing each enumerated marker. Call this function if you want to insert an extra marker at the current position.
 | LMarker::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 the marker object when the LMarker::Enum 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: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::GetGlobalMarkers, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::Create.


LMarker::Free

#include "ltwrappr.h"

virtual L_INT LMarker::Free ()

Frees all the memory associated with the metadata markers referenced by this marker object.

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 LMarker::Free you want to use the same marker handle to load other metadata markers, use the LMarker::Load function or the LMarker::Create 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::Create.


LMarker::GetCount

#include "ltwrappr.h"

virtual L_UINT LMarker::GetCount()

Gets the number of markers contained in this object's marker collection.

Returns

Returns the number of markers. To determine whether an error occurred, use LBase::GetErrorFromList.

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: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::GetGlobalMarkers.


LMarker::GetGlobalMarkers

#include "ltwrappr.h"

virtual L_INT LMarker::GetGlobalMarkers(uFlags)

L_UINT uFlags;

/* reserved flags */

Gets a copy of the last markers set with LMarker::SetAsGlobalMarkers.

Parameter | Description
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 LMarker::SetAsGlobalMarkers.

When the marker collection handle is no longer needed, use LMarker::Free function to free it.

When calling LMarker::GetGlobalMarkers, the markers object cannot be NULL. However, if no markers have been set using LMarker::SetAsGlobalMarkers, the markers object will be updated with NULL when the function returns.

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: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

LMarker MyMarker;
if(MyMarker.GetGlobalMarkers(0) != SUCCESS)
MessageBox(NULL, TEXT("Error calling LMarker::GetGlobalMarkers!"), TEXT("ERROR"), MB_OK);
else
{
if(MyMarker.GetHandle())
{
MessageBox(NULL, TEXT("You have set markers!"), TEXT("Info"), MB_OK);
MyMarker.Free();
}
else
MessageBox(NULL, TEXT("You have not set any markers!"), TEXT("Info"), MB_OK);
}


LMarker::GetHandle

#include "ltwrappr.h"

virtual HANDLE LMarker::GetHandle()

Gets the handle of the class object's marker collection.

Returns

The handle of the LMarker object's 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::Copy(MarkerSrc).


LMarker::Insert

#include "ltwrappr.h"

virtual L_INT LMarker::Insert (uIndex, uMarker, uMarkerSize, pMarkerData)

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
uIndex | Position in the list at which to insert the marker. Pass uIndex > 0 to insert this marker after the first uIndex markers. 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. The marker data should be at least uMarkerSize bytes.

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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::GetGlobalMarkers, LMarker::Load, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

For an example, refer to LMarker::Create.


LMarker::Load

#include "ltwrappr.h"

virtual L_INT LMarker::Load(pszFilename, uFlags)

LTCHAR L_FAR * pszFilename; | /* file name*/
L_UINT uFlags; | /* reserved flag */

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.
uFlags | Reserved for future use. Pass 0.

Returns

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

Comments

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 LFile::TransformFile. Each retrieved marker is passed to the LFile::TransformFileCallBack function. There is one important difference between the markers passed to LFile::TransformFileCallBack and those loaded with LMarker::Load:

LFile::TransformFileCallBack receives ALL the markers (metadata and image-related markers)

LMarker::Load loads only the metadata markers

To save the collection of metadata markers referenced by this object to a file, call the LMarker::SetAsGlobalMarkers function.

IMPORTANT NOTE:

The comments set with LFileSettings::SetComment will OVERRIDE any comments contained in the metadata markers. For example, if the original file had an author of "Steve" and you call

LFileSettings::SetComment (CMNT_SZAUTHOR, "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.

See Also

Functions:

LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetGlobalMarkers, LMarker::GetHandle, LMarker::Insert, LMarker::SetAsGlobalMarkers, LMarker::SetHandle, LFile::WriteMetaData, LFile::TransformFile, LFile::TransformFileCallBack, Class Members

Example

For an example, refer to LMarker::DeleteIndex.


LMarker::SetAsGlobalMarkers

#include "ltwrappr.h"

virtual L_INT LMarker::SetAsGlobalMarkers(uFlags)

L_UINT uFlags;

/* reserved flags */

Sets the metadata markers to be used in the current thread.

Parameter | Description
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 LMarker::SetAsGlobalMarkers is called again.

A copy of these markers will be used, so you can delete the marker object when LMarker::SetAsGlobalMarkers returns.

Comments set with LFileSettings::SetComment will take precedence over any comments contained in the markers.

Tags set with LFileSettings::SetTag will take precedence over any user-defined tags contained in the markers.

If the LFile::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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::GetGlobalMarkers, LMarker::Insert, LMarker::Load, LMarker::SetHandle, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

L_INT MyFunction(L_TCHAR * pszFile)
{
LMarker MyMarker;
LBitmap Bitmap;
// load metadata info
MyMarker.Load(pszFile, 0);
// load the bitmap
Bitmap.Load(pszFile);
// modify the bitmap. In this case, flip it
Bitmap.Flip();
// set the metadata markers so they are used in the next save
MyMarker.SetAsGlobalMarkers(0);
// save the file
Bitmap.Save(TEXT("FlippedFile.jpg"), FILE_EXIF_JPEG, 0, 2, 0, NULL);
// reset the markers so they are not used for the next save
MyMarker.SetHandle(NULL, TRUE);
MyMarker.SetAsGlobalMarkers(0);
// free memory containing the metadata
MyMarker.Free();

return 0;
}


LMarker::SetHandle

#include "ltwrappr.h"

virtual L_INT LMarker::SetHandle(phMarker, bFreePrev)

HANDLE L_FAR * phMarker; | /* handle to a marker collection */
L_BOOL bFreePrev; | /* flag that indicates whether to free the previous marker */

Attaches a new LEAD marker handle to the LMarker class object

Parameter | Description
phMarker | Pointer to a LEAD marker handle that references the marker collection to be attached to this object. This pointer will be invalidated if the function is successful. Pass NULL if you only want to detach the current marker handle from the marker collection.
bFreePrev | Flag that indicates whether to free the previous marker handle before attaching the new one. Possible values are:
 | Value | Meaning
 | TRUE | Free the previous marker handle before attaching the new one.
 | FALSE | Do not free the previous marker handle before attaching the new one.

Returns

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

Comments

Use this function to attach a new LEAD marker handle to this LMarker class object's 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.

See Also

Functions: | LMarker::Copy, LMarker::Create, LMarker::Delete, LMarker::DeleteIndex, LMarker::Enum, LMarker::EnumMarkersCallBack, LMarker::Free, LMarker::GetCount, LMarker::GetHandle, LMarker::GetGlobalMarkers, LMarker::Insert, LMarker::Load, LMarker::SetAsGlobalMarkers, LFile::WriteMetaData, Class Members
Topics: | Raster Image Functions: Markers
 | Working with Markers

Example

L_INT MyFunction()

{

LMarker MyMarker;

HANDLE SomeMarkerHandle;

MyMarker.Load(TEXT("bitmap1.jpg"), 0);

MyMarker.SetHandle(&SomeMarkerHandle, FALSE);

return 0;

}


LOptimize::LOptimize

#include "ltwrappr.h"

L_VOID LOptimize::LOptimize(L_VOID)

Constructs and initializes the member variables of the LOptimize object.

Returns

None

Comments

This is the constructor for the LOptimize class.

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.

See Also

Functions: | LOptimize::~LOptimize, Class Members
Topics: | Image Optimization

Example

L_VOID TestConstructor()
{
// this will call the default constructor and destructor
 when it is out of scope
LOptimize MyCompressor;
//
...
}


LOptimize::~LOptimize

#include "ltwrappr.h"

L_VOID LOptimize::~LOptimize(L_VOID)

Destroys the LOptimize object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LOptimize class.

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.

See Also

Functions: | LOptimize::LOptimize, Class Members
Topics: | Image Optimization

Example

For an example, refer to LOptimize::LOptimize.


LOptimize::GetDefaultOptions

#include "ltwrappr.h"

L_INT LOptimize::GetDefaultOptions(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 member 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.

See Also

Functions: | LOptimize::OptimizeBuffer, LOptimize::OptimizeBufferCallBack, LOptimize::OptimizeDir, LOptimize::OptimizeDirCallBack, Class Members
Topics: | Image Optimization
 | Raster Image Functions: Optimization Functions

Example

For an example, refer to LOptimize::OptimizeBuffer.


LOptimize::OptimizeBuffer

#include "ltwrappr.h"

L_INT LOptimize::OptimizeBuffer(pOrgImgBuffer, uOrgImgBufferSize, phOptImgBuffer, puOptImgBufferSize, pOptImgOptions)

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 */

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.

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 LOptimize::GetDefaultOptions 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.

See Also

Functions: | LOptimize::GetDefaultOptions, LOptimize::OptimizeDir, LOptimize::OptimizeDirCallBack, LOptimize::OptimizeBufferCallBack, LMemoryFile::SaveBitmap, LMemoryFile::LoadBitmap, Class Members
Topics: | Image Optimization
 | Raster Image Functions: Optimization Functions

Example

L_INT LOptimizeChild::OptimizeBufferCallBack(L_INT
 nPercent)
{
L_TCHAR buf[1024]; // Message buffer

wsprintf(buf, TEXT("%d"), nPercent);
lstrcat(buf, TEXT("% Optimizing ")) ;
MessageBox(NULL, buf, TEXT("Optimizing"), MB_OK
 | MB_ICONINFORMATION);

return SUCCESS;
}

void OptimizeBufferExample()
{
LOptimizeSon opt;
LMemoryFile mfile;
LBuffer buf;
L_INT nRet = 0;
L_UINT32 uOrgImgBufferSize = 0;
L_UCHAR L_FAR * phOrgImgBuffer = NULL;
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;

mfile.SetBitmap(&m_LBitmapWnd);
nRet = mfile.SaveBitmap(
 &buf, FILE_GIF,8,0,NULL) ;

uOrgImgBufferSize = buf.GetSize();

phOrgImgBuffer = (L_UCHAR L_FAR *)GlobalLock(buf.GetHandle());

memset(&OptImgOptions, 0,sizeof(OPTIMIZEIMAGEOPTIONS))
 ;
nRet = opt.GetDefaultOptions(&OptImgOptions,
 sizeof(OPTIMIZEIMAGEOPTIONS));

if(nRet == SUCCESS)
{
//Optimize the image buffer
opt.EnableCallBack(TRUE)
 ;
nRet = opt.OptimizeBuffer(phOrgImgBuffer,
 uOrgImgBufferSize, &hOptImgBuffer, // to be updated.
&uOptImgBufferSize,
 // to be updated.
&OptImgOptions);
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.
FILE*
 fo = fopen("c:\\Optimized.gif","wb");
fwrite(pOptImgBuffer,uOptImgBufferSize,1,fo);
fclose(fo);
//Unlock
 the Memory Buffer.
GlobalUnlock(hOptImgBuffer);
//Free
 the Memory Buffer allocated by OptimizeBuffer function.
GlobalFree(hOptImgBuffer);
}
}
}
buf.Unlock();
buf.Free();
}


LOptimize::OptimizeBufferCallBack

#include "ltwrappr.h"

virtual L_INT LOptimize::OptimizeBufferCallBack(nPercent)

L_INT nPercent;

/* completion percentage for optimizing a buffer.*/

This callback function is called repeatedly by the LOptimize::OptimizeBuffer 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.

Returns

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

Comments

If the callback function returns a failure, the LOptimize::OptimizeBuffer will terminate and return the same error that the callback returned.

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.

See Also

Functions: | LOptimize::OptimizeBuffer, LOptimize::GetDefaultOptions, LOptimize::OptimizeDir, LOptimize::OptimizeDirCallBack, Class Members
Topics: | Image Optimization
 | Raster Image Functions: Optimization Functions

Example

For an example, refer to LOptimize::OptimizeBuffer.


LOptimize::OptimizeDir

#include "ltwrappr.h"

L_INT LOptimize::OptimizeDir(pszOrgDirPath, pszOptDirPath, pOptImgOptions, pszFilesExt, bIncludeSubDirs)

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 */

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 the full path directory of the supported images to optimize.

pszOptDirPath

Character string that contains the 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.

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.

See Also

Functions: | LOptimize::GetDefaultOptions, LOptimize::OptimizeBuffer, LOptimize::OptimizeDirCallBack, LOptimize::OptimizeBufferCallBack, Class Members
Topics: | Image Optimization
 | Raster Image Functions: Optimization Functions

Example

L_INT LOptimizeChild::OptimizeDirCallBack(pOPTIMIZEIMAGEDIRINFO
 pOptImgDirCBInfo)
{
// Check if pOPTIMIZEIMAGEDIRINFO data is a valid pointer
if(pOptImgDirCBInfo)
{
L_TCHAR buf[200]; // Message buffer

switch(pOptImgDirCBInfo->nStatusCode)
{
case OPTIMIZE_DIR_PRE_OPTIMIZINGIMAGE:
 /* Pre Optimizing Image */
{
MessageBox(NULL,
 TEXT("Pre Optimize Image"), TEXT("Note"), MB_OK);
if((pOptImgDirCBInfo->pFileInfo->Format
 == FILE_JPEG) ||
(pOptImgDirCBInfo->pFileInfo->Format
 == FILE_JPEG_411) ||
(pOptImgDirCBInfo->pFileInfo->Format
 == FILE_JPEG_422) ||
(pOptImgDirCBInfo->pFileInfo->Format
 == FILE_EXIF_JPEG_411) ||
(pOptImgDirCBInfo->pFileInfo->Format
 == FILE_EXIF_JPEG_422))
pOptImgDirCBInfo->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"), pOptImgDirCBInfo->nFilePercent,
 pOptImgDirCBInfo->szOrgFileName, pOptImgDirCBInfo->szOptFileName,
 i, pOptImgDirCBInfo->nTotalFolderFilesCount);
MessageBox(NULL,
 buf, TEXT("Optimizing"), MB_OK);

//
 if nFilePercent = 100 increment the counter by 1
if((pOptImgDirCBInfo->nFilePercent
 == 100) && ((i + 1) <= pOptImgDirCBInfo->nTotalFolderFilesCount))
i++;
}
break;

case SUCCESS: /*
 Optimizing operation Successfully done */
{
MessageBox(NULL,
 TEXT("Operation Successfully Done"), TEXT("Optimizing"),
 MB_OK);
}
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!"), pOptImgDirCBInfo->nStatusCode, pOptImgDirCBInfo->szOrgFileName);
if(MessageBox(NULL,
 buf, TEXT("Error"), MB_OKCANCEL|MB_ICONERROR) == IDOK)
return(ERROR_OPT_SKIPIMAGE);
else
return(ERROR_OPT_ABORT);
}
break;
}
}
return SUCCESS;
}

void OptimizeDirExample()
{
pOPTIMIZEIMAGEOPTIONS pOptImgOptions = NULL ;
L_INT nRet ;
LOptimizeChild opt ;
opt.EnableCallBack(TRUE)
 ;
nRet = opt.OptimizeDir(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;*.gif;*.bmp;"), /* optimize all
 images with ext jpg, bmp and bmp only.*/
TRUE /* Optimize or not the sub-dirs.*/);
}


LOptimize::OptimizeDirCallBack

#include "ltwrappr.h"

virtual L_INT LOptimize::OptimizeDirCallBack(pOptImgDirCBInfo)

pOPTIMIZEIMAGEDIRINFO pOptImgDirInfo;

/* pointer to optimization info structure */

Gives the user information about the image(s) being optimized by LOptimize::OptimizeDir.

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.

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 Error 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 LOptimize::OptimizeDir will terminate and return the same error that the callback returned.

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.

See Also

Functions: | LOptimize::OptimizeBuffer, LOptimize::GetDefaultOptions, LOptimize::OptimizeDir, LOptimize::OptimizeBufferCallBack, Class Members
Topics: | Image Optimization
 | Raster Image Functions: Optimization Functions

Example

For an example, refer to LOptimize::OptimizeDir.


LPaint::LPaint

#include "ltwrappr.h"

L_VOID LPaint::LPaint(L_VOID)

L_VOID LPaint::LPaint(pBitmap, hDC)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
HDC hDC; | /* handle of a device context */

Constructs and initializes the different member variables of the LPaint object.

Parameter | Description
pBitmap | Pointer to an allocated bitmap object to be painted.
hDC | Handle of a windows device context to be used for the painting. The mapping mode of the device context must be MM_TEXT.

Returns

None

Comments

LPaint::LPaint() is a constructor for the LPaint class.

LPaint::LPaint(pBitmap, hDC) constructs and initializes an LPaint object with the passed bitmap object pointer and the Windows device context 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.

See Also

Functions:

LPaint::~LPaint, Class Members

Example

This is an example for LPaint::LPaint():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LPaint LeadPaint;

//...
}

This is an example for LPaint::LPaint(pBitmap, hDC):

L_VOID MyFunction(HDC hDC)
{
LBitmapBase LeadBitmap ;

LeadBitmap.Load(TEXT("image1.cmp")) ;
// this will call the default constructor and destructor when it is out of scope
LPaint LeadPaint(&LeadBitmap, hDC) ;

//...
}


LPaint::~LPaint

#include "ltwrappr.h"

virtual L_VOID LPaint::~LPaint(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LPaint class.

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:

LPaint::LPaint, Class Members

Example

For an example, refer to LPaint::LPaint.


LPaint::ColorRgn

#include "ltwrappr.h"

L_INT LPaint::ColorRgn(crRgnColor, pXForm =NULL)

COLORREF crRgnColor; | /* color value */
pRGNXFORM pXForm; | /* pointer to a coordinate translation structure */

Highlights a region by displaying a filled, color representation of the region.

Parameter | Description
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)
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.

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.

See Also

Functions: | LPaint::FrameRgn, Class Members
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
//m_Bitmap is an object of type LBitmap and it contains a valid bitmap

LPaint MyPaint(&m_Bitmap, lpDrawItemStruct->hDC);
MyPaint.PaintDC();

if (m_Bitmap.HasRgn())
{
MyPaint.ColorRgn(RGB(255,0,0), NULL);
}


LPaint::FrameRgn

#include "ltwrappr.h"

virtual L_INT LPaint::FrameRgn(uType, pXForm=NULL)

L_UINT uType; | /* type of frame */
pRGNXFORM pXForm; | /* pointer to a structure */

Displays an outline of the class object's associated bitmap region. If the region includes noncontiguous shapes, each shape is outlined. The outline, itself, is inside the region.

Parameter | Description
uType | The type of frame to display. The following are possible 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]

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.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

L_VOID MyTestFunction(HWND hWnd)
{
LPaint LeadPaint ;
LBitmapRgn LeadRegion;
LBitmapBase LeadBitmap;
RGNXFORM Xform;
HDC hDC;
RECT Rect, rClientArea ;

LeadBitmap.Load(TEXT("image1.cmp")) ;

LeadRegion.SetBitmap(&LeadBitmap) ;

Rect.left = 10 ;
Rect.top = 10 ;
Rect.right = 50 ;
Rect.bottom = 50 ;

LeadRegion.SetRgnRect(&Rect);

hDC = GetDC(hWnd) ;

// Get the client area of the current window
GetClientRect(hWnd,&rClientArea);

LeadRegion.GetRgnXForm(&Xform);
LeadPaint.SetBitmap(&LeadBitmap);
LeadPaint.SetDC(hDC) ;

Xform.uViewPerspective = TOP_LEFT;
Xform.nXScalarNum = LeadBitmap.GetWidth();
Xform.nXScalarDen = rClientArea.right;
Xform.nYScalarNum = LeadBitmap.GetHeight() ;
Xform.nYScalarDen = rClientArea.bottom;
Xform.nXOffset = 0;
Xform.nYOffset = 0;

LeadPaint.FrameRgn(L_FRAME_MOVING0,&Xform) ;

LeadPaint.PaintRgnDC() ;

LeadPaint.SetDC(0) ;
ReleaseDC(hWnd,hDC);
}


LPaint::PaintDC

#include "ltwrappr.h"

virtual L_INT LPaint::PaintDC(uROP3=SRCCOPY)

L_UINT32 uROP3;

/* windows ROP code for display */

Displays the class object's associated bitmap to the current device context (which can be a 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
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 uses the rectangles specified by the following functions:

LBitmapBase::SetSrcRect

LBitmapBase::SetClipSrcRect

LBitmapBase::SetDstRect

LBitmapBase:SetClipDstRect

Scaling of the displayed image depends on the relationship between these two rectangles, as shown in the following illustration.

The mapping mode of this object's device context must be MM_TEXT.

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 do the following:

LBitmapBase::SetSrcRect(NULL); //Use the source default RECTS
LBitmapBase::SetClipSrcRect(NULL); //Use the source default RECTS
LBitmapBase::SetDstRect(prcDst); //Use 0, 0 and bitmap dimensions for the destination RECT
LBitmapBase::SetClipDstRect(prcClipDst); // Use the destination rectangle returned by WM_PAINT

To get the current settings for the display rectangles, call LBitmapBase::GetRects.

If indexed painting is used (see LBitmapBase::SetDisplayMode), then palette colors are not passed to the DC, only the palette indices are passed. Before painting, the right palette must be selected and realized to the DC.

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: | Class Members, LFile::LoadCMYKArray, LFile::SaveCMYKArray, LPaint::PaintDCCMYKArray, LBitmapBase::RectToBitmap, LBitmapBase::RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

L_VOID MyFunction(HDC hDC)
{
LBitmap MyBitmap;

MyBitmap.Load(TEXT("image1.cmp"));
LPaint MyPaint(&MyBitmap,
 hDC);

MyPaint.PaintDC();
}


LPaint::PaintDCBuffer

#include "ltwrappr.h"

virtual L_INT LPaint::PaintDCBuffer(LBuff, nRow, nCount=1, uROP3=SRCCOPY)

LBuffer& LBuff; | /* an LBuffer object that contains the data to paint */
L_INT nRow; | /* first row to paint */
L_INT nCount; | /* number of rows to paint */
L_UINT32 uROP3; | /* windows ROP code for display */

Paints image data into a device context from a buffer.

Parameter | Description
LBuff | A LEAD buffer of type LBuffer that contains the image data to paint.
nRow | The first row to paint. The painted portion of any row may be limited by the bitmap object rectangles.
nCount | The number of rows to paint. The painted portion of any row may be limited by the bitmap object rectangles.. If the image data in LBuff 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.
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 references a LEAD bitmap object, which may or may not have a loaded bitmap. In either case, the following fields must be specified in the LEAD bitmap object:

The Width, Height, BitsPerPixel, Order, and ViewPerspective fields must all be set to the correct values for the image. (You can use the LBitmapBase::Initialize function to set the values.)

The Palette for the bitmap object must be a valid palette (an array of RGBQUAD values). You can create or update the palette using the LBitmapBase::PutColors() function.

Except for the buffer specifications, this function uses source and destination rectangles the same as LPaint::PaintDC. For a complete explanation, refer to LPaint::PaintDC.

You can call LPaint::PaintDCBuffer from a callback function to paint an image while a bitmap is being loaded. This technique is used through the LFile load callback functions.

The LBuff parameter is passed by reference, and is a required parameter.

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: | Class Members, LBitmapBase::RectToBitmap, LBitmapBase::RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Handling Palette Changes

Example

L_VOID TestPaintBuffer(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaint LeadPaint(&LeadBitmap,hDC);
L_INT i,nBytesPerLine;

nBytesPerLine = LeadBitmap.GetBytesPerLine() ;

LBuffer LeadBuffer((DWORD)nBytesPerLine) ;

for(i=0;i<LeadBitmap.GetHeight();i++)
{
LeadBitmap.GetRow(&LeadBuffer,i) ;
LeadPaint.PaintDCBuffer(LeadBuffer,i) ;
}
}


LPaint::PaintDCCMYKArray

#include "ltwrappr.h"

L_INT LPaint::PaintDCCMYKArray(ppBitmapArray, uBitmapArrayCount, pSrc, pClipSrc, pDst, pClipDst, uROP3, hClrHandle)

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
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 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 LFile::LoadCMYKArray.

For more information on how the source and rectangle parameters behave, refer to the function LPaint::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.

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.

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.

See Also

Functions: | LPaint::PaintDC, LFile::LoadCMYKArray, LBitmap::ColorMerge, LBitmap::ColorSeparate, LBuffer::ConvertColorSpace
Topics: | Handling CMYK Files as Separate Bitmaps
 | Raster Image Functions: Displaying Images

Example

void PaintDCCMYKArrayExample()
{
/* 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 */
L_INT nRet;
FILEINFO FileInfo;
LFile file, fileRes ;
RECT rcDst;
LPaint paint ;
CDC* pdc ; // get the window DC
pdc = this->GetDC();
LBitmap CMYKBitmapsArray[4];
pBITMAPHANDLE CMYKHandlesArray[4] = {CMYKBitmapsArray[0].GetHandle(),
 CMYKBitmapsArray[1].GetHandle(),
CMYKBitmapsArray[2].GetHandle(), CMYKBitmapsArray[3].GetHandle()};

file.SetFileName(TEXT("C:\\TIFF24UncompressedCMYK.tif"))
 ;
memset(&FileInfo, 0,sizeof(FileInfo)) ;
nRet = file.GetInfo(&FileInfo,
 sizeof(FileInfo), 0, NULL);
if(nRet != SUCCESS)
{
MessageBox(TEXT("Invalid source
 file"), TEXT("Error"), MB_OK);
return ;
}

nRet = file.LoadCMYKArray(CMYKHandlesArray,
 4, sizeof(BITMAPHANDLE), 8,
LOADFILE_ALLOCATE|LOADFILE_STORE, NULL, NULL/*&FileInfo*/);
if(nRet != SUCCESS)
{
MessageBox(TEXT("LoadCMYKArray
 failed!"), TEXT("Error"), MB_OK);
return ;
}

// set the destination rect to be the same as each plane
 (100% zoom)
SetRect(&rcDst, 0, 0, CMYKBitmapsArray[0].GetHandle()->Width,
 CMYKBitmapsArray[0].GetHandle()->Height);

paint.SetDC(pdc->GetSafeHdc()) ;
nRet = paint.PaintDCCMYKArray(CMYKHandlesArray,
 4, NULL, NULL, &rcDst, NULL, SRCCOPY, NULL);
// release the DC
ReleaseDC(pdc);

// free the CMYK array allocated by LoadCMYKArray
for(L_INT u = 0; u < 4; u++)
{
L_TCHAR s[_MAX_PATH];
wsprintf(s, TEXT("c:\\plane%d.tif"),
 u);
nRet = CMYKBitmapsArray[u].Save(s,
 FILE_TIF, 0, 2, 0,NULL);
nRet = CMYKBitmapsArray[u].Free();
}
MessageBox(TEXT("Done")) ;
}


LPaint::PaintDCOverlay

#include "ltwrappr.h"

virtual L_INT LPaint::PaintDCOverlay (nIndex, uROP3=SRCCOPY)

HDC hDC; | /* handle to the target device context */
L_INT nIndex; | /* the index of the overlay bitmap used for painting */
LPRECT pSrc; | /* the source rectangle */
LPRECT pClipSrc; | /* the source clipping rectangle */
LPRECT pDst; | /*the destination rectangle */
LPRECT pClipDst; | /* the destination clipping rectangle */
L_UINT32 uROP3; | /* windows ROP code for display*/

Paints a particular overlay. 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, in pBitmap coordinates, not in overlay coordinates. 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, in pBitmap coordinates, not in overlay coordinates. 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, in pBitmap coordinates, not in overlay coordinates. 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, in pBitmap coordinates, not in overlay coordinates. 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 LPaint::PaintDC. LPaint::PaintDC will paint all the overlays that have the AutoRepaint flag attribute set. 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, if you want to change the order in which the overlays are painted, you can disable their AutoRepaint flag and call LPaint::PaintDCOverlay directly.

Another situation in which you might want to call this function is when you want to temporarily make an overlay top-most. In this case, you would call LPaint::PaintDCOverlay after LPaint::PaintDC. To permanently make an overlay top-most, it is recommended you change its index and give it the highest defined index.

The overlay bitmap’s 1 pixels are painted with the overlay Color. The overlay bitmap’s 0 pixels are considered transparent.

For more information on the overlay attributes (including the AutoRepaint flag and the Color), see the Overlay Overview topic.

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: | LBitmap::BricksTexture, LBitmap::Canvas, LBitmap::DisplaceMap, LBitmap::Fragment, LBitmap::Vignette, LBitmap::SetOverlay, LBitmap::GetOverlay, Class Members, Class Members
Topics: | Raster Image Functions: Doing Geometric Transformations
 | Resizing Considerations
 | Overlay Overview

Example

/* This example assumes plBitmap contains overlays. It will make it look as if overlay 0 is topmost */
/* The example also assumes hDC and pDest have been initialized elsewhere */
LPaint MyPaint(plBitmap, hDC);
MyPaint.PaintDC(SRCCOPY);
MyPaint.PaintDCOverlay(0, SRCCOPY);
/* Now overlay 0 is topmost (it covers all the other overlays) */


LPaint::PaintRgnDC

#include "ltwrappr.h"

virtual L_INT LPaint::PaintRgnDC(uROP3=SRCCOPY)

L_UINT32 uROP3;

/* windows ROP code for display */

Paints the class object's associated bitmap region to a device context. This function works the same as LPaint::PaintDC, except that only the bitmap region is painted.

Parameter | Description
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

The mapping mode of this object's device context must be MM_TEXT.

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: | Class Members, LBitmapBase::RectToBitmap, LBitmapBase::RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes
 | Implementing Transparency

Example

For an example, refer to LPaint::FrameRgn.


LPaint::PaintRgnDCBuffer

#include "ltwrappr.h"

virtual L_INT LPaint::PaintRgnDCBuffer(LBuff, nRow, nCount=1, uROP3=SRCCOPY)

LBuffer& LBuff; | /* an LBuffer object */
L_INT nRow; | /* first row to paint */
L_INT nCount; | /* number of rows to paint */
L_UINT32 uROP3; | /* windows ROP code for display */

Paints image data into a device context from a buffer. This function works the same as LPaint::PaintDCBuffer, except that only the bitmap region is painted.

Parameter | Description
LBuff | A LEAD buffer of type LBuffer that contains the image data to paint.
nRow | The first row to paint. The painted portion of any row may be limited by the bitmap object rectangles.
nCount | The number of rows to paint. The painted portion of any row may be limited by the bitmap object rectangles.
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

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.

The LBuff parameter is passed by reference, and is a required parameter.

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: | Class Members, LBitmapBase::RectToBitmap, LBitmapBase::RectFromBitmap
Topics: | Raster Image Functions: Displaying Images
 | Raster Image Functions: Palettes
 | Defining and Using a Bitmap Region
 | Handling Palette Changes

Example

L_VOID TestPaintRgnBuffer(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaint LeadPaint(&LeadBitmap,hDC);
LBitmapRgn LeadRegion;
L_INT i,nBytesPerLine ;
RECT Rect ;

Rect.left = 10 ;
Rect.top = 10 ;
Rect.right = 50 ;
Rect.bottom = 50 ;

LeadRegion.SetBitmap(&LeadBitmap) ;
LeadRegion.SetRgnRect(&Rect);

nBytesPerLine = LeadBitmap.GetBytesPerLine() ;
LBuffer LeadBuffer((DWORD)nBytesPerLine);

for (i=0;i<LeadBitmap.GetHeight();i++)
{
LeadBitmap.GetRow(&LeadBuffer,i) ;
LeadPaint.PaintRgnDCBuffer(LeadBuffer,i) ;
}
}


LPaintEffect::LPaintEffect

#include "ltwrappr.h"

L_VOID LPaintEffect::LPaintEffect(L_VOID)

L_VOID LPaintEffect::LPaintEffect(pEfxDlgParm)

L_VOID LPaintEffect::LPaintEffect(pGradDlgParm)

L_VOID LPaintEffect::LPaintEffect(pShapeDlgParm)

L_VOID LPaintEffect::LPaintEffect(pTextDlgParm)

L_VOID LPaintEffect::LPaintEffect(pTransDlgParm)

LPEFFECTDLGPARAMS pEfxDlgParm; | /* pointer to a paint effects structure*/
LPGRADIENTDLGPARAMS pGradDlgParm; | /* pointer to a gradient structure */
LPSHAPEDLGPARAMS pShapeDlgParm; | /* pointer to a shape structure */
LPTEXTDLGPARAMS pTextDlgParm; | /* pointer to a text structure */
LPTRANSITIONDLGPARAMS pTransDlgParm; | /* pointer to a transition structure */

Constructs and initializes the different member variables of the LPaintEffect object.

Parameter | Description
pEfxDlgParm | Pointer to a structure of type EFFECTDLGPARAMS that contains the paint effects parameters.
pGradDlgParm | Pointer to a structure of type GRADIENTDLGPARAMS that contains the gradient parameters.
pShapeDlgParm | Pointer to a structure of type SHAPEDLGPARAMS that contains the shape parameters.
pTextDlgParm | Pointer to a structure of type TEXTDLGPARAMS that contains the text parameters.
pTransDlgParm | Pointer to a structure of type TRANSITIONDLGPARAMS that contains the transition parameters.

Returns

None

Comments

LPaintEffect::LPaintEffect() is a constructor for the LPaintEffect class.

LPaintEffect::LPaintEffect(pGradDlgParm) will initialize the LPaintEffect object data members for the gradient drawing with the passed parameters.

LPaintEffect::LPaintEffect(pShapeDlgParm) will initialize the LPaintEffect object data members for the shape drawing with the passed parameters.

LPaintEffect(pTextDlgParm) will initialize the LPaintEffect object data members for the text drawing with the passed parameters.

LPaintEffect::LPaintEffect(pTransDlgParm) will initialize the LPaintEffect object data members for the transition drawing with the passed parameters.

LPaintEffect::LPaintEffect(pEfxDlgParm) will initialize the LPaintEffect object data members for painting effects with the passed parameters.

Required DLLs and Libraries

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

See Also

Functions:

LPaintEffect::~LPaintEffect, Class Members

Example

This is an example for LPaintEffect::LPaintEffect():

L_VOID MyFunction()
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEffect;

//...
}

This is an example for LPaintEffect::LPaintEffect(pGradDlgParm):

L_VOID MyFunction(GRADIENTDLGPARAMS GradDlgParm)
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEfx(&GradDlgParm);

//...
}

This is an example for LPaintEffect::LPaintEffect(pShapeDlgParm):

L_VOID MyFunction(SHAPEDLGPARAMS ShapeDlgParm)
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEfx(&ShapeDlgParm);

//...
}

This is an example for LPaintEffect(pTextDlgParm):

L_VOID MyFunction(TEXTDLGPARAMS TextDlgParm)
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEfx(&TextDlgParm);

//...
}

This is an example for LPaintEffect(pTransDlgParm):

L_VOID MyFunction(TRANSITIONDLGPARAMS TransDlgParm)
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEfx(&TransDlgParm);

//...
}

This is an example for LPaintEffect(pEfxDlgParm):

L_VOID MyFunction(EFFECTDLGPARAMS EfxDlgParm)
{
// this will call the default constructor and destructor when it is out of scope
LPaintEffect LeadPaintEfx(&EfxDlgParm);

//...
}


LPaintEffect::~LPaintEffect

#include "ltwrappr.h"

virtual L_VOID LPaintEffect::~LPaintEffect(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LPaintEffect class.

Required DLLs and Libraries

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

See Also

Functions:

Class Members

Example

For an example, refer to LPaintEffect::LPaintEffect.


LPaintEffect::Draw3dShape

#include "ltwrappr.h"

virtual L_INT LPaintEffect::Draw3dShape(pRect, hRgn)

virtual L_INT LPaintEffect::Draw3dShape(pRect, uShape)

LPRECT pRect; | /* the bounding rectangle */
HRGN hRgn; | /* handle to a windows region */
L_UINT uShape; | /* the shape type */

Draws a 3D shape to the class object's associated device context.

Parameter | Description
pRect | The bounding rectangle.
hRgn | Handle to a Windows region that defines the shape.
uShape | The shape type. For possible values, refer to Effect Shapes.

Returns

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

Comments

Use the background bitmap to place an image from another device context into the background of the shape.

Use LPaintEffect::SetShapeParameters to control the properties of the 3d shape.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::SetFillBitmap.


LPaintEffect::Draw3dText

#include "ltwrappr.h"

virtual L_INT LPaintEffect::Draw3dText(pRect, pszText, nAngle)

LPRECT pRect; | /* the bounding rectangle */
L_TCHAR L_FAR * pszText; | /* text string */
L_INT nAngle; | /* the angle of the text */

Draws three-dimensional text into the associated device context.

Parameter | Description
pRect | The bounding rectangle.
pszText | Text string.
nAngle | The angle of the text, in tenths of degrees.

Returns

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

Comments

If the current font is a TrueType font, you can rotate the text by specifying the angle.

Use LPaintEffect::SetTextParameters to control the properties of the 3d text.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestText(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
TEXTDLGPARAMS TextDlgParm;
RECT Rect;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetTextParameters(&TextDlgParm);

TextDlgParm.nAngle = 30;
TextDlgParm.uStyle = EFX_TEXT_RAISEDHEAVY;
TextDlgParm.bWordWrap = TRUE;
TextDlgParm.hFont = (HFONT)GetStockObject(SYSTEM_FONT);
TextDlgParm.bUseForeImage = TRUE ;

LeadPaintEffect.SetTextParameters(&TextDlgParm);

Rect.left = 50 ;
Rect.top = 50 ;
Rect.right = 200 ;
Rect.bottom = 200 ;

LeadPaintEffect.Draw3dText(&Rect,TEXT("LEADTOOLS"),30);
LeadPaintEffect.SetDC(0) ;
}


LPaintEffect::DrawFrame

#include "ltwrappr.h"

virtual L_INT LPaintEffect::DrawFrame(pRect, uFrameStyle=EFX_FRAME_OUTER_RAISED|EFX_FRAME_ADJUST_RECT)

LPRECT pRect; | /* the bounding rectangle */
L_UINT uFrameStyle; | /* type of frame style */

Draws a rectangular frame with the specified style into the associated device context.

Parameter | Description
pRect | The bounding rectangle.
uFrameStyle | Type of frame style to draw. Possible values are:
 | 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

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestEffectFunction(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect ;
RECT Rect ;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC);

if (LeadPaintEffect.GetBackgroundColor() != RGB(0,255,0))
LeadPaintEffect.SetBackgroundColor(RGB(0,255,0)) ;

if (LeadPaintEffect.GetForegroundColor() != RGB(255,255,0))
LeadPaintEffect.SetForegroundColor(RGB(255,255,0)) ;

if (LeadPaintEffect.GetMiddleBandColor() != RGB(255,0,0))
LeadPaintEffect.SetMiddleBandColor(RGB(255,0,0)) ;

if (LeadPaintEffect.GetMiddleBandWidth() != RGB(255,10,0))
LeadPaintEffect.SetMiddleBandWidth(RGB(255,10,0)) ;

if (LeadPaintEffect.GetOuterBandWidth() != 3)
LeadPaintEffect.SetOuterBandWidth(3) ;

if (LeadPaintEffect.GetOuterBandShadowColor() != RGB(255,255,255))
LeadPaintEffect.SetOuterBandShadowColor(RGB(255,255,255)) ;

if (LeadPaintEffect.GetOuterBandHilite() != RGB(255,0,255))
LeadPaintEffect.SetOuterBandHilite(RGB(255,0,255)) ;

if (LeadPaintEffect.GetInnerBandWidth() != 3)
LeadPaintEffect.SetInnerBandWidth(3) ;

if (LeadPaintEffect.GetInnerBandShadowColor() != RGB(255,255,255))
LeadPaintEffect.SetOuterBandShadowColor(RGB(255,255,255)) ;

if (LeadPaintEffect.GetInnerBandHilite() != RGB(255,0,255))
LeadPaintEffect.SetInnerBandHilite(RGB(255,0,255)) ;

Rect.left = 50 ;
Rect.top = 50 ;
Rect.right = 200 ;
Rect.bottom = 200 ;

LeadPaintEffect.DrawFrame(&Rect);
LeadPaintEffect.DrawPattern(&Rect,EFX_PATTERN_HORZ_LINE);
}


LPaintEffect::DrawGradient

#include "ltwrappr.h"

virtual L_INT LPaintEffect::DrawGradient(pRect, uStyle)

LPRECT pRect; | /* the bounding rectangle */
L_UINT uStyle; | /* the gradient style */

Draws a rectangle into the target device context, and then fills the rectangle with a gradient.

Parameter | Description
pRect | The bounding rectangle.
uStyle | The gradient style. For possible values, refer to Effect Gradient Styles.

Returns

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

Comments

Use LPaintEffect::SetGradientParameters to control the properties of the gradient.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestGradient(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect ;
GRADIENTDLGPARAMS GradDlgParm;
RECT Rect ;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetGradientParameters(&GradDlgParm) ;

GradDlgParm.uSteps = 3 ;

LeadPaintEffect.SetGradientParameters(&GradDlgParm) ;

Rect.left = 0 ;
Rect.top = 0 ;
Rect.right = LeadBitmap.GetWidth() ;
Rect.bottom = LeadBitmap.GetHeight() ;

LeadPaintEffect.DrawGradient(&Rect,EFX_GRADIENT_CONE_FROM_RB) ;
LeadPaintEffect.SetDC(0);
}


LPaintEffect::DrawPattern

#include "ltwrappr.h"

virtual L_INT LPaintEffect::DrawPattern(pRect, uStyle)

LPRECT pRect; | /* the bounding rectangle */
L_UINT uStyle; | /* the pattern style */

Draws a rectangle into the target device context, and then fills the rectangle with the specified pattern.

Parameter | Description
pRect | The bounding rectangle.
uStyle | The pattern style. Possible values are:
 | 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)

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::EffectBlt

#include "ltwrappr.h"

virtual L_INT LPaintEffect::EffectBlt(nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, uEffect, nSpeed, nCycles, uPass, uMaxPass, uROP=SRCCOPY)

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_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_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 the class object's associated device context, while applying a special effect.

Parameter | Description
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.
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.
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 LPaintEffect::SetEffectParameters to control the properties of the paint effect.

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.

The nSpeed and nCycles parameters have effect only if the uEffect parameter is from the Wave class.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Effect Types

Example

L_VOID TestEffect(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
EFFECTDLGPARAMS EfxDlgParm;
HDC hdcSrc;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetEffectParameters(&EfxDlgParm) ;

EfxDlgParm.uDelay = 10;
EfxDlgParm.bTransparent = TRUE;
EfxDlgParm.crTransparent = RGB(10,0,255);

LeadPaintEffect.SetEffectParameters(&EfxDlgParm) ;

hdcSrc = CreateCompatibleDC(hDC);

// Paint the image using EffectBlt in 3 steps
LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0,
EFX_EFFECT_WIPE_L_TO_R, 0, 0, 1,3);

LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0,
EFX_EFFECT_WIPE_R_TO_L, 0, 0,2,3);

LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0,
EFX_EFFECT_WIPE_L_TO_R, 0, 0,3,3);

LeadPaintEffect.SetDC(0) ;
DeleteDC(hdcSrc);
}

/* This example shows how to use LPaintEffect::EffectBlt with wave effect */
L_VOID TestEffect(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
EFFECTDLGPARAMS EfxDlgParm;
HDC hdcSrc;

LeadPaintEffect.SetBitmap (&LeadBitmap) ;
LeadPaintEffect.SetDC (hDC) ;

LeadPaintEffect.GetEffectParameters (&EfxDlgParm) ;

EfxDlgParm.uDelay = 10;
EfxDlgParm.bTransparent = TRUE;
EfxDlgParm.crTransparent = RGB(10,0,255);

LeadPaintEffect.SetEffectParameters (&EfxDlgParm) ;

hdcSrc = CreateCompatibleDC(hDC);

// Paint the image using EffectBlt in 3 steps
LeadPaintEffect.EffectBlt(0,0,LeadBitmap.GetWidth(),LeadBitmap.GetHeight(),hdcSrc,0,0,
EFX_EFFECT_WIPE_L_TO_R, 20, 1, 1,3);

LeadPaintEffect.SetDC (0) ;
DeleteDC(hdcSrc);
}


LPaintEffect::GetBackgroundColor

#include "ltwrappr.h"

COLORREF LPaintEffect::GetBackgroundColor(L_VOID)

Gets the background color that will be used in the drawing functions.

Returns

The background color.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetEffectParameters

#include "ltwrappr.h"

L_INT LPaintEffect::GetEffectParameters(pEfxDlgParm)

LPEFFECTDLGPARAMS pEfxDlgParm;

/* pointer to a paint effects structure */

Gets the current paint effects parameters.

Parameter | Description
pEfxDlgParm | Pointer to a structure of type EFFECTDLGPARAMS to be updated with the paint effects parameters.

Returns

None

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::PaintBitmap.


LPaintEffect::GetFillBitmap

#include "ltwrappr.h"

LBitmapBase L_FAR * LPaintEffect::GetFillBitmap(L_VOID)

Retrieves the background bitmap.

Returns

A pointer to the background bitmap that was set using LPaintEffect::SetFillBitmap.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::SetFillBitmap.


LPaintEffect::GetForegroundColor

#include "ltwrappr.h"

COLORREF LPaintEffect::GetForegroundColor(L_VOID)

Gets the foreground color that will be used in the drawing functions.

Returns

The foreground color.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetGradientParameters

#include "ltwrappr.h"

L_INT LPaintEffect::GetGradientParameters(pGradDlgParm)

LPGRADIENTDLGPARAMS pGradDlgParm;

/* pointer to a gradient structure */

Gets the current gradient parameters.

Parameter | Description
pGradDlgParm | Pointer to a structure of type GRADIENTDLGPARAMS that contains the gradient parameters.

Returns

None

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawGradient.


LPaintEffect::GetInnerBandHilite

#include "ltwrappr.h"

COLORREF LPaintEffect::GetInnerBandHilite(L_VOID)

Gets the highlight color for the inner band that will be used in the drawing functions.

Returns

The highlight color for the inner band.

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetInnerBandShadowColor

#include "ltwrappr.h"

COLORREF LPaintEffect::GetInnerBandShadowColor(L_VOID)

Gets the shadow color for the inner band that will be used in the drawing functions.

Returns

The shadow color for the inner band.

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetInnerBandWidth

#include "ltwrappr.h"

L_UINT LPaintEffect::GetInnerBandWidth(L_VOID)

Gets the inner band width that will be used in the drawing functions.

Returns

The inner band width.

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetMiddleBandColor

#include "ltwrappr.h"

COLORREF LPaintEffect::GetMiddleBandColor(L_VOID)

Gets the middle band color that will be used in the drawing functions.

Returns

The middle band color.

Comments

The middle band is used only when drawing 3d Frames.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetMiddleBandWidth

#include "ltwrappr.h"

L_UINT LPaintEffect::GetMiddleBandWidth(L_VOID)

Gets the middle band frame width that will be used in the drawing functions.

Returns

The middle band frame width.

Comments

The middle band is used only when drawing 3d Frames.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetOuterBandHilite

#include "ltwrappr.h"

COLORREF LPaintEffect::GetOuterBandHilite(L_VOID)

Gets the outer band highlight color that will be used in the drawing functions.

Returns

The outer band highlight color.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetOuterBandShadowColor

#include "ltwrappr.h"

COLORREF LPaintEffect::GetOuterBandShadowColor(L_VOID)

Gets the outer band shadow color that will be used in the drawing functions.

Returns

The outer band shadow color.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetOuterBandWidth

#include "ltwrappr.h"

L_UINT LPaintEffect::GetOuterBandWidth(L_VOID)

Gets the outer band width that will be used in the drawing functions.

Returns

The outer band width.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::GetShapeParameters

#include "ltwrappr.h"

L_INT LPaintEffect::GetShapeParameters(pShapeDlgParm)

LPSHAPEDLGPARAMS pShapeDlgParm;

/* pointer to a shape structure */

Gets the current shape parameters.

Parameter | Description
pShapeDlgParm | Pointer to a structure of type SHAPEDLGPARAMS to be updated with the shape parameters.

Returns

None

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::SetShapeParameters.


LPaintEffect::GetTextParameters

#include "ltwrappr.h"

L_INT LPaintEffect::GetTextParameters(pTextDlgParm)

LPTEXTDLGPARAMS pTextDlgParm;

/* pointer to a text structure */

Gets the current text parameters.

Parameter | Description
pTextDlgParm | Pointer to a structure of type TEXTDLGPARAMS to be updated with the text parameters.

Returns

None

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::Draw3dText.


LPaintEffect::GetTransitionParameters

#include "ltwrappr.h"

L_INT LPaintEffect::GetTransitionParameters(pTransDlgParm)

LPTRANSITIONDLGPARAMS pTransDlgParm;

/* pointer to a transition structure */

Gets the current transition parameters

Parameter | Description
pTransDlgParm | Pointer to a structure of type TRANSITIONDLGPARAMS to be updated with the transition parameters.

Returns

None

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::PaintTransition.


LPaintEffect::PaintBitmap

#include "ltwrappr.h"

virtual L_INT LPaintEffect::PaintBitmap(uEffect, nSpeed, nCycles , uPass, uMaxPass, uROP3=SRCCOPY)

L_UINT uEffect; | /* effect to apply when painting */
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_UINT32 uROP3; | /* Windows ROP code for display */

Applies an effect when painting the class object's associated bitmap to the class object's associated 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
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
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.
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

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::StatusCallback.

Use LPaintEffect::SetEffectParameters to control the properties of the paint effect.

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.

The nSpeed and nCycles parameters have effect only if the uEffect parameter is from the Wave class.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Effect Types

Example

L_VOID TestEfxFunction(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
EFFECTDLGPARAMS EfxDlgParm;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetEffectParameters(&EfxDlgParm) ;

EfxDlgParm.uGrain = 5;
EfxDlgParm.bTransparent = TRUE;
EfxDlgParm.crTransparent = RGB(10,0,255);

LeadPaintEffect.SetEffectParameters(&EfxDlgParm) ;

LeadPaintEffect.PaintBitmap(EFX_EFFECT_WIPE4_L_R_T_B, 0,0, 1,3) ;
LeadPaintEffect.PaintBitmap(EFX_EFFECT_WIPE_RECTANGLE_IN, 0,0, 2,3) ;
LeadPaintEffect.PaintBitmap(EFX_EFFECT_WIPE_RECTANGLE_OUT, 0,0, 3,3) ;

LeadPaintEffect.SetDC(0) ;
}


LPaintEffect::PaintRgnDCEffect

#include "ltwrappr.h"

virtual L_INT LPaintEffect::PaintRgnDCEffect(uEffect=EFX_EFFECT_NONE, uROP3=SRCCOPY)

L_UINT uEffect; | /* effect to apply when painting */
L_UINT32 uROP3; | /* Windows ROP code for display */

Applies an effect when painting the class object's associated bitmap to the class object's associated device context.

Parameter | Description
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
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
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.

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestPaintRgnEfx(HWND hWnd)
{
LBitmapBase LeadBitmap;
LBitmapRgn LeadRegion;
LPaintEffect LeadPaintEffect ;
HDC hDC ;
RECT Rect ;

LeadBitmap.Load(TEXT("image1.cmp")) ;

Rect.left = 10 ;
Rect.top = 10 ;
Rect.right = 50 ;
Rect.bottom = 50 ;

LeadRegion.SetBitmap(&LeadBitmap) ;
LeadRegion.SetRgnRect(&Rect);

hDC = GetDC(hWnd);

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.PaintRgnDCEffect(EFX_EFFECT_WIPE_L_TO_R) ;

LeadPaintEffect.SetDC(0) ;
ReleaseDC(hWnd,hDC) ;
}


LPaintEffect::PaintTransition

#include "ltwrappr.h"

virtual L_INT LPaintEffect::PaintTransition(pRect, uTransition, uEffect=EFX_EFFECT_WIPE_L_TO_R, nSpeed = 0, nCycles = 0, uPass=1, uMaxPass=1, uROP=SRCCOPY)

LPRECT pRect; | /* the bounding rectangle */
L_UINT uTransition; | /* the filling style */
L_UINT uEffect; | /* the effect to apply when painting */
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_UINT32 uROP; | /* windows ROP code for display */

Draws a rectangle into the associated device context with the specified fill pattern while using a special effect.

Parameter | Description
pRect | The bounding rectangle.
uTransition | Filling style used during transition. For valid values, refer to Effect Transition Filling Styles.
uEffect | Effect to apply when painting. For valid values, refer to Effect Types.
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.
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 LPaintEffect::SetTransitionParameters to control the properties of the transition.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Effect Types

Example

L_VOID TestTransition(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
TRANSITIONDLGPARAMS TransDlgParm;
RECT Rect;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetTransitionParameters(&TransDlgParm) ;

TransDlgParm.uGrain = 5;
TransDlgParm.uDelay = 10;
TransDlgParm.bTransparent = TRUE;
TransDlgParm.crTransparent = RGB(10,0,255);

LeadPaintEffect.SetTransitionParameters(&TransDlgParm) ;

Rect.left = 50 ;
Rect.top = 50 ;
Rect.right = 200 ;
Rect.bottom = 200 ;

LeadPaintEffect.PaintTransition(&Rect,EFX_TRANS_GRADIENT_LINE_T_TO_B,
EFX_EFFECT_WIPE_RECTANGLE_IN, 0,0, 1,3);

LeadPaintEffect.PaintTransition(&Rect,EFX_TRANS_GRADIENT_LINE_T_TO_B,
EFX_EFFECT_WIPE_RECTANGLE_OUT, 0,0,2,3);

LeadPaintEffect.PaintTransition(&Rect,EFX_TRANS_GRADIENT_LINE_T_TO_B,
EFX_EFFECT_WIPE_RECTANGLE_IN, 0,0,3,3);

LeadPaintEffect.SetDC(0) ;
}


LPaintEffect::SetBackgroundColor

#include "ltwrappr.h"

L_INT LPaintEffect::SetBackgroundColor(crBack)

COLORREF crBack;

/* the background color */

Sets the background color that will be used in the drawing functions.

Parameter | Description
crBack | The background color.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetEffectParameters

#include "ltwrappr.h"

L_INT LPaintEffect::SetEffectParameters(pEfxDlgParm)

LPEFFECTDLGPARAMS pEfxDlgParm;

/* pointer to a paint effects structure */

Sets the effect parameters for LPaintEffect::PaintBitmap.

Parameter | Description
pEfxDlgParm | Pointer to a structure of type EFFECTDLGPARAMS that contains the effect parameters.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::PaintBitmap.


LPaintEffect::SetFillBitmap

#include "ltwrappr.h"

L_INT LPaintEffect::SetFillBitmap(pBitmap, prcBack=NULL)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
LPRECT prcBack; | /* the background rectangle */

Sets the background bitmap and rectangle. This bitmap will be used in LPaintEffect::Draw3dShape.

Parameter | Description
pBitmap | Pointer to an LBitmapBase object that references the background bitmap to be used for background painting.
prcBack | The background rectangle.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestFunction(HDC hDC)
{
LBitmapBase LeadBitmap ;
LBitmapBase LeadFillBitmap ;
LPaintEffect LeadPaintEffect ;
RECT Rect ;
HRGN hRgn;

LeadBitmap.Load(TEXT("image1.cmp")) ;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC);

Rect.left = 10 ;
Rect.top = 10 ;
Rect.right = 60 ;
Rect.bottom = 60 ;

if (LeadPaintEffect.GetFillBitmap() == NULL)
{
LeadFillBitmap.Load(TEXT("image2.cmp")) ;
LeadPaintEffect.SetFillBitmap(&LeadBitmap,&Rect) ;
}
LeadPaintEffect.Draw3dShape(&Rect,EFX_SHAPE_RECTANGLE) ;

Rect.left += 10 ;
Rect.top += 10 ;
Rect.right += 10 ;
Rect.bottom += 10 ;

hRgn = CreateEllipticRgn(Rect.left,Rect.top,Rect.right,Rect.bottom) ;

LeadPaintEffect.Draw3dShape(&Rect,hRgn) ;

LeadPaintEffect.SetDC(0);
}


LPaintEffect::SetForegroundColor

#include "ltwrappr.h"

L_INT LPaintEffect::SetForegroundColor(crFill)

COLORREF crFill;

/* the foreground color */

Sets the foreground color that will be used in the drawing functions.

Parameter | Description
crFill | The foreground color.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetGradientParameters

#include "ltwrappr.h"

L_INT LPaintEffect::SetGradientParameters(pGradDlgParm)

LPGRADIENTDLGPARAMS pGradDlgParm;

/* pointer to a gradient structure */

Sets the gradient parameters for LPaintEffect::DrawGradient.

Parameter | Description
pGradDlgParm | Pointer to a structure of type GRADIENTDLGPARAMS that contains the gradient parameters.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawGradient.


LPaintEffect::SetInnerBandHilite

#include "ltwrappr.h"

L_INT LPaintEffect::SetInnerBandHilite(crInnerHilite)

COLORREF crInnerHilite;

/* the inner band highlight color */

Sets the inner band hilite color that will be used in the drawing functions.

Parameter | Description
crInnerHilite | The inner band highlight color.

Returns

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

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetInnerBandShadowColor

#include "ltwrappr.h"

L_INT LPaintEffect::SetInnerBandShadowColor(crInnerShadow)

COLORREF crInnerShadow;

/* the shadow color for the inner band */

Sets the shadow color of the inner band that will be used in the drawing functions.

Parameter | Description
crInnerShadow | The shadow color for the inner band.

Returns

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

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetInnerBandWidth

#include "ltwrappr.h"

L_INT LPaintEffect::SetInnerBandWidth(uInnerWidth)

L_UINT uInnerWidth;

/* the inner band width */

Sets the inner band width that will be used in the drawing functions.

Parameter | Description
uInnerWidth | The inner band width.

Returns

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

Comments

When drawing 3d shapes, the inner band is available only for squares and rectangles.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetMiddleBandColor

#include "ltwrappr.h"

L_INT LPaintEffect::SetMiddleBandColor(crFrame)

COLORREF crFrame;

/* the middle band color */

Sets the middle band color that will be used in the drawing functions.

Parameter | Description
crFrame | The middle band color.

Returns

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

Comments

The middle band is used only when drawing 3d Frames.

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetMiddleBandWidth

#include "ltwrappr.h"

L_INT LPaintEffect::SetMiddleBandWidth(uFrameWidth)

L_UINT uFrameWidth;

/* the frame width */

Sets the frame width that will be used in the drawing functions.

Parameter | Description
uFrameWidth | The frame width.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetOuterBandHilite

#include "ltwrappr.h"

L_INT LPaintEffect::SetOuterBandHilite(crOuterHilite)

COLORREF crOuterHilite;

/* the outer band highlight color */

Sets the outer band highlight color that will be used in the drawing functions.

Parameter | Description
crOuterHilite | The outer band highlight color.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetOuterBandShadowColor

#include "ltwrappr.h"

L_INT LPaintEffect::SetOuterBandShadowColor(crOuterShadow)

COLORREF crOuterShadow;

/* the outer band shadow color */

Sets the outer band shadow color that will be used in the drawing functions.

Parameter | Description
crOuterShadow | The outer band shadow color.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects
 | Using Color Values in LEADTOOLS

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetOuterBandWidth

#include "ltwrappr.h"

L_INT LPaintEffect::SetOuterBandWidth(uOuterWidth)

L_UINT uOuterWidth;

/* the outer band width */

Sets the outer band width that will be used in the drawing functions.

Parameter | Description
uOuterWidth | The outer band width.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::DrawFrame.


LPaintEffect::SetShapeParameters

#include "ltwrappr.h"

L_INT LPaintEffect::SetShapeParameters(pShapeDlgParm)

LPSHAPEDLGPARAMS pShapeDlgParm;

/* pointer to a shape structure */

Sets the shape parameters for LPaintEffect::Draw3dShape.

Parameter | Description
pShapeDlgParm | Pointer to a structure of type SHAPEDLGPARAMS that contains the shape parameters

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

L_VOID TestShape(LBitmapBase& LeadBitmap,HDC hDC)
{
LPaintEffect LeadPaintEffect;
SHAPEDLGPARAMS ShapeDlgParm;
RECT Rect;

LeadPaintEffect.SetBitmap(&LeadBitmap) ;
LeadPaintEffect.SetDC(hDC) ;

LeadPaintEffect.GetShapeParameters(&ShapeDlgParm) ;

ShapeDlgParm.crBack = RGB(0,0,255) ;

LeadPaintEffect.SetShapeParameters(&ShapeDlgParm) ;

Rect.left = 0 ;
Rect.top = 0 ;
Rect.right = LeadBitmap.GetWidth() ;
Rect.bottom = LeadBitmap.GetHeight() ;

LeadPaintEffect.Draw3dShape(&Rect,EFX_SHAPE_RECTANGLE);
LeadPaintEffect.SetDC(0) ;
}


LPaintEffect::SetTextParameters

#include "ltwrappr.h"

L_INT LPaintEffect::SetTextParameters(pTextDlgParm)

LPTEXTDLGPARAMS pTextDlgParm;

/* pointer to a text structure */

Sets the text parameters for LPaintEffect::Draw3dText.

Parameter | Description
pTextDlgParm | Pointer to a structure of type TEXTDLGPARAMS that contains the text parameters.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::Draw3dText.


LPaintEffect::SetTransitionParameters

#include "ltwrappr.h"

L_INT LPaintEffect::SetTransitionParameters(pTransDlgParm)

LPTRANSITIONDLGPARAMS pTransDlgParm;

/* pointer to a transition structure */

Sets the transition parameters for LPaintEffect::PaintTransition.

Parameter | Description
pTransDlgParm | Pointer to a structure of type TRANSITIONDLGPARAMS that contains the transition parameters.

Returns

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

Required DLLs and Libraries

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

See Also

Functions: | Class Members
Topics: | Implementing Special Effects

Example

For an example, refer to LPaintEffect::PaintTransition.


LPlayBack::LPlayBack

#include "ltwrappr.h"

L_VOID LPlayBack::LPlayBack(L_VOID)

Constructs and initializes the member variables of the LPlayBack object.

Returns

None

Comments

This is the constructor for the LPlayBack class.

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.

See Also

Functions:

LPlayBack::~LPlayBack, Class Members

Example

L_VOID ConstructorSamples()
{
// this will call the default constructor
LPlayBack PlayBack;
// do something
}


LPlayBack::~LPlayBack

#include "ltwrappr.h"

virtual L_VOID LPlayBack::~LPlayBack(L_VOID)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LPlayBack class.

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.

See Also

Functions:

Class Members

Example

L_VOID DestructorSample()
{
// Destructor will be called when this variable is out of scope
LPlayBack PlayBack;
// do something
}


LPlayBack::Append

#include "ltwrappr.h"

virtual L_INT LPlayBack::Append(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to an LBitmapBase object */

Appends a bitmap to a the class object's bitmap list during an animation playback.

Parameter | Description
pLBitmap | Pointer to the bitmap object to be appended to the playback animation. 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 pLBitmapList parameter of the LPlayBack::Create function, you can use the LPlayBack::Append function to add bitmaps to the list during the playback. This is useful in the LFile objects’ load callback functions 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 LBitmapList variable when you call the LPlayBack::Destroy function.

The LPlayBack::ValidateLines 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

class LUserFile : public LFile
{
HPALETTE m_hPalette;
HWND m_hWnd;
HDC m_hDC;
RECT m_rcPaint;

public:
LPlayBack m_PlayBack; // playback handle

LUserFile(HWND hwnd, LBitmapBase L_FAR *pBitmapBase);
virtual ~LUserFile();
virtual L_INT LoadFileCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
);
virtual L_INT LoadFile(
L_INT nBitsPerPixel=0,
L_INT nOrder=ORDER_BGR
);

};

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
LUserFile::LUserFile(HWND hwnd, LBitmapBase L_FAR *pBitmapBase):LFile(pBitmapBase)
{
m_hWnd = hwnd;
m_hDC = GetDC(m_hWnd); // DC will be released in the destructor
GetClientRect(m_hWnd, &m_rcPaint);
// Enable LoadInfoCallBack
EnableCallBack(TRUE);

}

LUserFile::~LUserFile()
{
ReleaseDC(m_hWnd, m_hDC);
}

L_INT LUserFile::LoadFileCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR *pBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
)
{
L_INT nRet; // Return value
L_UINT uState; // Next state in the playback
RECT rcUpdate; // Source clipping rectangle used in playback
L_INT nCounter;

// If this is the first row of a bitmap ...
if (uFlags & FILEREAD_FIRSTROW)
{
// Append the bitmap to the list
nRet = m_PlayBack.Append(pBitmap);

if(nRet != SUCCESS)
return(nRet);
}
// Validate the lines in the bitmap so that we can paint them
m_PlayBack.ValidateLines(nRow, nLines);
uState = m_PlayBack.GetState ();
while(uState != PLAYSTATE_END)
{
// Play the animation
uState = m_PlayBack.Process();
switch(uState)
{
case PLAYSTATE_WAITINPUT:
case PLAYSTATE_WAITDELAY :
if (m_PlayBack.GetDelay () > 10)
m_PlayBack.CancelWait ();

break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
m_PlayBack.GetUpdateRect(&rcUpdate, TRUE);
m_PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
m_PlayBack.GetBitmap()->SetDstRect(&m_rcPaint);
m_PlayBack.GetBitmap()->Paint()->SetDC(m_hDC);
m_PlayBack.GetBitmap()->CreatePaintPalette (m_hDC);
m_PlayBack.GetBitmap()->Paint()->PaintDC();
break;
}
nCounter = m_PlayBack.GetIndex();
// do any processing on specific indexes
break;
}
return(SUCCESS);
}

L_INT LUserFile::LoadFile(L_INT nBitsPerPixel,L_INT nOrder)
{
m_PlayBack.Create (m_pBitmap);
return LFile::LoadFile (nBitsPerPixel, nOrder, LOADFILE_ALLOCATE | LOADFILE_STORE | LOADFILE_ALLPAGES);
}

L_VOID PlayBackSamples(HWND hWnd)
{
// this will call the default constructor
LBitmap LeadBitmap;
L_TCHAR szFileName[] = TEXT("d:\\ltwin14\\images\\image1.gif");
FILEINFO FileInfo;

// create instance from User File
LUserFile UserFile(hWnd, 0);
// Attach a bitmap to the UserFile Object
UserFile.SetBitmap (&LeadBitmap);
// attach a file name to UserFile Object
UserFile.SetFileName(szFileName);
// get the info of the file object
 UserFile.GetInfo (&FileInfo, sizeof(FileInfo));
// create the bitmap
LeadBitmap.Create(FileInfo.Width, FileInfo.Height, FileInfo.BitsPerPixel, FileInfo.Order);
// load the file
UserFile.LoadFile();
}


LPlayBack::CancelWait

#include "ltwrappr.h"

virtual L_INT LPlayBack::CancelWait(L_VOID)

Cancels the wait for user input and any delay during an animation playback.

Returns

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

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.

See Also

Functions:

Class Members

Example

For an example, refer to LPlayBack::Append.


LPlayBack::ClearUpdateRect

#include "ltwrappr.h"

virtual L_INT LPlayBack::ClearUpdateRect(L_VOID)

Clears the update rectangle used for the class object's animation playback, leaving an empty rectangle.

Returns

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

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/* This example uses ClearUpdateRect to avoid painting odd numbered bitmaps. */
L_VOID PlayBackSamples(HWND hWnd)
{
// this will call the default constructor
LBitmap LeadBitmap;
LPlayBack PlayBack;
HDC hDC;
HPALETTE hPalette;
L_UINT uState, uIndex;
RECT rcClientRect, rcUpdate;
int nCounter = 0;

GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Create (500, 500,8);

PlayBack.Create (&LeadBitmap);
LeadBitmap.Load (TEXT("image1.cmp"), 8);
PlayBack.Append(&LeadBitmap);
LeadBitmap.Load (TEXT("image2.cmp"), 8);
PlayBack.Append(&LeadBitmap);
LeadBitmap.Load (TEXT("image3.cmp"), 8);

hDC = GetDC(hWnd);
hPalette = LeadBitmap.CreatePaintPalette (hDC);
hPalette = LeadBitmap.DupPalette();
SelectPalette( hDC, hPalette, TRUE );
RealizePalette(hDC);

PlayBack.Append(&LeadBitmap);

uState = PlayBack.GetState();
while(uState != PLAYSTATE_END)
{
uState = PlayBack.Process();
switch(uState)
{
case PLAYSTATE_WAITINPUT:
PlayBack.CancelWait();

break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
uIndex = PlayBack.GetIndex ();
if(uIndex % 2)
PlayBack.ClearUpdateRect ();
PlayBack.GetUpdateRect(&rcUpdate, TRUE);
PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
PlayBack.GetBitmap()->SetDstRect(&rcClientRect);
PlayBack.GetBitmap()->SetClipDstRect(&rcClientRect);
PlayBack.GetBitmap()->Paint()->SetDC(hDC);
PlayBack.GetBitmap()->CreatePaintPalette (hDC);
PlayBack.GetBitmap()->Paint()->PaintDC();
break;
}
nCounter = PlayBack.GetIndex();
}

ReleaseDC(hWnd, hDC);

}


LPlayBack::Create

#include "ltwrappr.h"

virtual L_INT LPlayBack::Create(pBitmap, pLBitmapList=NULL)

LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */
LBitmapList L_FAR * pLBitmapList; | /* pointer to an LBitmapList object */

Creates an animation playback for the class object.

Parameter | Description
pBitmap | Pointer to the background bitmap. This bitmap will be invalid after the function cal, since it will be attached to the internal bitmap. This is an optional parameter. If you pass NULL, then the playback will be created using the internal bitmap object. In this case the internal bitmap object must be allocated. You can access the internal bitmap object by calling the LPlayBack::GetBitmap function, which is declared using the LEAD_DECLARE_PLAYBACK_BITMAP() macro. For more information about C++ Wrapper macros, refer to Wrapper Macros.
pLBitmapList | Optional pointer to the bitmap list containing images to be played. The list can be created using LBitmapList::Create 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 pLBitmapList parameter, you can use the LPlayBack::Append function to add bitmaps to the list during the playback. This is useful in any of the LFile object's load callback functions, 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 LBitmapList object when you call the LPlayBack::Destroy function.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Process.


LPlayBack::Destroy

#include "ltwrappr.h"

virtual L_INT LPlayBack::Destroy(pLBitmapList)

LBitmapList L_FAR * pLBitmapList;

/* pointer to an LBitmapList object */

Invalidates the class object's animation playback. The image list is not deleted.

Parameter | Description
pLBitmapList | NULL, or the address of the variable to be updated with the bitmap list that the playback used. This is useful if the list was created using LPlayBack::Append during the playback. You can pass NULL if you do not need the list handle. In that case, if the list was created using LPlayBack::Append, 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
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: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Process.


LPlayBack::GetBitmap

#include "ltwrappr.h"

virtual LBitmapBase L_FAR * LPlayBack::GetBitmap(L_VOID);

Gets a pointer to the internal playback bitmap object.

Returns

A pointer to an LBitmapBase object.

Comments

This function is declared by the LEAD_DECLARE_PLAYBACK_BITMAP macro. You can use this function to get a pointer to the internal playback bitmap object, where you can access the different functions defined for LBitmapBase or the mapped bitmap object.

This function exists because the LEAD_DECLARE_PLAYBACK_BITMAP macro is called in the Ltcplybk.h file. If you wish to derive your own class, you must call the LEAD_DECLARE_PLAYBACK_BITMAP macro, or the GetBitmap() function will not exist in your derived class.

For more information, refer to Wrapper Macros.

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.

See Also

Functions: | Class Members
Topics: | Wrapper Macros

Example

For an example, refer to LPlayBack::Process or see LEAD_INIT_PLAYBACK_BITMAP under Wrapper Macros.


LPlayBack::GetDelay

#include "ltwrappr.h"

virtual L_UINT32 LPlayBack::GetDelay(L_VOID);

Gets the time remaining in the current wait state of an animation playback.

Returns

The number of milliseconds remaining for the current animation playback frame.

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.

See Also

Functions: | Class Members
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 GetDelaySample(HWND hWnd, LBitmapBase *pTargetBitmap, LBitmapList L_FAR *pBitmapList)
{
LPlayBack PlayBack; /* 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 */
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 */
PlayBack.Create(pTargetBitmap, pBitmapList);
do
{
uState = PlayBack.Process ();
switch(uState)
{
case PLAYSTATE_WAITDELAY:
uDelay = PlayBack.GetDelay ();
if (uDelay > 10)
PlayBack.CancelWait ();
break;
case PLAYSTATE_POSTRENDER:
PlayBack.GetUpdateRect (&rcUpdate, TRUE);
hdc = GetDC(hWnd);
PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
PlayBack.GetBitmap()->SetDstRect(&rcDisplay);
PlayBack.GetBitmap()->SetClipDstRect(&rcDisplay);
PlayBack.GetBitmap()->Paint()->SetDC(hdc);
PlayBack.GetBitmap()->CreatePaintPalette (hdc);
PlayBack.GetBitmap()->Paint()->PaintDC();
ReleaseDC(hWnd, hdc);
break;
}
}while(uState != PLAYSTATE_END);

}


LPlayBack::GetIndex

#include "ltwrappr.h"

virtual L_INT LPlayBack::GetIndex(L_VOID)

Gets the list index of the current bitmap during animation playback.

Returns

The index of the current 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

/* This example uses LPlayBack::GetIndex and LPlayBack::SetIndex to skip
bitmaps during a playback. */
void TestGetIndex(HWND hWnd, L_TCHAR L_FAR *pszFileName)
{
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 */
L_UINT uIndex = 0; /* Current index to the bitmap list */
L_UINT uCount = 0; /* Number of bitmaps in the list */
LBitmapBase TargetBitmap;
LBitmapList BitmapList;
LPlayBack PlayBack; /* Animation playback */

/* Create the bitmap list from the input file (GIF or AVI) */
BitmapList.Load (pszFileName);
/* Get a copy of the first image's bitmap handle */
TargetBitmap = BitmapList[0];
/* Use the client area as the display rectangle */
GetClientRect(hWnd,&rcDisplay);
/* Get the number of bitmaps in the list */
uCount = BitmapList.GetItemsCount();
/* Create and run the playback */
PlayBack.Create(&TargetBitmap, &BitmapList);
do
{
uState = PlayBack.Process();
switch(uState)
{
case PLAYSTATE_PRERENDER:
uIndex = PlayBack.GetIndex();
PlayBack.SetIndex( ++uIndex);
break;
case PLAYSTATE_POSTRENDER:
PlayBack.GetUpdateRect(&rcUpdate, TRUE);
hdc = GetDC(hWnd);
PlayBack.GetBitmap()->SetClipSrcRect(&rcUpdate);
PlayBack.GetBitmap()->SetDstRect(&rcDisplay);
PlayBack.GetBitmap()->SetClipDstRect(&rcDisplay);
PlayBack.GetBitmap()->Paint()->SetDC(hdc);
PlayBack.GetBitmap()->CreatePaintPalette (hdc);
PlayBack.GetBitmap()->Paint()->PaintDC();
ReleaseDC(hWnd, hdc);
break;
}
} while(uIndex < uCount);
}


LPlayBack::GetState

#include "ltwrappr.h"

virtual L_UINT LPlayBack::GetState(L_VOID)

Gets the current state of the animation playback engine.

Returns

A constant that describes the current state of the animation playback engine. For possible values, refer to Animation Playback States.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Append.


LPlayBack::GetUpdateRect

#include "ltwrappr.h"

virtual L_INT LPlayBack::GetUpdateRect(prcUpdate, bClear)

LPRECT prcUpdate; | /* address of a RECT structure */
L_BOOL bClear; | /* flag that indicates whether to clear the rectangle */

Gets the updated rectangle of the target bitmap during an animation playback. The rectangle uses bitmap coordinates, and it is cumulative.

Parameter | Description
prcUpdate | Address of the RECT structure to be updated with the coordinates of the updated rectangle
bClear | Flag that indicates whether to clear the rectangle. Possible values are:
 | Value | Meaning
 | TRUE | Clear the rectangle.
 | FALSE | Do not clear the rectangle.

Returns

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

Comments

You usually call this function after the following states, which you can get with the LPlayBack::GetState function:

Value | 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
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: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Append.


LPlayBack::IsCreated

#include "ltwrappr.h"

L_BOOL LPlayBack::IsCreated(L_VOID)

Determines whether an animationplayback has been created.

Returns

TRUE | The playback has been created.
FALSE | The playback has not been created.

Comments

The class object must contain a created animation playback before you can use functions to manipulate the playback.

You can create an animation playback for the class object by calling LPlayBack::Create.

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.

See Also

Functions: | LPlayBack::Create, Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Process.


LPlayBack::Process

#include "ltwrappr.h"

virtual L_UINT LPlayBack::Process(L_VOID)

Processes the next state during an animation playback.

Returns

A constant that describes the new state of the animation playback engine. For possible values, refer to Animation Playback States.

Comments

This function is called in a loop, to continually process the class object's animation playback.

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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

// Process Example
/* 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. */
void TestAnimate(L_TCHAR L_FAR * pszFilename, HWND hWnd)
{
LBitmapList BitmapList; /* Bitmap list */
LBitmapBase LeadBitmap; /* Bitmap handle for the loaded image. */
LPlayBack Playback; /* 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 */

/* Create the bitmap list from the input file (GIF or AVI) */
BitmapList.Load (pszFilename);
/* Get a copy of the first image's bitmap handle */
LeadBitmap = BitmapList[0];
/* 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 */
/* Create and run the playback */
Playback.Create (&LeadBitmap, &BitmapList);
if(Playback.IsCreated() == FALSE)
return;
do
{
uState = Playback.Process ();
switch(uState)
{
case PLAYSTATE_WAITINPUT:
//Playback.caL_CancelPlaybackWait(hPlayback);
break;
case PLAYSTATE_POSTCLEAR:
case PLAYSTATE_POSTRENDER:
Playback.GetUpdateRect (&rcUpdate, TRUE);
hdc = GetDC(hWnd);

Playback.GetBitmap()->Paint()->SetDC(hdc);
Playback.GetBitmap()->SetClipSrcRect (&rcUpdate);
Playback.GetBitmap()->SetDstRect(&rcDisplay);
Playback.GetBitmap()->SetClipDstRect (&rcDisplay);
Playback.GetBitmap()->Paint()->PaintDC();
ReleaseDC(hWnd, hdc);
break;
}
} while(uState != PLAYSTATE_END);

/* Clean up */
// No need to call destroy it is only for sample purposes
// the destructor will call destroy if it was not called here
Playback.Destroy (NULL);
}


LPlayBack::SetIndex

#include "ltwrappr.h"

virtual L_INT LPlayBack::SetIndex(nIndex)

L_INT nIndex;

/* bitmap list index */

Sets the list index of the current bitmap during animation playback.

Parameter | Description
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
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: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::GetIndex.


LPlayBack::ValidateLines

#include "ltwrappr.h"

virtual L_INT LPlayBack::ValidateLines(nRow, nLines=1)

L_INT nRow; | /* row number of the first line to validate */
L_INT nLines; | /* number of lines to validate */

Validates the lines of a bitmap, that was added during an LFile object's load callback function, using the LPlayBack::Append function.

Parameter | Description
nRow | Row number of the first line in the bitmap to validate. In the LFile object's load callback function, this corresponds to the first line in the buffer.
nLines | Number of lines to validate. In the LFile object's load callback 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 LPlayBack::Append function enables you to update a bitmap list in an LFile object's load callback function, so that you can play an animation file as it is being loaded. The LPlayBack::ValidateLines() 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.

See Also

Functions: | Class Members
Topics: | Raster Image Functions: Creating and Maintaining Lists of Images
 | Implementing Animation

Example

For an example, refer to LPlayBack::Append.


LPrint::LPrint

#include "ltwrappr.h"

LPrint::LPrint(void)

LPrint::LPrint(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to a bitmap object */

Constructs and initializes the different member variables of the LPrint object.

Parameter | Description
pLBitmap | Pointer to a bitmap object.

Returns

None

Comments

LPrint::LPrint() is a constructor for the LPrint class.

LPrint::LPrint(pLBitmap) initializes the LEAD print object with a pointer to a bitmap object.

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:

LPrint::~LPrint, Class Members

Example

This is an example for LPrint::LPrint():

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LPrint MyPrint;

//…
}

This is an example for LPrint::LPrint(pLBitmap):

L_VOID TestFunction()
{
LBitmapBase LeadBitmap ;
LeadBitmap.Load(TEXT("image1.cmp")) ;

LPrint MyPrint(&LeadBitmap) ;

//…
}


LPrint::~LPrint

#include "ltwrappr.h"

virtual LPrint::~LPrint(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LPrint class.

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:

LPrint::LPrint, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LPrint MyPrint;

//…
}


LPrint::GetPrinterDC

#include "ltwrappr.h"

HDC LPrint::GetPrinterDC(void)

Gets a Windows device context to the current default printer.

Returns

Handle to the default printer device context.

NULL if there was an error.

Comments

You are responsible for releasing the device context when it is no longer needed. You can do this using the Windows function DeleteDC().

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: | LPrint::Print, LPrint::PrintFast, Class Members
Topics: | Raster Image Functions: Printing Images

Example

For an example, refer to LPrint::Print.


LPrint::IsValid

#include "ltwrappr.h"

L_BOOL LPrint::IsValid(void)

Determines whether there is a valid print object.

Returns

TRUE | The print object is ready to be used.
FALSE | The print object is not ready to be used.

Comments

Before you can use any of the print functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LPrint object, the object is considered invalid.

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:

LPrint::SetBitmap, Class Members

Example

For an example, refer to LPrint::Print.


LPrint::Print

#include "ltwrappr.h"

virtual HDC LPrint::Print(hDC=NULL, nX=0, nY=0, nWidth=0, nHeight=0, bEndDoc=TRUE)

HDC hDC; | /* handle to the device context (DC)*/
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 bEndDoc; | /* flag that indicates whether to print another image on the page */

Prints the associated class object's bitmap to the specified 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. If this is NULL, then the bitmap will be printed to the default device context.
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.
bEndDoc | Flag that indicates to LEADTOOLS whether you plan to print another image on the same page or not. Possible values are:
 | 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 fEndDOC is FALSE, you can use the returned hDC to draw to the current printer page.

An alternative for greater flexibility is the LPaint::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.

See Also

Functions: | LPrint::PrintFast, Class Members
Topics: | Raster Image Functions: Printing Images

Example

L_VOID TestFunction()
{
LBitmapBase MyBitmap;
LPrint MyPrint;
HDC hPrinterDC;

MyBitmap.Load(TEXT("Image1.cmp"));

MyPrint.SetBitmap(&MyBitmap);
hPrinterDC=MyPrint.GetPrinterDC();

if(MyPrint.IsValid()&&hPrinterDC)
MyPrint.PrintFast(hPrinterDC);
MyPrint.Print();
}


LPrint::PrintFast

#include "ltwrappr.h"

virtual HDC LPrint::PrintFast(hDC=NULL, nX=0, nY=0, nWidth=0, nHeight=0, bEndDoc=TRUE)

HDC hDC; | /* handle to the device context (DC)*/
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 bEndDoc; | /* flag that indicates whether to print another image on the page */

Prints the associated class object's bitmap to the specified device. This function 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.
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.
bEndDoc | Flag that indicates to LEADTOOLS whether you plan to print another image on the same page or not. Possible values are:
 | 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 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 LPrint::PrintFast.

An alternative for greater flexibility is the LPaint::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.

See Also

Functions: | LPrint::Print, Class Members
Topics: | Raster Image Functions: Displaying Images

Example

For an example, refer to LPrint::Print.


LPrint::SetBitmap

#include "ltwrappr.h"

virtual L_VOID LPrint::SetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to a bitmap object */

Sets an LBitmapBase object (or any object derived from LBitmapBase) to be used by the print functions.

Parameter | Description
pBitmap | A pointer to a bitmap object to be used in the printing.

Returns

None

Comments

Before you can use any of the print functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LPrint object, the object is considered invalid.

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:

Class Members

Example

For an example, refer to LPrint::Print.


LScanner::LScanner

#include "ltwrappr.h"

L_VOID LScanner::LScanner(void)

Constructs and initializes the different member variables of the LScanner object.

Returns

None

Comments

This is the constructor for the LScanner class.

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:

LScanner::~LScanner, ClassMembers

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LScanner MyScanner ;

//…
}


LScanner::~LScanner

#include "ltwrappr.h"

virtual L_VOID LScanner::~LScanner(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LScanner class.

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:

LScanner::LScanner, Class Members

Example

L_VOID TestFunction()
{
LBitmapBase *pBitmap;
// this will call the default constructor and destructor when it is out of scope
LScanner MyScanner ;
MyScanner.m_pBitmap = pBitmap
//…
}


LScanner::IsValid

#include "ltwrappr.h"

L_BOOL LScanner::IsValid(void)

Determines whether there is a valid scanner object.

Returns

TRUE | The scanning object is ready to be used.
FALSE | The scanning object is not ready to be used.

Comments

Before you can use any of the scanner functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LScanner object, the object is considered invalid.

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:

Lscanner::SetBitmap, Class Members

Example

For an example, refer to LScanner::SetBitmap.


LScanner::m_pBitmap

#include "ltwrappr.h"

LBitmapBase L_FAR *m_pBitmap

Comments

Pointer to a LEAD bitmap object that will be used for scanning operations.

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

Elements: | Class Members
Topics: | Wrapper Macros

Example

For an example, refer to LScanner::~LScanner.


LScanner::SetBitmap

#include "ltwrappr.h"

virtual L_VOID LScanner::SetBitmap(pBitmap)

LBitmapBase L_FAR * pBitmap;

/* pointer to a bitmap object */

Sets the bitmap object that will hold the scanned image.

Parameter | Description
pBitmap | Pointer to a bitmap object to be used in scanning.

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.

See Also

Functions:

Class Members

Example

L_VOID MyScanner( HWND hWnd, LBitmapBase *pBitmap)
{
LScanner MyScanner ;
if (MyScanner.IsValid() == FALSE)
MyScanner.SetBitmap(pBitmap) ;

MyScanner.SetWindow(hWnd) ;
}


LScanner::SetWindow

#include "ltwrappr.h"

virtual L_VOID LScanner::SetWindow(hWnd)

HWND hWnd;

/* handle of the window */

Sets the window handle to be used for the scanning operations.

Parameter | Description
hWnd | Handle of the window to be used for the scanning operations.

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.

See Also

Functions:

Class Members

Example

For an example, refer to LScanner::SetBitmap.


LScreenCapture::LScreenCapture

#include "ltwrappr.h"

LScreenCapture::LScreenCapture(void)

L_VOID LScreenCapture::LScreenCapture(pLBitmap)

L_VOID LScreenCapture::LScreenCapture(pScreenCapture)

LBitmapBase L_FAR * pLBitmap; | /* pointer to a LEAD bitmap object */
LScreenCapture L_FAR * pScreenCapture; | /* pointer to a capture object */

Constructs and initializes the different member variables of the LScreenCapture object.

Parameter | Description
pLBitmap | Pointer to a LEAD bitmap object to be used for capturing.
pScreenCapture | Pointer to a capture object.

Returns

None

Comments

LScreenCapture::LScreenCapture(void) is a constructor for the LScreenCapture class.

LScreenCapture::LScreenCapture(pLBitmap) constructs and initializes the LScreenCapture object with the passed LBitmapBase object pointer.

LScreenCapture::LScreenCapture(pScreenCapture) constructs and initializes the LScreenCapture object with the passed LScreenCapture object. This will copy the properties and settings from the specified object. This constructor does not copy the reference to an associated LBitmapBase object.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::~LScreenCapture, Class Members

Example

This is an example for LScreenCapture::LScreenCapture(void):

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LScreenCapture screenCapture;

//…
}

This is an example for LScreenCapture::LScreenCapture(pLBitmap):

L_VOID TestFunction()
{
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

//…
}

This is an example for LScreenCapture::LScreenCapture(pScreenCapture):

L_VOID CaptureSample()
{
L_INT nRet;
LScreenCapture screenCapture;
LEADCAPTUREOPTION CaptureOptions;

nRet = screenCapture.GetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
CaptureOptions.nHotKey = VK_F10;
// Change the options for the original screen capture object
nRet = screenCapture.SetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
// Create an instance using the new options directly
LScreenCapture MyCapture(&screenCapture);
//....

}
}
}


LScreenCapture::~LScreenCapture

#include "ltwrappr.h"

virtual LScreenCapture::~LScreenCapture(void)

Destroys the object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LScreenCapture class. You should not destroy any LScreenCapture object from another thread if this object is currently used in a capture operation without first calling LScreenCapture::StopCapture.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::LScreenCapture, LScreenCapture::StopCapture, Class Members

Example

L_VOID TestFunction()
{
LBitmap LeadBitmap;
// destructor will be called when this variable is out of scope
LScreenCapture screenCapture(&LeadBitmap);

//…
}


LScreenCapture::CaptureActiveClient

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureActiveClient(void)

Captures an image of the current active window's client area into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture ActiveClient - HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureActiveClient();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureActiveWindow

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureActiveWindow(void)

Captures an image of the current active window into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture ActiveWindow - HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureActiveWindow();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureArea

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureArea(void);

Captures an image of the user selected area into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// CaptureArea - HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureArea();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureAreaOptionDlg

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureAreaOptionDlg(hParentWnd, uFlags)

HWND hParentWnd; | /* handle to parent window */
L_UINT uFlags; | /* flags to determine function behavior */

Displays a dialog to set the options for LScreenCapture::CaptureArea.

Parameter | Description
hParentWnd | Handle to the parent window of the area options dialog box.
uFlags | Flags that specify the function behavior. Possible values are:
 | Value | Meaning
 | 0 | Ignore this flag. Pass this if you do not wish to use this flag.
 | SCRDLG_CAPTUREAREAOPTION_CONTEXTHELP | [0x0002] Show the context help button.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members, LScreenCapture::ScreenCaptureHelpCallBack

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// display a dialog to select area options
nRet = screenCapture.CaptureAreaOptionDlg(hWnd, 0);
if(nRet == SUCCESS)
{
// CaptureArea - HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureArea();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
return;
}


LScreenCapture::CaptureFromEXE

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureFromEXE(pszFileName, nResType, pResID, bCaptureByIndex, clrBackGnd=RGB(0,0,0))

L_TCHAR L_FAR * pszFileName; | /* filename to capture from */
L_INT nResType; | /* resource type to capture */
L_TCHAR L_FAR * pResID; | /* Resource ID to be captured */
L_BOOL bCaptureByIndex; | /* flag that indicates whether pResID is an index or a resource ID */
COLORREF clrBackGnd; | /* background color to be used for icons */

Captures an image from the specified resource, stored in an EXE or DLL, into the associated class object's bitmap.

Parameter | Description
pszFileName | Character string containing the name of the exe (or dll) from which the resource should be captured.
nResType | Specifies the type of resource to capture. Possible values are:
Value | Meaning
RESTYPE_BITMAP | capture a bitmap resource
RESTYPE_ICON | capture an icon resource
RESTYPE_CURSOR | capture a cursor resource
pResID | Specifies the index of the resource to capture. You can use MAKEINDEX or MAKERESOURCEID macros to convert the resource ids to strings.
bCaptureByIndex | Flag that indicates whether pResID represents an index or a resource ID. Possible values are:
Value | Meaning
TRUE | pResID is the index position of the requested resource.
FALSE | pResID is the resource ID of the requested resource.
clrBackGnd | Background color for icons.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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: | Class Members
Topics: | Using Color Values in LEADTOOLS

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcDestRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// CaptureFromExe
//MFCDEM32 is shipped with LEADTOOLS, you have to copy it to the directory of the sample
// it has an ICON with ID=128
nRet = screenCapture.CaptureFromEXE(TEXT("MFCDEM32.EXE"), RESTYPE_ICON, MAKEINTRESOURCE(128), 0);
// COLORREF Transparent;
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
LeadBitmap.Paint()->SetDC(hDC);
// Set destination rectangle to be the same as the bitmap dimensions
SetRect(&rcDestRect, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());
LeadBitmap.SetDstRect(&rcDestRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureFromEXEDlg

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureFromEXEDlg(pszFileName, pTransparentColor, nResType, uFlags, nDialogType=LTCAPDLG_TREEVIEW)

L_TCHAR L_FAR * pszFileName; | /* filename to capture from */
COLORREF L_FAR * pTransparentColor; | /* pointer to a color */
L_INT nResType; | /* resource type to be captured */
L_UINT uFlags; | /* flags to determine function behavior */
L_INT nDialogType; | /* type of dialog to be displayed */

Displays a dialog and captures an image from a resource stored in an EXE or DLL into the associated class object's bitmap.

Parameter | Description
pszFileName | Character string containing the name of the exe (or dll) from which the resource should be captured.
pTransparentColor | Pointer to a color to be used in place of the transparent color of an Icon or Cursor.
nResType | Type of resource to be captured. Possible values are:
Value |  |  | Meaning
RESTYPE_BITMAP |  |  | capture a bitmap
RESTYPE_ICON |  |  | capture an icon
RESTYPE_CURSOR |  |  | capture a cursor
uFlags | Flags that specify the function behavior. Possible values are:
 | Value | Meaning
 | 0 | Ignore this flag. Pass this if you do not wish to use this flag.
 | SCRDLG_CAPTUREFROMEXE_CONTEXTHELP | [0x0008] Show the context help button.
nDialogType | Type of dialog to be displayed. Possible values are:
Value |  |  | Meaning
CAP_DLG_TREEVIEW |  |  | Display tree dialog
CAP_DLG_TABVIEW |  |  | Display tab view

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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: | Class Members, LScreenCapture::ScreenCaptureHelpCallBack
Topics: | Using Color Values in LEADTOOLS

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcDestRect;
COLORREF Transparent;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// CaptureFromExeDlg
//MFCDEM32 is shipped with LEADTOOLS, you have to copy it to the directory of the sample
// it has an ICON with ID=128
nRet = screenCapture.CaptureFromEXEDlg(TEXT("MFCDEM32.EXE"), &Transparent, 0, RESTYPE_BITMAP);
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
LeadBitmap.Paint()->SetDC(hDC);
SetRect(&rcDestRect, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());
LeadBitmap.SetDstRect(&rcDestRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureFullScreen

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureFullScreen(void)

Captures an image of the entire screen into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// CaptureFullScreen- HotKey = F11
nRet = screenCapture.CaptureFullScreen();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureGetResCount

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureGetResCount(pszFileName, nResType, pnCount)

L_TCHAR L_FAR * pszFileName; | /* name of the file in which to count resources */
L_INT nResType; | /* resource type to count */
L_INT32 L_FAR * pnCount; | /* address of the variable to be updated with the resource count */

Counts the number of resources of the specified type in the given executable file.

Parameter | Description
pszFileName | Character string containing the name of the exe (or dll) from which the resource should be counted.
nResType | Specifies the type of resource to count. Possible values are:
 | Value | Meaning
 | RESTYPE_BITMAP | count bitmap resources
 | RESTYPE_ICON | count icon resources
 | RESTYPE_CURSOR | count cursor resources
pnCount | Address of a variable to be filled with the number of resources found.

Returns

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

Comments

After calling this function, pnCount points to the number of resources of the specified type that were found in the given executable file.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);
L_INT32 lBitmapCount;
L_TCHAR szDummyBuffer[50];

// CaptureGetResCount
nRet = screenCapture.CaptureGetResCount(TEXT("MFCDEM32.EXE"), RESTYPE_BITMAP, &lBitmapCount);
if(nRet == SUCCESS)
{
wsprintf(szDummyBuffer, TEXT("EXE file contains %d bitmaps"), lBitmapCount);
MessageBox(hWnd, szDummyBuffer, TEXT("CaptureGetResCount"), MB_OK);
}
return;
}


LScreenCapture::CaptureHotKeyCallBack

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureHotKeyCallBack(nHotKey, uHotKeyModifiers)

L_INT nHotKey; | /* key code for activation key */
L_UINT uHotKeyModifiers; | /* modifier key */

Signals that the user has pressed the capture HotKey.

Parameter | Description
nHotKey | Key code for activation key.
uHotKeyModifiers | Modifier keys used with nHotKey. Possible values are listed below and may be combined using the bitwise OR ( | ) operator.
 | Value | Meaning
 | MOD_ALT | Alt Key pressed.
 | MOD_CONTROL | Control key pressed.
 | MOD_SHIFT | Shift key pressed.
 | 0 | No modifier key was pressed.

Returns

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

Comments

You can override this function to do initialization processing before the capture operation starts.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

// ScreenCapture Callbacks
class LUserScreenCapture : public LScreenCapture
{
HWND m_hWnd;
public:
LUserScreenCapture(HWND hWnd){m_hWnd = hWnd;}
virtual ~LUserScreenCapture(){};

virtual L_INT CaptureHotKeyCallBack(L_INT nHotKey,L_UINT uHotKeyModifiers);
virtual L_INT ScreenCaptureCallBack();
};

// This callback will be called once the hotkey is pressed
L_INT LUserScreenCapture::CaptureHotKeyCallBack(L_INT nHotKey,L_UINT uHotKeyModifiers)
{
MessageBox(m_hWnd, TEXT("HotKey pressed."), TEXT("CaptureHotKeyCallBack"), MB_OK);
return SUCCESS;
}

// This callback will be called once an image is captured
L_INT LUserScreenCapture::ScreenCaptureCallBack()
{
RECT rcClientRect;
HDC hDC;
hDC = GetDC(m_hWnd);

// get the client rect of the window
GetClientRect(m_hWnd, &rcClientRect);
// paint the captured image
m_pBitmap->Paint()->SetDC(hDC);
m_pBitmap->SetDstRect(&rcClientRect);
m_pBitmap->Paint()->PaintDC();
ReleaseDC(m_hWnd, hDC);
return SUCCESS;
}

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
LBitmapBase LeadBitmap;
LUserScreenCapture screenCapture(hWnd);
LEADCAPTUREOPTION CaptureOptions;

screenCapture.SetBitmap(&LeadBitmap);
// get original capture options
nRet = screenCapture.GetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
// Set capture count to 2
CaptureOptions.uCount = 2;
nRet = screenCapture.SetCaptureOptions(&CaptureOptions);
}
// EnableCallBack should be called in order for the callbacks to be activated
screenCapture.EnableCallBack(TRUE);
// CaptureActiveWindow - HotKey = F11
// After calling this function above callbacks will be called
nRet = screenCapture.CaptureActiveWindow();
return;
}


LScreenCapture::CaptureMenuUnderCursor

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureMenuUnderCursor(void)

Captures an image of the selected menu's contents into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture MenuUnderCursor- HotKey = F11
// after calling this function you have to select a menu
// then press F11
nRet = screenCapture.CaptureMenuUnderCursor();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureMouseCursor

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureMouseCursor(crFill=RGB(255,255,255))

COLORREF crFill;

/* color used to fill the transparent area of the captured image */

Captures an image of the current mouse cursor shape into the associated class object's bitmap.

Parameter | Description
crFill | Color used to fill the transparent area of the captured image.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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: | Class Members
Topics: | Using Color Values in LEADTOOLS

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture WindowMouseCursor- HotKey = F11
nRet = screenCapture.CaptureMouseCursor();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureObjectOptionDlg

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureObjectOptionDlg(hParentWnd, uFlags)

HWND hParentWnd; | /* handle to the parent window */
L_UINT uFlags; | /* flags to determine function behavior */

Displays a dialog to set the options for LScreenCapture::CaptureSelectedObject.

Parameter | Description
hParentWnd | Handle to the parent window of the object options dialog box.
uFlags | Flags that specify the function behavior. Possible values are:
 | Value | Meaning
 | 0 | Ignore this flag. Pass this if you do not wish to use this flag.
 | SCRDLG_CAPTUREOBJECTOPTION_CONTEXTHELP | [0x0004] Show the context help button.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members, LScreenCapture::ScreenCaptureHelpCallBack

Example

For an example, refer to LScreenCapture::CaptureSelectedObject.


LScreenCapture::CaptureSelectedObject

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureSelectedObject(void)

Captures an image of the selected Windows object into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// display a dialog to select Object options
nRet = screenCapture.CaptureObjectOptionDlg(hWnd, 0);
if(nRet == SUCCESS)
{
// capture SelectedObject - HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureSelectedObject();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
return;
}


LScreenCapture::CaptureWallpaper

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureWallpaper(void)

Captures an image of the current wallpaper into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture WallPaper - HotKey = F11
nRet = screenCapture.CaptureWallpaper();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureWindow

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureWindow(hWnd, wctCaptureType)

HWND hWnd; | /* the handle of the window to capture */
WINDOWCAPTURETYPE wctCaptureType; | /* capture type*/

Captures an image of the specified window or the specified window's client area into the associated class object's bitmap.

Parameter | Description
hWnd | The handle of the window to capture.
wctCaptureType | The capture type. Possible values are:
 | Value | Meaning
 | CAPTURE_CLIENT_AREA | [1] Capture the client area.
 | CAPTURE_WINDOW | [2] Capture the window including the client area.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture Window
// capture the window
nRet = screenCapture.CaptureWindow(hWnd, CAPTURE_WINDOW);
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::CaptureWindowUnderCursor

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureWindowUnderCursor(void)

Captures an image of the window under the cursor position into the associated class object's bitmap.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// capture WindowUnderCursor- HotKey = F11
// after calling this function you have to select a window
// then press F11
nRet = screenCapture.CaptureWindowUnderCursor();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
return;
}


LScreenCapture::GetCaptureAreaOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::GetCaptureAreaOptions(pCaptureAreaOption)

pLEADCAPTUREAREAOPTION pCaptureAreaOption;

/* pointer to a LEADCAPTUREAREAOPTION structure */

Gets the current options for capturing an area.

Parameter | Description
pCaptureAreaOption | Pointer to a LEADCAPTUREAREAOPTION structure that contains information about capturing an area.

Returns

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

Comments

Use this function to get the current area image capture options. For information on the default option settings, refer to LEADCAPTUREAREAOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetCaptureAreaOptions, Class Members

Example

For an example, refer to LScreenCapture::SetCaptureAreaOptions.


LScreenCapture::GetCaptureObjectOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::GetCaptureObjectOptions(pCaptureObjectOptions)

pLEADCAPTUREOBJECTOPTION pCaptureObjectOptions;

/* pointer to a LEADCAPTUREOBJECTOPTION structure */

Gets the current options for capturing a window’s object.

Parameter | Description
pCaptureObjectOptions | Pointer to a LEADCAPTUREOBJECTOPTION structure to be updated with the current object capture options.

Returns

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

Comments

Use this function to change the current object capture options. For information on the default option settings, refer to LEADCAPTUREOBJECTOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetCaptureObjectOptions, Class Members

Example

For an example, refer to LScreenCapture::SetCaptureObjectOptions.


LScreenCapture::GetCaptureOption

#include "ltwrappr.h"

static L_INT LScreenCapture::GetCaptureOption(pOptions, uStructSize)

pLEADCAPTUREOPTION pOptions; | /* address of structure to be filled */
L_UINT uStructSize | /* size in bytes, of the structure pointed to by pOptions */

Gets the current options for image capture such as HotKey, Delay, and Count.

Parameter | Description
pOptions | Pointer to the LEADCAPTUREOPTION structure to be filled with the current capture options.
uStructSize | Size in bytes, of the structure pointed to by pOptions. Use sizeof(LEADCAPTUREOPTION).

Returns

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

Comments

Use this function to get the current image capture options. For information on the default capture options, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members, LScreenCapture::SetCaptureOption, LScreenCapture::SetCaptureOptionDlg

Example

int MyMain()
{
LEADCAPTUREOPTION CaptureOption;
/*Example for LScreenCapture::SetCaptureOption & LScreenCapture::GetCaptureOption
/* get current capture options */
LScreenCapture::GetCaptureOption(&CaptureOption, sizeof(LEADCAPTUREOPTION));
/* change the hot key to F6 */
CaptureOption.nHotKey = VK_F6;
/* set the new options */
LScreenCapture::SetCaptureOption(&CaptureOption);
return 0;
}


LScreenCapture::GetCaptureOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::GetCaptureOptions(pCaptureOptions)

pLEADCAPTUREOPTION pCaptureOptions;

/* pointer to a LEADCAPTUREOPTION structure */

Gets the current options for image capture such as HotKey, Delay, and Count.

Parameter | Description
pCaptureOptions | Pointer to a LEADCAPTUREOPTION structure.

Returns

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

Comments

Use this function to get the current image capture options. For information on the default capture options, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetCaptureOptions, Class Members

Example

For an example, refer to LScreenCapture::SetCaptureOptions.


LScreenCapture::IsCaptureActive

#include "ltwrappr.h"

static L_BOOL LScreenCapture::IsCaptureActive(void)

Indicates whether a capture process has been started.

Returns

TRUE | There is an active capture operation.
FALSE | There is not an active capture operation.

Comments

You should stop a previously started capture process before starting another, or before the calling thread terminates.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

/* this is a Microsoft header file and is required for _beginthread */
#include <process.h>

L_VOID __cdecl CaptureThread( L_VOID *pDummy );

LBitmap LeadBitmap;
LScreenCapture ScreenCapture(&LeadBitmap);

L_VOID MyFunction(HWND hWnd)
{
_beginthread(CaptureThread, 0, 0);

/// place some delay so that the thread is called
Sleep(1000);
while(ScreenCapture.IsCaptureActive())
{
ScreenCapture.StopCapture();
MessageBox(hWnd, TEXT("Capture operation aborted by user."), TEXT("Info"), MB_OK);
}
}

L_VOID __cdecl CaptureThread(L_VOID *pDummy)
{
int nRet = ScreenCapture.CaptureActiveWindow();
MessageBox(0, TEXT("Capture Thread Terminated."), TEXT("Info"), MB_OK);

return;
}


LScreenCapture::IsValid

#include "ltwrappr.h"

virtual L_BOOL LScreenCapture::IsValid(void)

Determines whether an LScreenCapture object is valid.

Returns

TRUE | The object is ready to be used.
FALSE | The object is not ready to be used.

Comments

Before you can use any of the screen capture functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LScreenCapture object, the object is considered invalid.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
LBitmap LeadBitmap;
LScreenCapture screenCapture;
screenCapture.SetBitmap(&LeadBitmap);
if(screenCapture.IsValid())
MessageBox(hWnd, TEXT("Screen capture object is ready."), TEXT("LScreenCapture::IsValid"), MB_OK);
else
MessageBox(hWnd, TEXT("Invalid LScreenCapture object."), TEXT("LScreenCapture::IsValid"), MB_OK);
}


LScreenCapture::m_pBitmap

#include "ltwrappr.h"

LBitmapBase L_FAR *m_pBitmap

Comments

Pointer to the bitmap object to be used for the capturing operation. Any captured image will be stored in this object. You are responsible for managing the captured image. Note that the next capture will free this bitmap and set another bitmap handle into this object.

Required DLLs and Libraries

LTDIS
LTSCR

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

Elements:

Wrapper Macros, Class Members

Example

For an example, refer to LScreenCapture::CaptureHotKeyCallBack.


LScreenCapture::ScreenCaptureCallBack

#include "ltwrappr.h"

virtual L_INT LScreenCapture::ScreenCaptureCallBack(void)

Handles the output image data acquired by one of the image capture functions.

Returns

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

Comments

Override this callback function to process the captured image data when multiple captures are performed. Multiple captures can be done by setting the capture options using LScreenCapture::SetCaptureOptions() function or through the capture options dialog.

You can access the captured image through the member variable m_pBitmap which is of type LBitmapBase L_FAR *.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

For an example, refer to LScreenCapture::CaptureHotKeyCallBack.


LScreenCapture::ScreenCaptureHelpCallBack

#include "ltwrappr.h"

virtual L_VOID LScreenCapture::ScreenCaptureHelpCallBack(uFlag, nCtlID, pUserData)

L_UINT32 uFlag; | /* flag indicating the origin of the help command message */
L_INT nCtlID; | /* control ID */
L_VOID L_FAR* pUserData; | /* pointer to additional parameters */

Provides the appropriate help information, based on the dialog from which help was requested.

Parameter | Description
uFlag | Flag that identifies the origin of the help command message. Possible values are:
 | Value | Meaning
 | SCRDLG_HELP_SETCAPTUREOPTION | [1] Help command message is coming from LScreenCapture::SetCaptureOptionDlg.
 | SCRDLG_HELP_CAPTUREAREAOPTION | [2] Help command message is coming from LScreenCapture::CaptureAreaOptionDlg.
 | SCRDLG_HELP_CAPTUREOBJECTOPTION | [3] Help command message is coming from LScreenCapture::CaptureObjectOptionDlg.
 | SCRDLG_HELP_CAPTUREFROMEXE | [4] Help command message is coming from LScreenCapture::CaptureFromExeDlg.
nCtlID | ID of the control that received the context sensitive help click. A value of –1 refers to the help button itself. For a list of other possible values, refer to the LTSCR.H file in the LEAD\INCLUDE directory.
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 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 callback function is optional. It is necessary only if you wish to provide help information for individual dialogs. The exact nature of the help provided is up to you, but you must override this function in order to provide that help. In addition, you must call LBase::EnableCallBack before calling any function that uses this callback.

This callback function is used with the following methods:

LScreenCapture::CaptureAreaOptionDlg

LScreenCapture::CaptureFromEXEDlg

LScreenCapture::CaptureObjectOptionDlg

LScreenCapture::SetCaptureOptionDlg

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

For an example, refer to LScreenCapture::SetCaptureOptionDlg.


LScreenCapture::SetBitmap

#include "ltwrappr.h"

virtual L_VOID LScreenCapture::SetBitmap(pLBitmap)

LBitmapBase L_FAR * pLBitmap;

/* pointer to a LEAD bitmap object */

Sets an LBitmapBase object (or any object derived from LBitmapBase) to be used by the screen capture functions.

Parameter | Description
pLBitmap | Pointer to a LEAD bitmap object to be used for capturing.

Returns

None

Comments

Before you can use any of the screen capture functions, a bitmap must be associated with the class object. Until you have associated a bitmap with the LScreenCapture object, the object is considered invalid.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

L_VOID TestFunction()
{
LBitmap LeadBitmap;
LScreenCapture screenCapture;
// attach the LBitmap object to screenCapture
screenCapture.SetBitmap(&LeadBitmap);

//…
}


LScreenCapture::SetCaptureAreaOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetCaptureAreaOptions(pCaptureAreaOption)

pLEADCAPTUREAREAOPTION pCaptureAreaOption;

/* pointer to a LEADCAPTUREAREAOPTION structure */

Sets options for capturing an area.

Parameter | Description
pCaptureAreaOption | Pointer to a LEADCAPTUREAREAOPTION structure.

Returns

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

Comments

Use this function to change the current area image capture options. For information on the default option settings, refer to LEADCAPTUREAREAOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::GetCaptureAreaOptions, Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);
LEADCAPTUREAREAOPTION CaptureAreaOptions;

nRet = screenCapture.GetCaptureAreaOptions(&CaptureAreaOptions);
if(nRet == SUCCESS)
{
// Set capture area to Triangle type
CaptureAreaOptions.uAreaType = CAPTURE_AREA_TRIANGLE;
nRet = screenCapture.SetCaptureAreaOptions(&CaptureAreaOptions);
if(nRet == SUCCESS)
{
// Current area will be captured using new settings
nRet = screenCapture.CaptureArea();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
}
}


LScreenCapture::SetCaptureObjectOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetCaptureObjectOptions(pCaptureObjectOptions)

pLEADCAPTUREOBJECTOPTION pCaptureObjectOptions;

/* pointer to a LEADCAPTUREOBJECTOPTION structure */

Sets options for capturing a window’s object.

Parameter | Description
pCaptureObjectOptions | Pointer to a LEADCAPTUREOBJECTOPTION structure that contains the options to be set.

Returns

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

Comments

Use this function to change the current object capture options. For information on the default option settings, refer to LEADCAPTUREOBJECTOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::GetCaptureObjectOptions, Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);
LEADCAPTUREOBJECTOPTION CaptureObjectOptions;

nRet = screenCapture.GetCaptureObjectOptions(&CaptureObjectOptions);
if(nRet == SUCCESS)
{
// Change flags of CaptureObjectOptions
CaptureObjectOptions.uFlags |= CAPTURE_OBJECT_INVERT;
// Set the new settings for CaptureSelectedObject
nRet = screenCapture.SetCaptureObjectOptions(&CaptureObjectOptions);
if(nRet == SUCCESS)
{
// select object will be captured using new settings
nRet = screenCapture.CaptureSelectedObject();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
}
}


LScreenCapture::SetCaptureOption

#include "ltwrappr.h"

static L_INT LScreenCapture::SetCaptureOption(pOptions)

pLEADCAPTUREOPTION pOptions;

/* address of structure with options */

Sets options for image capture, such as HotKey, Delay, and Count.

Parameter | Description
pOptions | Address of the structure where you have set the option values.

Returns

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

Comments

Use this function to change the current image capture options. For information on the default option settings, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members, LScreenCapture::SetCaptureOptionDlg, LScreenCapture::GetCaptureOption

Example

For an example, refer to LScreenCapture::GetCaptureOption.


LScreenCapture::SetCaptureOptionDlg

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetCaptureOptionDlg(hParentWnd, uFlags)

HWND hParentWnd; | /* handle to the parent window */
L_UINT uFlags; | /* flags to determine function behavior */

Brings up the capture option dialog box and sets the capture options.

Parameter | Description
hParentWnd | Handle to the parent window of the capture option dialog box
uFlags | Flags that specify the function behavior. Possible values are:
 | Value | Meaning
 | 0 | Ignore this flag. Pass this if you do not wish to use this flag.
 | SCRDLG_SETCAPTUREOPTION_CONTEXTHELP | [0x0001] Show the context help button.

Returns

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

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members, LScreenCapture::ScreenCaptureHelpCallBack

Example

// ScreenCapture Help Callbacks
class LUserScreenCapture : public LScreenCapture
{
HWND m_hWnd;
public:
LUserScreenCapture(HWND hWnd){m_hWnd = hWnd;}
virtual ~LUserScreenCapture(){};
virtual L_VOID ScreenCaptureHelpCallBack(L_UINT32 uFlag, L_INT nCtlID);
};

// This callback will be called once the help button is pressed
L_VOID LUserScreenCapture::ScreenCaptureHelpCallBack(L_UINT32 uFlag, L_INT nCtlID)
{
//

// set your code here...
//
}

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LUserScreenCapture screenCapture(hWnd);

screenCapture.EnableCallBack(TRUE);

// display a dialog to select capture options
nRet = screenCapture.SetCaptureOptionDlg(hWnd, SCRDLG_SETCAPTUREOPTION_CONTEXTHELP);
if(nRet == SUCCESS)
{
// capture ActiveWindow- HotKey = F11
// Press the hotkey after calling the function to activate capture
nRet = screenCapture.CaptureActiveWindow();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
return;
}


LScreenCapture::SetCaptureOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetCaptureOptions(pCaptureOptions)

pLEADCAPTUREOPTION pCaptureOptions;

/* pointer to a LEADCAPTUREOPTION structure */

Set options for image capture, such as HotKey, Delay, and Count.

Parameter | Description
pCaptureOptions | Pointer to a LEADCAPTUREOPTION structure that contains the capture options to be used.

Returns

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

Comments

Use this function to change the current image capture options. For information on the default option settings, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::GetCaptureOptions, Class Members

Example

L_VOID MyFunction(HWND hWnd)
{
L_INT nRet;
LScreenCapture screenCapture;
LEADCAPTUREOPTION CaptureOptions;

nRet = screenCapture.GetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
CaptureOptions.nHotKey = VK_F10;
// Change the options for the original screen capture object
nRet = screenCapture.SetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
// Active window will be captured using new settings
screenCapture.CaptureActiveWindow();

}
}
}


LScreenCapture::SetDefaultAreaOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetDefaultAreaOptions(void)

Restores the area capture options to the default settings.

Returns

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

Comments

For information on the default area options, refer to LEADCAPTUREAREAOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetDefaultCaptureOptions, LScreenCapture::SetDefaultObjectOptions, Class Members

Example

L_VOID MyFunction()
{
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// Change area options
//... do something
// Restore original area options
screenCapture.SetDefaultAreaOptions();
// do capture ...
return;
}


LScreenCapture::SetDefaultCaptureOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetDefaultCaptureOptions(void)

Restores the capture options to the default settings.

Returns

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

Comments

For information on the default capture options, refer to LEADCAPTUREOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetDefaultAreaOptions, LScreenCapture::SetDefaultObjectOptions, Class Members

Example

L_VOID CaptureSamples(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcClientRect;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);
LEADCAPTUREOPTION CaptureOptions;

nRet = screenCapture.GetCaptureOptions(&CaptureOptions);
if(nRet == SUCCESS)
{
// Set hot key to F10
CaptureOptions.nHotKey = VK_F10;
nRet = screenCapture.SetCaptureOptions(&CaptureOptions);
// Active window will be captured using new settings
nRet = screenCapture.CaptureActiveWindow();
// process the captured image
//...
// Set DefaultOptions
screenCapture.SetDefaultCaptureOptions();
// Capture using the default options HotKey = F11
nRet = screenCapture.CaptureActiveWindow();
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
GetClientRect(hWnd, &rcClientRect);
LeadBitmap.Paint()->SetDC(hDC);
LeadBitmap.SetDstRect(&rcClientRect);
LeadBitmap.Paint()->PaintDC();
ReleaseDC(hWnd, hDC);
}
}
}


LScreenCapture::SetDefaultObjectOptions

#include "ltwrappr.h"

virtual L_INT LScreenCapture::SetDefaultObjectOptions(void)

Restores the object capture options to the default settings.

Returns

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

Comments

For information about default object options, refer to LEADCAPTUREOBJECTOPTION.

Required DLLs and Libraries

LTDIS
LTSCR

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:

LScreenCapture::SetDefaultCaptureOptions, LScreenCapture::SetDefaultAreaOptions, Class Members

Example

L_VOID MyFunction()
{
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);

// Change object options
//... do something
// Restore default object options
screenCapture.SetDefaultObjectOptions();
// do capture ...
return;
}


LScreenCapture::StopCapture

#include "ltwrappr.h"

static L_INT LScreenCapture::StopCapture(void)

Stops the current capture process.

Returns

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

Comments

You should stop a previously started capture process before beginning another, or before the calling thread terminates.

You should not destroy any LScreenCapture object from another thread if this object is currently used in a capture operation without first calling LScreenCapture::StopCapture.

Required DLLs and Libraries

LTDIS
LTSCR

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:

Class Members

Example

For an example, refer to LScreenCapture::IsCaptureActive.


LSettings::LSettings

#include "ltwrappr.h"

L_VOID LSettings::LSettings(L_VOID)

Constructs and initializes the member variables of the LSettings object.

Returns

None

Comments

This is the constructor for the LSettings class.

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:

LSettings::~LSettings, Class Members

Example

L_VOID TestFunction()
{
// this will call the default constructor and destructor when it is out of scope
LSettings settings;

//…
}


LSettings::~LSettings

#include "ltwrappr.h"

virtual L_VOID LSettings::~LSettings(L_VOID)

Destroys the class object and frees any resources associated with it.

Returns

None

Comments

This is the destructor for the LSettings class.

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:

LSettings::LSettings, Class Members

Example

L_VOID TestFunction()
{
// destructor will be called when the variable is out of scope.
LSettings settings;

//…
}


LSettings::IsSupportLocked

#include "ltwrappr.h"

static L_BOOL LSettings::IsSupportLocked(uType)

L_UINT uType;

/* optional feature to check */

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

Parameter | Description
uType | The optional feature to check. For a list of possible values, refer to the uType parameter of LSettings::UnlockSupport.

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 LSettings::UnlockSupport function.

Note: Please note that the L_SUPPORT_VECTOR_DWG, L_SUPPORT_VECTOR_DWF, L_SUPPORT_VECTOR_DXF, L_SUPPORT_VECTOR_MISC and L_SUPPORT_VECTOR_ALL options for the iType parameter are now obsolete. If these constants are currently in your code, they will continue to work in LEADTOOLS 14.5. However, you should consider adding the LEADTOOLS Vector View Plug in or upgrading to the LEADTOOLS Vector Imaging Pro toolkit.

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:

LSettings::UnlockSupport, Class Members

Example

L_VOID TestFunction()
{
LSettings LeadSettings;
if (LeadSettings.IsSupportLocked (L_SUPPORT_DOCUMENT))
{
MessageBox (NULL, TEXT("Support for Document/Medical Capabilities is locked- You need to unlock Document/Medical capabilities"),
TEXT("IsSupportLocked"), MB_OK);
}
else
{
MessageBox (NULL, TEXT("You can use Document/Medical Capabilities"), TEXT("IsSupportLocked"), MB_OK);
}
}


LSettings::UnlockSupport

#include "ltwrappr.h"

static L_VOID LSettings::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 bar code 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.

Note: Please note that the L_SUPPORT_VECTOR_DWG, L_SUPPORT_VECTOR_DWF, L_SUPPORT_VECTOR_DXF, L_SUPPORT_VECTOR_MISC and L_SUPPORT_VECTOR_ALL options for the uType parameter are now obsolete. If these constants are currently in your code, they will continue to work in LEADTOOLS 14.5. However, you should consider adding the LEADTOOLS Vector View Plug in or upgrading to the LEADTOOLS Vector Imaging Pro toolkit.

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:

LSettings::~LSettings, LSettings::IsSupportLocked, Class Members

Example

L_VOID TestFunction()
{
LSettings LeadSettings;
//Unlock the Document/Medical Capabilities
//Note that this is a sample key, which will not work in your toolkit.
LeadSettings.UnlockSupport(L_SUPPORT_DOCUMENT, TEXT("TestKey"));
}


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 LSettings::UnlockSupport(L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

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

Document/Medical:

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

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

LEADTOOLS Document Imaging

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

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

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

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

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

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

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

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

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

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

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

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

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. 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 Licensing help file to review the License Agreements governing your use of the software.


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.

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 LSettings::UnlockSupport 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 LSettings::UnlockSupport to implement JPEG 2000 Plug In support in your application.


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.


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 LSettings::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 Licensing help file to review the License Agreements governing your use of the software.

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

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.


.topic 0x2b01
 Changing Bitmap Coordinates

 For the LPaint::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  as follows:

 LBitmapBase MyBitmap;

RECT rcSrc;

//calculate the rcSrc in TOP_LEFT coordinates

….

MyBitmap.RectToBitmap(TOP_LEFT, &rcSrc);

.topic 0x2b04
 Definitions of Spatial Filters

 The following are the #define statements for the constants used with the  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)

.topic 0x2b05
 Definitions of Binary Filters

 The following are the #define statements for the constants used with the  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)

.topic 0x502e
 Implementing Scrollbars: Step 1

 Modify the window style for your window to include the WS_VSCROLL and WS_HSCROLL styles.

.topic 0x502f
 Implementing Scrollbars: Step 2

 int XScrollRange, YScrollRange; /* Scrollbar ranges */

int XScrollPosition, YScrollPosition; /* Scrollbar positions */

.topic 0x5030
 Implementing Scrollbars: Step 3

 Here is some sample code that you could use (the CalcClientMetrics function is defined below):

 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);

/*---[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;

}

.topic 0x5031
 Implementing Scrollbars: Step 4

 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);

.topic 0x5039
 Zooming In on a Selection: Step 1

 LBase LeadBase;

 LeadBase.LoadLibraries(LT_ALL_LEADLIB);

 L_INT nRet = LeadBitmap.Load(TEXT("v:\\images\\eagle.cmp"));

 SetRect(&rLeadSource, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());

 SetRect(&rLeadDest, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());

 DisplayLeft = 0;

 DisplayTop = 0;

 DisplayWidth = LeadBitmap.GetWidth();

 DisplayHeight = LeadBitmap.GetHeight();

.topic 0x503a
 Zooming In on a Selection: Step 2

 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 */

HPEN SavedPen;

HBRUSH SavedBrush;

RECT rLeadDest;

RECT rLeadSource;

RECT rClientSize;

L_INT DisplayMode;

L_INT DisplayLeft, DisplayTop;

L_INT DisplayWidth, DisplayHeight;

.topic 0x503b
 Zooming In on a Selection: Step 3

 /* Save the starting position in screen pixels (used by GDI functions) */

 StartGDIX = point.x;

 StartGDIY = point.y;

 /* 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(LeadBitmap.GetWidth(), StartGDIX - rLeadDest.left, DisplayWidth);

 StartPixelY = MulDiv(LeadBitmap.GetHeight(), StartGDIY - rLeadDest.top, DisplayHeight);

 /* Initialize a variable used when the WM_MOUSEMOVE event outlines the area */

 FirstDraw = TRUE;

.topic 0x503c
 Zooming In on a Selection: Step 4

 HDC ThisWindowDC;

 /* Use GDI functions to outline the area to be cropped. */

 if (nFlags == MK_LBUTTON)

 {

 ThisWindowDC = ::GetDC(this->m_hWnd);

 SavedPen = (HPEN)::SelectObject(ThisWindowDC, GetStockObject(WHITE_PEN));

 SavedBrush = (HBRUSH)::SelectObject(ThisWindowDC, GetStockObject(NULL_BRUSH));

 DisplayMode = GetROP2(ThisWindowDC);

 SetROP2(ThisWindowDC, R2_NOT);

 if (FirstDraw == FALSE)

 Rectangle(ThisWindowDC, StartGDIX, StartGDIY, EndGDIX, EndGDIY);

 EndGDIX = point.x;

 EndGDIY = point.y;

 Rectangle(ThisWindowDC, StartGDIX, StartGDIY, EndGDIX, EndGDIY);

 FirstDraw = FALSE;

 SetROP2(ThisWindowDC, DisplayMode);

 ::ReleaseDC(this->m_hWnd, ThisWindowDC);

 }

.topic 0x503d
 Zooming In on a Selection: Step 5

 /* 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(LeadBitmap.GetWidth(), EndGDIX - rLeadDest.left, DisplayWidth);

 EndPixelY = MulDiv(LeadBitmap.GetHeight(), EndGDIY - rLeadDest.top, DisplayHeight);

 /* Do nothing if no area is defined */

 if ((EndPixelX == StartPixelX) || (EndPixelY == StartPixelY))

 return;

 /* 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;

 }

 ::GetClientRect(this->m_hWnd, &rClientSize);

 /* Use this function 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 */

 &DisplayLeft, /* Resulting left value, for centering */

 &DisplayTop, /* Resulting top 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.GetViewPerspective() != TOP_LEFT)

 LeadBitmap.RectToBitmap(TOP_LEFT, &rLeadSource);

 /* Repaint the whole client area */

 ::InvalidateRect(this->m_hWnd,NULL,TRUE);

 CView::OnLButtonUp(nFlags, point);

/*---[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 CTt2View::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;

}

.topic 0x503e
 Zooming In on a Selection: Step 6

 /* Set the source and destination rectangles for painting */

 SetRect(&rLeadSource, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());

 SetRect(&rLeadDest, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());

 /* Update the global variables for keeping track of the display */

 DisplayLeft = 0;

 DisplayTop = 0;

 DisplayWidth = LeadBitmap.GetWidth();

 DisplayHeight = LeadBitmap.GetHeight();

 /* Repaint the whole client area */

 ::InvalidateRect(this->m_hWnd,NULL,FALSE);

.topic 0x503f
 Zooming In on a Selection: Step 7

 LeadBitmap.SetDstRect(&rLeadDest);

 LeadBitmap.SetClipDstRect(&rLeadDest);

 LeadBitmap.SetSrcRect(&rLeadSource);

 LeadBitmap.SetClipSrcRect(&rLeadSource);

 HDC hDC;

 hDC = ::GetDC(this->m_hWnd);

 LeadBitmap.Paint()->SetDC(hDC);

 LeadBitmap.Paint()->PaintDC();

 ::ReleaseDC(this->m_hWnd, hDC);


BinaryDef

Definitions of Binary Filters

The following are the #define statements for the constants used with the LBitmap::BinaryFilter 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)


ChangeCoord

Changing Bitmap Coordinates

For the LPaint::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 LBitmapBase::RectToBitmap as follows:

LBitmapBase MyBitmap;
RECT rcSrc;
//calculate the rcSrc in TOP_LEFT coordinates
….
MyBitmap.RectToBitmap(TOP_LEFT, &rcSrc);


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.

All of the class library save functions take a pSAVEFILEOPTION argument, which defaults to NULL.

When NULL is passed for this argument, the Passes field of the SAVEFILEOPTION structure defaults to 0, which means the file saved will not be progressive. Alternatively, you can do the following:

SAVEFILEOPTION SaveOption;

LBaseFile::GetDefaultSaveFileOption(&SaveOption);

//Set any of the SaveOption fields

//pass &SaveOption to any of the Save member functions

Since the default for Passes=0, the saved file will not be progressive.

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:

/*******************************************************************************************

1.

First, create a class that derives from LFile. This class will include an override for LFile::LoadFileCallBack.

//MyLFile.h
#ifndef _MY_LFILE_H
#define _MY_LFILE_H

#include "d:\lead14\dll\include\classlib\ltwrappr.h"

class LProgressiveFile : public LFile
{
LEAD_DECLAREOBJECT(LProgressiveFile);
private:
HWND m_hWnd;

protected:
virtual L_INT LoadFileCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
);

public:
LProgressiveFile();
virtual ~LProgressiveFile();

L_VOID SetDisplayWnd(HWND hWnd);
L_INT LoadFile(
L_INT nBitsPerPixel=0,
L_INT nOrder=ORDER_BGRORGRAY,
L_UINT uFlags=LOADFILE_ALLOCATE | LOADFILE_STORE,
pLOADFILEOPTION pLoadFileOption = NULL
);

L_INT SaveBitmap(
L_INT nFormat,
L_INT nBitsPerPixel=0,
L_INT nQFactor=2,
L_UINT uFlags=SAVE_OVERWRITE,
pSAVEFILEOPTION pSaveFileOption = NULL
);
};

#endif _MY_LFILE_H

2.

Now, implement the class member functions as follows:

//MyLFile.cpp
#include "MyLFile.h"

LEAD_IMPLEMENTOBJECT(LProgressiveFile)

LProgressiveFile::LProgressiveFile()
{
m_hWnd=0;
}

LProgressiveFile::~LProgressiveFile()
{
}

L_VOID LProgressiveFile::SetDisplayWnd(HWND hWnd)
{
m_hWnd=hWnd;
}

L_INT LProgressiveFile::LoadFile(
L_INT nBitsPerPixel,
L_INT nOrder,
L_UINT uFlags,
pLOADFILEOPTION pLoadFileOption
)
{
L_BOOL bTemp;
L_INT nRet;
L_INT iOldPasses;
LOADFILEOPTION LoadFileOption;

if (pLoadFileOption == NULL)
{
LBaseFile::GetDefaultLoadFileOption(&LoadFileOption);
pLoadFileOption = &LoadFileOption;
}

iOldPasses = pLoadFileOption->Passes;
pLoadFileOption->Passes=CALLBACK_WHEN_MEANINGFUL;

if(!IsWindow(m_hWnd))
LEAD_ERROR_RETURN(WRPERR_INVALID_PARAMETERS);

bTemp=EnableCallBack(TRUE);
nRet=LFile::LoadFile(nBitsPerPixel,nOrder,uFlags, pLoadFileOption);
EnableCallBack(bTemp);
pLoadFileOption->Passes = iOldPasses;
return(nRet);
}

L_INT LProgressiveFile::SaveBitmap(
L_INT nFormat,
L_INT nBitsPerPixel,
L_INT nQFactor,
L_UINT uFlags,
pSAVEFILEOPTION pSaveFileOption
)
{
L_INT iOldPasses;
SAVEFILEOPTION SaveFileOption;

if(IsValid())
{
if (pSaveFileOption == NULL)
{
LBaseFile::GetDefaultSaveFileOption(&SaveFileOption);
pSaveFileOption = &SaveFileOption;
}

iOldPasses = pSaveFileOption->Passes;
pSaveFileOption->Passes=8;
}

L_INT nRet = LFile::SaveBitmap(nFormat,nBitsPerPixel,nQFactor,uFlags,pSaveFileOption);
pSaveFileOption->Passes = iOldPasses;
return nRet;
}

L_INT LProgressiveFile::LoadFileCallBack(
pFILEINFO pFileInfo,
LBitmapBase L_FAR* pLBitmap,
LBuffer L_FAR* pLBuffer,
L_UINT uFlags,
L_INT nRow,
L_INT nLines
)
{
LBuffer LBufferExp;
HDC hDC;
RECT Rect;

if(!IsWindow(m_hWnd))
return(SUCCESS);

::GetClientRect(m_hWnd,&Rect);

if(uFlags&FILEREAD_COMPRESSED)
LBufferExp.ExpandRows(*pLBuffer,pLBitmap->GetWidth(),nLines);

hDC=::GetDC(m_hWnd);

pLBitmap->SetSrcRect(&Rect);
pLBitmap->SetClipSrcRect(&Rect);
pLBitmap->SetDstRect(&Rect);
pLBitmap->SetClipDstRect(&Rect);

pLBitmap->Paint()->SetDC(hDC);
pLBitmap->Paint()->PaintDCBuffer(
(uFlags&FILEREAD_COMPRESSED)
?LBufferExp:*pLBuffer,
nRow,nLines
);
pLBitmap->Paint()->SetDC(0);
Sleep(3);

::ReleaseDC(m_hWnd,hDC);
return(SUCCESS);
}

3.

Now, you can use the new class as follows:

L_VOID Example54(HWND hWnd, L_TCHAR L_FAR* szFilename)
{
LProgressiveFile ProgressiveFile;
LBitmapBase Bitmap;

//load the image
Bitmap.Load(szFilename);
ProgressiveFile.SetBitmap(&Bitmap);
ProgressiveFile.SetFileName(TEXT("d:\\progress.cmp"));

//save the image in progressive format (8 passes)
ProgressiveFile.SaveBitmap(FILE_CMP,24,PQ2);

::InvalidateRect(hWnd,0,TRUE);
::UpdateWindow(hWnd);
//set the window to be used for displaying the progressive image
ProgressiveFile.SetDisplayWnd(hWnd);

//load the progressive file
ProgressiveFile.LoadFile(0,ORDER_BGR,LOADFILE_ALLOCATE|LOADFILE_STORE);
}


SpatialDef

Definitions of Spatial Filters

The following are the #define statements for the constants used with the LBitmap::SpatialFilter 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)


LAnnotation::operator=

#include "ltwrappr.h"

LAnnotation & LAnnotation::operator=(LAnnSource)

LAnnotation & LAnnSource;

/* the annotation object to be copied */

Makes a copy of the source annotation object. This function is available in the Document/Medical Toolkits.

Parameter | Description
LAnnSource | The annotation object to be copied.

Returns

The destination annotation object.

Comments

This function will update the destination class object 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.

See Also

Functions:

Class Members

Example

L_VOID TestEqualOperator(LAnnotation& LeadAnnotation)
{
LAnnotation MyAnn ;

MyAnn = LeadAnnotation ;

//...
}


LBitmapBase::operator=

#include "ltwrappr.h"

LBitmapBase& LBitmapBase::operator=(LBitmapSrc)

LBitmapBase& LBitmapSrc;

/* the source bitmap */

Makes a copy of a bitmap from another LBitmapBase object.

Parameter | Description
LBitmapSrc | The source LEAD bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this operator to make a copy of a bitmap from another LBitmapBase object. Only the bitmap data and handle will be copied, all other data members of the destination bitmap will not be changed.

The LBitmapSrc parameter is passed by reference, and is a required parameter.

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.

See Also

Elements:

LBitmapBase::Copy, Class Members

Example

LBitmapBase MyBitmap1, MyBitmap2;

MyBitmap1.Load(TEXT("image1.cmp"));
//now copy the bitmap
MyBitmap2 = MyBitmap1;


LBitmap::operator =

#include "ltwrappr.h"

LBitmap& LBitmap::operator =(LBitmapSrc)

LBitmap& LBitmapSrc;

/* the source LEAD bitmap */

Copies of a bitmap from another LBitmap object.

Parameter | Description
LBitmapSrc | The source LEAD bitmap.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Use this operator to make a copy of a bitmap from another LBitmap object. Only the bitmap data and handle will be copied, all other data members of the destination bitmap will not be changed.

The LBitmapSrc parameter is passed by reference, and is a required parameter.

Required DLLs and Libraries

LTDIS
LTFIL
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:

LBitmapBase::Copy, Class Members

Example

LBitmap MyBitmap1, MyBitmap2;

MyBitmap1.Load(TEXT("image1.cmp"));
//now copy the bitmap
MyBitmap2= MyBitmap1;


LBitmapList::operator=

#include "ltwrappr.h"

LBitmapList & LBitmapList::operator=(LBitmapListSrc)

LBitmapList & LBitmapListSrc;

/* the bitmap list object to be copied */

Use this operator to copy a bitmap list object.

Parameter | Description
LBitmapListSrc | The bitmap list object to be copied.

Returns

Reference to the bitmap list.

Comments

This will create a new bitmap list and copy the items from the source object. This results in two valid objects, both having their own copy of the data.

The LBitmapListSrc parameter is passed by reference, and is a required parameter.

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:

Class Members

Example

L_VOID CopyoperatorSample()
{
LBitmapList FirstList;
FirstList.Create();
//... load FirstList with data
LBitmapList SecondList;
// Use = operator to copy the list from FirstList to SecondList
SecondList = FirstList;
}


LBuffer::operator=

#include "ltwrappr.h"

LBuffer& LBuffer::operator=(lpStr)

LBuffer& LBuffer::operator=(LBufferSrc)

L_CHAR L_FAR * lpStr; | /* character string to copy */
LBuffer& LBufferSrc; | /* LBuffer object to copy*/

Copies the specified item to the class object’s buffer.

Parameter | Description
lpStr | The character string to copy.
LBufferSrc | The LBuffer object to copy.

Returns

The LBuffer object

Comments

LBuffer::operator=(LBufferSrc) copies the source class object's buffer to the destination class object's buffer. This results in two copies of the buffer.

The parameter LBufferSrc is passed by reference, and is a required parameter.

LBuffer::operator=(lpStr) copies the specified string to the destination class object's buffer.

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:

Class Members

Example

This is an example for LBuffer::operator=(LBufferSrc):

L_VOID TestEqualOperatorBuffer(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer;
LBuffer MyBuffer ;

LeadBitmap.GetRow(&LeadBuffer,6);

MyBuffer = LeadBuffer;
}

This is an example for LBuffer::operator=(lpStr):

L_VOID TestEqualOperatorString(LBitmapBase& LeadBitmap)
{
LBuffer LeadBuffer;
LBuffer MyBuffer ;

LeadBitmap.GetRow(&LeadBuffer,6);
MyBuffer = TEXT("My Buffer ABCD String");
}