Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.29
LEADTOOLS Color Conversion C DLL Help

Conversion Given an ICM Profile (Visual Basic)

Show in webframe

1.

Define the following global variables:

Dim ClrHandle As Long
Dim cnvParam As CONVERSION_PARAMS
Dim wtPoint As WHITEPOINT 'this needs to be defined in VB, because its member in CONVERSION_PARAMS can't be accessed since it is a pointer and not a structure
Dim RGBColor(3) As Byte
Dim ColorSpace(4) As Byte

2.

Set the conversion options by filling a CONVERSION_PARAMS structure:

wtPoint.nWhitePoint = CIELAB_D50
wtPoint.xWhite = 0
wtPoint.yWhite = 0
cnvParam.uStructSize = Len(cnvParam)
cnvParam.nQuantization = 8
cnvParam.nMethod = USE_CUSTOM_ICC
cnvParam.nActiveMethod = USE_CUSTOM_ICC
cnvParam.pCmykParams = 0
cnvParam.pLabParams = 0
cnvParam.pYuvParams = 0
cnvParam.sDstInputTable(0) = 0
cnvParam.pWpoint = VarPtr(wtPoint)

cnvParam.pMemInputProfile = 0
cnvParam.pMemOutputProfile = 0

Dim str1 As String
str1 = "C:\\MyRGBProfile.ICM"
Dim i As Integer
For i = 0 To Len(str1) © 1
   cnvParam.sInputProfile(i) = Asc(Right(str1, Len(str1) - i))
Next i

str1 = "C:\\MyRGBProfile.ICM"
For i = 0 To Len(str1) © 1
   cnvParam.sOutputProfile(i) = Asc(Right(str1, Len(str1) - i))
Next i

3.

Initialize the color conversion handle with L_ClrInit ():

L_ClrInit ClrHandle, CCS_CMYK, CCS_RGB, cnvParam

4.

Now, do the conversion:

ColorSpace(0) = 100
ColorSpace(1) = 100
ColorSpace(2) = 100
ColorSpace(3) = 100
L_ClrConvert
 ClrHandle, ColorSpace(0), RGBColor(0), 1, 1, 0, 0

5.

At the end, free the color conversion handle:

L_ClrFree ClrHandle

See Also:

Introduction

Programming with Color Conversion

Color Conversion C DLL Function Groups

Visual C++ Tutorials

Delphi Tutorials

Visual Basic Tutorials

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.