Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsICMProfileMBS class.

WindowsICMProfileMBS.OpenProfileData(data as string, DesiredAccess as Integer) as WindowsICMProfileMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The OpenColorProfile function opens or create a color profile.

file: The file where to load profile from.
DesiredAccess: Specifies how to access the given profile. This parameter must take one the following constant values.

ValueMeaning
PROFILE_READOpens the profile for read access.
PROFILE_READWRITEOpens the profile for both read and write access. Has no effect for WCS XML profiles.

Returns the profile on success and nil on error.

For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry.

When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE.

When the function opens the ICC profile, it will look for a WcsProfilesTag and, if there is one, it will extract and use the original WCS profiles contained therein. (See WcsCreateIccProfile.)

An profile with WCS profile information is derived from a DMP by acquiring the default CAMP and default GMMP from the registry. An HPROFILE is a composition of a DMP, CAMP and GMMP.

Some examples using this method:

WindowsICMProfileMBS.OpenProfileFile(file as folderitem, DesiredAccess as Integer, ShareMode as Integer, CreationMode as Integer) as WindowsICMProfileMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The OpenColorProfile function opens or create a color profile.

file: The file where to load profile from.
DesiredAccess: Specifies how to access the given profile. This parameter must take one the following constant values.

ValueMeaning
PROFILE_READOpens the profile for read access.
PROFILE_READWRITEOpens the profile for both read and write access. Has no effect for WCS XML profiles.

ShareMode: Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR).

ValueMeaning
FILE_SHARE_READOther open operations can be performed on the profile for read access.
FILE_SHARE_WRITEOther open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.

CreationMode: Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values.

ValueMeaning
CREATE_NEWCreates a new profile. Fails if the profile already exists.
CREATE_ALWAYSCreates a new profile. Overwrites the profile if it exists.
OPEN_EXISTINGOpens the profile. Fails if it does not exist
OPEN_ALWAYSOpens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
TRUNCATE_EXISTINGOpens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.

Returns the profile on success and nil on error.

For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry.

When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE.

CreationMode flags CREATE_NEW, CREATE_ALWAYS, and TRUNCATE_EXISTING, will always return blank ICC HPROFILEs. If other CreationMode flags are present, InternalOpenColorProfile is called (using the flags as provided by the API) to determine whether the profile is ICC or WCS XML.

Within the ICC code path, an ICC Profile is returned using the requested sharing, access and creation flags as specified in the tables above.

Within the WCS path, the CreationMode flag OPEN_ALWAYS will fail if the profile doesn't exist, since WCS profiles cannot be created or edited within the WCS architecture (they must be edited outside of it, using MSXML6). For the same reason, dwShareMode flag FILE_SHARE_WRITE, and dwDesiredAccess flag PROFILE_READWRITE are ignored within the WCS path.

When the function opens the ICC profile, it will look for a WcsProfilesTag and, if there is one, it will extract and use the original WCS profiles contained therein. (See WcsCreateIccProfile.)

An profile with WCS profile information is derived from a DMP by acquiring the default CAMP and default GMMP from the registry. An HPROFILE is a composition of a DMP, CAMP and GMMP.

WindowsICMProfileMBS.OpenProfilePath(path as string, DesiredAccess as Integer, ShareMode as Integer, CreationMode as Integer) as WindowsICMProfileMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Windows ICM MBS Win Plugin 11.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The OpenColorProfile function opens or create a color profile.

file: The file where to load profile from.
DesiredAccess: Specifies how to access the given profile. This parameter must take one the following constant values.

ValueMeaning
PROFILE_READOpens the profile for read access.
PROFILE_READWRITEOpens the profile for both read and write access. Has no effect for WCS XML profiles.

ShareMode: Specifies how the profile should be shared, if the profile is contained in a file. A value of zero prevents the profile from being shared at all. The parameter can contain one or both of the following constants (combined by addition or logical OR).

ValueMeaning
FILE_SHARE_READOther open operations can be performed on the profile for read access.
FILE_SHARE_WRITEOther open operations can be performed on the profile for write access. Has no effect for WCS XML profiles.

CreationMode: Specifies which actions to take on the profile while opening it, if it is contained in a file. This parameter must take one of the following constant values.

ValueMeaning
CREATE_NEWCreates a new profile. Fails if the profile already exists.
CREATE_ALWAYSCreates a new profile. Overwrites the profile if it exists.
OPEN_EXISTINGOpens the profile. Fails if it does not exist
OPEN_ALWAYSOpens the profile if it exists. For ICC profiles, if the profile does not exist, creates the profile. For WCS XML profiles, if the profile does not exist, returns an error.
TRUNCATE_EXISTINGOpens the profile, and truncates it to zero bytes, returning a blank ICC profile. Fails if the profile doesn't exist.

Returns the profile on success and nil on error.

For ICC and WCS profiles, a CAMP and GMMP are provided by the function based on the current default CAMP and GMMP in the registry.

When OpenColorProfile encounters an ICC profile with an embedded WCS profile, and if the dwType member within the Profile structure does not take the value DONT_USE_EMBEDDED_WCS_PROFILES, it should extract and use the WCS profile(s) contained in this WcsProfilesTag. The HPROFILE returned would be a WCS HPROFILE.

CreationMode flags CREATE_NEW, CREATE_ALWAYS, and TRUNCATE_EXISTING, will always return blank ICC HPROFILEs. If other CreationMode flags are present, InternalOpenColorProfile is called (using the flags as provided by the API) to determine whether the profile is ICC or WCS XML.

Within the ICC code path, an ICC Profile is returned using the requested sharing, access and creation flags as specified in the tables above.

Within the WCS path, the CreationMode flag OPEN_ALWAYS will fail if the profile doesn't exist, since WCS profiles cannot be created or edited within the WCS architecture (they must be edited outside of it, using MSXML6). For the same reason, dwShareMode flag FILE_SHARE_WRITE, and dwDesiredAccess flag PROFILE_READWRITE are ignored within the WCS path.

When the function opens the ICC profile, it will look for a WcsProfilesTag and, if there is one, it will extract and use the original WCS profiles contained therein. (See WcsCreateIccProfile.)

An profile with WCS profile information is derived from a DMP by acquiring the default CAMP and default GMMP from the registry. An HPROFILE is a composition of a DMP, CAMP and GMMP.

Some examples using this method:

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


The biggest plugin in space...