Color Conversion to an Image (Delphi 4.0)

The Color Conversion C API provides color conversion to an image. To do a conversion, follow the steps below:

  1. At the beginning of the Unit1 file, add LTDLLUNT, LTDLLTYP, and LTDLLDEF to the uses section.

  2. Use the following code to direct color conversion to an image:

    function TForm1.LABToLEADBitmap({in}pSrcLAB: Pointer; {out}var pBitmap: BITMAPHANDLE; {in}nWidth, {in}nHeight: Integer) : {ret}Integer; 
    var 
    ret : Integer; (* return value *) 
    begin 
    (* 
    ****************************************************************** 
    * Simple conversion from CIELab to RGB24 LEAD bitmap             * 
    * Parameters :                                                   * 
    * pSrcLAB : 24 bit CIELab data, this is the input image data     * 
    * pBitmap : Handle to the resulting LEAD bitmap                  * 
    * nWidth  : Width of the image                                   * 
    * nHeight : Height of the image                                  * 
    * Returns SUCCESS when successful or an error code otherwise     * 
    ****************************************************************** 
    *) 
    ret := L_ClrConvertDirectToBitmap(CCS_LAB, 
    CCS_RGB, 
    pSrcLAB, 
    @pBitmap, 
    SizeOf(BITMAPHANDLE), 
    nWidth, 
    nHeight, 
    0, 
    0); 
    Result := ret; 
    end; 

See Also

Introduction

Bitmap Conversion Options

Color Conversion C API Function Groups

Getting Started

Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Color Conversion C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.