[Gimp-developer] Primary monitor profile (Windows)

Yoshinori Yamakawa yam at yellowmagic.info
Sat Aug 11 14:11:01 PDT 2007


Hi,

Will the GIMP get possible to use the monitor color profile specified at the
monitor properties on Windows?

For example, it can read the primary monitor profile as follows:

--- cdisplay_lcms.c.orig  Sat Aug 11 23:07:54 2007
+++ cdisplay_lcms.c     Sun Aug 12 05:03:51 2007
@@ -26,6 +26,10 @@
 #include <lcms.h>
 #endif
 
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"
@@ -443,9 +447,29 @@
           g_free (data);
         }
     }
+#elif defined G_OS_WIN32
+  if (config->display_profile_from_gdk)
+    {
+      HDC hdc = GetDC (NULL);
+
+      if (hdc)
+        {
+          gchar *path;
+          gint32 len = 0;
+
+          GetICMProfile (hdc, &len, NULL);
+          path = g_new (gchar, len);
+
+          if (GetICMProfile (hdc, &len, path))
+            profile = cmsOpenProfileFromFile (path, "r");
+
+          g_free (path);
+          ReleaseDC (NULL, hdc);
+        }
+    }
 #endif
 
-  if (config->display_profile)
+  if (!profile && config->display_profile)
     profile = cmsOpenProfileFromFile (config->display_profile, "r");
 
   return profile;


-- 
View this message in context: http://www.nabble.com/Primary-monitor-profile-%28Windows%29-tf4254734.html#a12109062
Sent from the Gimp Developer mailing list archive at Nabble.com.



More information about the Gimp-developer mailing list