Hi,
Hi there, I'm trying to create a small VB app to apply a color
transform fom RGB to CMYK between two different profiles.
Visual Basic is unsupported because there is no way to
implement some functions, like those returning strings.
But for the transform stuff, it works quite well.
You need something like that:
Private Const INTENT_PERCEPTUAL = 0
Private Const cmsFLAGS_NOTPRECALC = &H100
Private Const TYPE_CMYK_8 = &H60021
Private Const TYPE_RGB_8 = &H40019
Private Declare Function cmsOpenProfileFromFile Lib "lcms.dll" (ByVal
lpFileName As String, ByVal sAccess As String) As Long
Private Declare Function cmsCreateTransform Lib "lcms.dll" (ByVal InputProfile As Long, ByVal InputFormat As Long, ByVal
OutputProfile As Long, ByVal OutputFormat As Long, ByVal Intent As Long, ByVal dwFlags As Long) As Long
Private Declare Sub cmsCloseProfile Lib "lcms.dll" (ByVal hProfile As Long)
Private Declare Sub cmsDeleteTransform Lib "lcms.dll" (ByVal hTransform As Long)
Private Declare Sub cmsDoTransform Lib "lcms.dll" (ByVal Transform As Long, InputBuffer As Any, OutputBuffer As Any, ByVal Size As
Long)
Private Type RGBColorType
R As Byte
G As Byte
B As Byte
End Type
Private Type CMYKColorType
C As Byte
M As Byte
Y As Byte
K As Byte
End Type
...
Private hCMYK As Long, hRGB As Long, hXFORM As Long
Private rgb1 As RGBColorType
Private cmyk1 As CMYKColorType
...
hCMYK = cmsOpenProfileFromFile("cmyk.icm", "r")
hRGB = cmsOpenProfileFromFile("srgb color space profile.icm", "r")
hXFORM = cmsCreateTransform(hRGB, TYPE_RGB_8, hCMYK, TYPE_CMYK_8, ,
INTENT_PERCEPTUAL, 0)
...
cmsDoTransform hXFORM, rgb1, cmyk1, 1
...
cmsDeleteTransform hXFORM
cmsCloseProfile hCMYK
cmsCloseProfile hRGB
Hope this helps,
Regards
--
Marti Maria
The littlecms project.
www.littlecms.com
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.21/96 - Release Date: 10/09/2005
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user