| Herd Software Development
DaVinci Graphics Library
DaVinci Documentation Home Search Order

Leonardo reference

The LEON3xxx.DLL. library is provided as a ready-made solution to a wide range of image processing problems and special requirements. Use of the Leonardo library in applications requires that the header file LEONARDO.H and its corresponding LIB file (and, where applicable, the LEONARDO Object Pascal unit) be integrated into your application.

The following is a list of developer-accessible functions exported by Leonardo.

Function Task

LoadDIBFromFile Reads a .BMP file into an HDIB handle

SaveDIBToFile Saves data in an HDIB handle as a .BMP file


RWxxxx Functions for pixelwise DIB access (RW signifies Read/Write)

CreateDIBPalette Generates an HPALETTE (palette handle) for a DIB in memory.

DIBFromBitmap Generates a DIB from a DDB and its palette

BitmapFromDIB Generates a DDB from a DIB

CreateDIB Generates a new (empty) DIB at the specified width, height and color depth

CreateCompatibeDIB Generates a DIB with the same characteristics as another DIB, allowing different size specifications for the new DIB.

DrawBitmap Draws a DDB into an HDC (device context). Provided as a simplified version of the BitBlt API function.

DIBBlt Draws DIB in the appropriate manner on an HDC. Provided as a simplified version of SetDIBitsToDevice.

StretchDIBBlt Draws a DIB to a new size (rescaled) on an HDC. Provided as a simplified version of StretchDIBits.

StretchDIB Creates a stretched/scaled-down/mirrored DIB from a whole DIB or DIB section without requiring an HDC.

StretchDIB2DIBBlt Copies a rectangular section of a source DIB into a target DIB without requiring an HDC.

ScaleToGray Creates a scaled-down DIB from a whole DIB or DIB section without requiring an HDC with high output quality.

CopyHandle Creates a copy of a memory handle, which can be, but is not limited to, a DIB handle.

LoadDIBFromResource Corresponds to the LoadBitmap API function, but returns an HDIB.

GrayDIB Converts a DIB to gray shades (grayscales).

DitherTo1 Converts a DIB with 4, 8, 16, 24 or 32 bits of color depth into a DIB with 1 bit of color depth (monochrome).

DitherTo4 Converts a DIB with 8, 16, 24 or 32 bits of color depth into a DIB with 4 bits of color depth (uses VGA palette).

DitherTo8 Converts a DIB with 16, 24 or 32 bits of color depth into a DIB with 8 bits of color depth (max. 256 colors).

ConvertDIB Converts a DIB of one color depth into a DIB of another color depth.

RotateDIB Rotates a DIB to the specified angle.

RotateMetaFile Rotates a metafile by 90 degree increments (90, 180 or 270 degrees).

RotateEnhMetaFile Rotates an enhanced metafile in 90 degree increments (90, 180 or 270 degrees).

TransformDIB DIB conversion routine for complex applications; allows use of callbacks.

CreateFIRFilteredDIB Applies a filter matrix to a 24 bit DIB. For example can be used to sharpen, blur, change color and contrast.

CreateSharpenedDIB Creates a sharpened copy of a 24 bit DIB.

TWAINInitialize Initializes the TWAIN interface.

TWAINTerminate Signals end of TWAIN operations

TWAINSelectDS Select active TWAIN device for next acquisition procedure

TWAINAquire Acquire graphic data from selected TWAIN device.

TWAINAquireExt Acquire graphic data from selected TWAIN device.

TWAINIsDSMOpen Determine whether a TWAIN device is currently open on the system.

Splineline Draws a spline (plotted curve) based on control points supplied by the application.

GammaCorrectionGetArray Computes an array for use in gamma correction with GammaCorrectionApplyToDIB.

GammaCorrectionApplyToDIB Generates a gamma-corrected copy of a DIB.

DIBSelectColors Optimizes the color palette and dithers TrueColor DIBs to 256 colors using high-quality Floyd-Steinberg dithering.

DIBDetectBarCode Scans bitmaps for bar codes.

DIBIsCmyk Checks if a given DIB is in CMYK color space.

DIBCmyk2Rgb Converts a DIB from CMYK color space to RGB color space..

DIBAlphaBlend Alpha blending of two DIBs, where one might contain an Alpha channel in RGBA-DIB format.


Leonardo is licensed as a part of the DaVinci library. No other license necessary for its use. Separate licensing for Leonardo alone (i.e. not as part of the DaVinci library) is not currently available.

See also:

Image editing with Windows API functions

Windows graphics formats