Congrats Roger,

>Once I modified the monitor profile, is there a 
>way to "Save As"? Save the 
>profile under a new name? 

cmsSaveProfileToFile()

Regards
Marti

On Feb 4, 2017 18:21, Roger Breton <gr...@videotron.ca> wrote:

Eureka!

1) Create a new cmsCIEXYZ structure this way:

CIE_XYZ MyXYZ;

2) Populate its members with test values:

            MyXYZ.CIE_X = 0.9666;
            MyXYZ.CIE_Y = 1.0;
            MyXYZ.CIE_Z = 0.8555;

3) Create boolean variable for cmsWriteTag return code:

            bool Result;

4) Allocate unmanaged memory for MyXYZ:

            IntPtr Pointer = Marshal.AllocHGlobal(Marshal.SizeOf(MyXYZ));


5) Ask CLR to "move" the data from managed memory to unmanaged memory:

            Marshal.StructureToPtr(MyXYZ, Pointer, true);

6) I execute the call to cmsWriteTag:

            Result = cmsWriteTag(hProfiler, 0x77747074, Pointer);

7) The call succeeded! I got "Result = true"!

8) To test the change in XYZ values, I make a new call to cmsReadTag:

IntPtr Pointer = IntPtr.Zero;
Pointer = NativeMethods.cmsReadTag(hProfile, 0x77747074);
MyXYZ MediaWhitePoint = (MyCIEXYZ)Marshal.PtrToStructure(Pointer,
typeof(MyCIEXYZ));

9) And voilĂ ! These are the new XYZ values!!!!

            // X = 0.9666
            // Y = 1.0
            // Z = 0.8555

10) I love programming with LittleCMS -- thank YOU Marti Maria!!!!

I still have a TON of questions...

Once I modified the monitor profile, is there a way to "Save As"? Save the
profile under a new name?

/ Roger Breton



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to