Jaime, I'm sending you privately a small sample on VB. Is for RGB to CMYK conversion, but I'm sure you will take the idea.
Saludos, Marti Maria The little cms project http://www.littlecms.com [EMAIL PROTECTED] ----- Original Message ----- From: "PABLO ESPAA RA RA RA" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 07, 2003 5:11 PM Subject: [Lcms-user] A little help in VBasic, please! Hello, sirs! I am trying to write a little program in Visual Basic, in order to see the LCMS DLL in action. That program should get an RGB value, and transform it to its equivalent RGB in an "Hitachi" display. Pretty simple, as you can see. But I am not able to make it work! Here is the code: First, I have the "definitions" module, with "declares", etc: ------------------------------------------------------ Option Explicit Public Type TRGB8 r As Byte g As Byte b As Byte End Type Public Const TYPE_RGB_8 As Long = 262169 Declare Function cmsOpenProfileFromFile Lib "lcms.dll" _ (ByVal sProfilePath As String, ByVal sAccess As String) As Long Declare Function cmsCloseProfile Lib "lcms.dll" _ (ByVal lProfileHandle As Long) As Boolean Declare Function cmsCreateTransform Lib "lcms.dll" _ (ByVal lInputProfile As Long, ByVal lInputFormat As Long, _ ByVal lOutputProfile As Long, ByVal lOutputFormat As Long, _ ByVal iIntent As Integer, ByVal lFlags As Long) As Long Declare Function cmsDoTransform Lib "lcms.dll" _ (ByVal lTransformHandle As Long, ByRef lInputBuffer As TRGB8, ByRef lOutputBuffer As TRGB8, ByVal lSize As Long) Declare Function cmsDeleteTransform Lib "lsms.dll" _ (ByVal lTransformHandle As Long) ------------------------------------------- And here is the code of the "main" program: ------------------------------------------- Option Explicit Private Sub Form_Load() Dim lInputProfile As Long Dim lOutputProfile As Long Dim lTransformHandle As Long Dim lOutputDib As Long Dim varRGB1 As TRGB8 Dim varRGB2 As TRGB8 ' Open/Create Profiles lInputProfile = cmsOpenProfileFromFile("sRGB.icm", "r") lOutputProfile = cmsOpenProfileFromFile("Hitachi.icm", "r") ' Create Transform lTransformHandle = cmsCreateTransform(lInputProfile, TYPE_RGB_8, lOutputProfile, TYPE_RGB_8, 0, 256) varRGB1.r = 1 varRGB1.g = 1 varRGB1.b = 1 ' Apply the transform Call cmsDoTransform(ByVal lTransformHandle, varRGB1, varRGB2, 1) ' Clean Up cmsDeleteTransform lTransformHandle cmsCloseProfile lInputProfile cmsCloseProfile lOutputProfile End Sub ------------------------------------------ When I try to run it, the program crashes, and Windows shows an error message ("Este programa ha efectuado una operaci�n no v�lida...", that is, "This program has done a non-valid operation..." or something like this... I am from Spain, and the message appears in spanish ;) ) I can't see what I am doing wrong, and I don't know what more can I do. Please, can you help me in how to use LCMS from Visual Basic? Thank you very very much. And congratulations for your great LCMS! Felicidades! Jaime Armero _________________________________________________________________ Descubre el mayor cat�logo de coches de la Red en MSN Motor. http://motor.msn.es/researchcentre/ ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Lcms-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/lcms-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ Lcms-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/lcms-user
