// Load color profiles and convert an image from CMYK into RGB color space.
// Get the base path for the running executable.
string exePath = Assembly.GetExecutingAssembly().Location;
Int32 nIndex = exePath.LastIndexOf("\\");
exePath = exePath.Remove(nIndex + 1, exePath.Length - nIndex - 1);
// Read color profiles from the executable's path.
using (FileStream fs = File.OpenRead(exePath + "ig_cmyk_profile.icm"))
ImGearColorProfileManager.CmykProfile = new ImGearColorProfile(fs);
using (FileStream fs = File.OpenRead(exePath + "ig_rgb_profile.icm"))
ImGearColorProfileManager.RgbProfile = new ImGearColorProfile(fs);
// Convert an opened CMYK image into the RGB colorspace using ImageGear color profiles.
ImGearRasterProcessing.ConvertColorSpace(igRasterPage,
new ImGearColorSpace(ImGearColorSpaceIDs.RGB), ImGearColorProfileManager.CmykProfile,
ImGearColorProfileManager.RgbProfile, ImGearRenderingIntents.PERCEPTUAL);
' Load color profiles and convert an image from CMYK into RGB color space.
' Get the base path for the running executable.
Dim exePath As String = Assembly.GetExecutingAssembly().Location
Dim nIndex As Int32 = exePath.LastIndexOf("\")
exePath = exePath.Remove(nIndex + 1, exePath.Length - nIndex - 1)
' Read color profiles from the executable's path.
Using fs As FileStream = File.OpenRead(exePath + "ig_cmyk_profile.icm")
ImGearColorProfileManager.CmykProfile = New ImGearColorProfile(fs)
End Using
Using fs As FileStream = File.OpenRead(exePath + "ig_rgb_profile.icm")
ImGearColorProfileManager.RgbProfile = New ImGearColorProfile(fs)
End Using
' Convert an opened CMYK image into the RGB colorspace using ImageGear color profiles.
ImGearRasterProcessing.ConvertColorSpace(igRasterPage, New ImGearColorSpace(ImGearColorSpaceIDs.RGB), _
ImGearColorProfileManager.CmykProfile, ImGearColorProfileManager.RgbProfile, ImGearRenderingIntents.PERCEPTUAL)