Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsICMProfileMBS class.

WindowsICMProfileMBS.ConvertColorNameToIndex(name as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The CMConvertColorNameToIndex function converts color names in a named color space to index numbers in a color profile.

name: The name of the color.

Returns the color index.

This function is required in the default CMM. It is optional for all other CMMs.

WindowsICMProfileMBS.ConvertIndexToColorName(index as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The ConvertIndexToColorName transforms indices in a color space to an array of names in a named color space.

This function is required in the default CMM. It is optional for all other CMMs.

WindowsICMProfileMBS.CountColorProfileElements as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetCountColorProfileElements function retrieves the number of tagged elements in a given color profile.
Example
dim file as FolderItem = SpecialFolder.Desktop.Child("test.icc")
dim w as WindowsICMProfileMBS = WindowsICMProfileMBS.OpenProfileFile(file, WindowsICMProfileMBS.PROFILE_READ, WindowsICMProfileMBS.FILE_SHARE_READ, WindowsICMProfileMBS.OPEN_EXISTING)

MsgBox "CountColorProfileElements: "+str(w.CountColorProfileElements)

Returns number of tagged elements in the profile or 0 on any error.
This function will fail if hProfile is not a valid ICC profile.
This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP.

Some examples using this method:

WindowsICMProfileMBS.CreateIccProfile(options as Integer = 0) as WindowsICMProfileMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 14.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Converts a WCS profile into an International Color Consortium (ICC) profile.

Options: A flag value that specifies the profile conversion options.By default, the original WCS profiles used for the conversion are embedded in the output ICC profile in a Microsoft private tag, ProfilesTag (with signature "MS000". This produces an ICC profile that is compatible with ICC software, yet retains the original WCS profile data available to code designed to parse it.The possible values of this parameter are as follows. Any bits not defined in this list are reserved and should be set to zero:
WCS_DEFAULTSpecifies that the new ICC profile contains the original WCS profile in a private ProfilesTag.
WCS_ICCONLYSpecifies that the new ICC profile does not contain either the ProfilesTag or the original WCS profile.

Returns new profile object.

see also
http://msdn.microsoft.com/en-us/library/windows/desktop/dd372239(v=vs.85).aspx

WindowsICMProfileMBS.GetColorProfileElement(tag as Integer) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetColorProfileElement function copies data from a specified tagged profile element of a specified color profile into a buffer.
Example
dim file as FolderItem = SpecialFolder.Desktop.Child("sRGB Profile.icc")
dim w as WindowsICMProfileMBS = WindowsICMProfileMBS.OpenProfileFile(file, WindowsICMProfileMBS.PROFILE_READ, WindowsICMProfileMBS.FILE_SHARE_READ, WindowsICMProfileMBS.OPEN_EXISTING)

MsgBox w.GetColorProfileElement(&h64657363) // that's the code for desc, the description

tag: Identifies the tagged element from which to copy.

This function will fail if Profile is not a valid International Color Consortium (ICC) profile.

This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because profile elements are implicitly associated with, and hard coded to, ICC tag types and there exist many robust XML parsing libraries.

Some examples using this method:

WindowsICMProfileMBS.GetColorProfileElementTag(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetColorProfileElementTag function retrieves the tag name specified by dwIndex in the tag table of a given International Color Consortium (ICC) color profile, where Index is a one-based index into that table.
Example
dim file as FolderItem = SpecialFolder.Desktop.Child("test.icc")
dim w as WindowsICMProfileMBS = WindowsICMProfileMBS.OpenProfileFile(file, WindowsICMProfileMBS.PROFILE_READ, WindowsICMProfileMBS.FILE_SHARE_READ, WindowsICMProfileMBS.OPEN_EXISTING)
dim list(-1) as string
dim c as Integer = w.CountColorProfileElements-1

for i as Integer = 0 to c
list.Append DecodingFromHexMBS(hex(w.GetColorProfileElementTag(i)))
next

MsgBox "Tags: "+Join(list, ", ")

Index: Specifies the one-based index of the tag to retrieve.

This function will fail if Profile is not a valid ICC profile.

GetColorProfileElementTag can be used to enumerate all tags in a profile after getting the number of tags in the profile using GetCountColorProfileElements.

This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because profile elements are implicitly associated with, and hard coded to, ICC tag types and there exist many robust XML parsing libraries.

Some examples using this method:

WindowsICMProfileMBS.GetNamedProfileInfo as WindowsICMNamedProfileInfoMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The GetNamedProfileInfo function retrieves information about the International Color Consortium (ICC) named color profile that is specified in the first parameter.

This function will fail if hProfile is not a valid ICC profile.
This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because named profiles are explicit ICC profile types.
Returns nil on any error.

WindowsICMProfileMBS.GetProfileData as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Given valid color profile, the GetProfileData function will return the contents of the profile.

If the object is a Windows Color System (WCS) handle, then the DMP is returned and the CAMP and GMMP associated with the HPROFILE are ignored.

Returns the data or an empty string on any error.
See GetColorProfileFromHandle in MSDN documentation.

WindowsICMProfileMBS.IsColorProfileTagPresent(tag as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The IsColorProfileTagPresent function reports whether a specified International Color Consortium (ICC) tag is present in the specified color profile.

tag: Specifies the ICC tag to check.

Returns true if the tag is valid and false if not.

This function will fail if Profile is not a valid ICC profile.

This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because profile elements are implicitly associated with and hard coded to ICC tag types and there exist many robust XML parsing libraries.

WindowsICMProfileMBS.IsValid as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The IsValid function reports whether the given profile is a valid ICC profile that can be used for color management.
Example
dim file as FolderItem = SpecialFolder.Desktop.Child("test.icc")
dim w as WindowsICMProfileMBS = WindowsICMProfileMBS.OpenProfileFile(file, WindowsICMProfileMBS.PROFILE_READ, WindowsICMProfileMBS.FILE_SHARE_READ, WindowsICMProfileMBS.OPEN_EXISTING)

MsgBox "Valid: "+str(w.IsValid)

Returns true if the profile is valid.

Only the Windows default CMM is required to export this function; it is optional for all other CMMs.

If a CMM does not support this function, Windows uses the default CMM to validate the profile.

WindowsICMProfileMBS.SetColorProfileHeader(header as WindowsICMProfileHeaderMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The SetColorProfileHeader function sets the header data in a specified ICC color profile.

Header: the profile header data to write to the specified profile.

Returns true on success.

This function will fail if Profile is not a valid ICC profile.

If the color profile was not opened with read/write permission, SetColorProfileHeader fails.

SetColorProfileHeader overwrites the current header in the ICC profile.

This function does not support Windows Color System (WCS) profiles CAMP, DMP, and GMMP; because profile elements are implicitly associated with and hard coded to ICC tag types and there exist many robust XML parsing libraries.

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...