ImageGear22.Core Assembly > ImageGear.Processing Namespace > ImGearRasterProcessing Class > ConvertColorSpace Method : ConvertColorSpace(ImGearRasterPage,ImGearColorSpace,ImGearColorProfile,ImGearColorProfile,ImGearRenderingIntents) Method |
'Declaration Public Overloads Shared Sub ConvertColorSpace( _ ByVal page As ImGearRasterPage, _ ByVal newColorSpace As ImGearColorSpace, _ ByVal sourceProfile As ImGearColorProfile, _ ByVal destinationProfile As ImGearColorProfile, _ ByVal renderingIntent As ImGearRenderingIntents _ )
'Usage Dim page As ImGearRasterPage Dim newColorSpace As ImGearColorSpace Dim sourceProfile As ImGearColorProfile Dim destinationProfile As ImGearColorProfile Dim renderingIntent As ImGearRenderingIntents ImGearRasterProcessing.ConvertColorSpace(page, newColorSpace, sourceProfile, destinationProfile, renderingIntent)
public static void ConvertColorSpace( ImGearRasterPage page, ImGearColorSpace newColorSpace, ImGearColorProfile sourceProfile, ImGearColorProfile destinationProfile, ImGearRenderingIntents renderingIntent )
public: static void ConvertColorSpace( ImGearRasterPage* page, ImGearColorSpace newColorSpace, ImGearColorProfile* sourceProfile, ImGearColorProfile* destinationProfile, ImGearRenderingIntents renderingIntent )
public: static void ConvertColorSpace( ImGearRasterPage^ page, ImGearColorSpace newColorSpace, ImGearColorProfile^ sourceProfile, ImGearColorProfile^ destinationProfile, ImGearRenderingIntents renderingIntent )
// 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)