#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Sat, 26 Aug 2017 13:46:14 +0200
changeset 5581 63e21f277747
parent 5580 3f24169c2d32
child 5582 d88b01c6608b
#UI_ENHANCEMENT by cg class: ImageEditView comment/format in: #updateImageInfo: changed: #updateImageInfoFor:
ImageEditView.st
--- a/ImageEditView.st	Thu Aug 24 18:01:09 2017 +0200
+++ b/ImageEditView.st	Sat Aug 26 13:46:14 2017 +0200
@@ -3058,13 +3058,13 @@
     "Modified: / 29.7.1998 / 18:41:47 / cg"
 !
 
-updateImageInfo:something
-    "show something in the lower info area"
+updateImageInfo:someText
+    "show someText in the lower info area"
     
     |msg|
 
     imageInfoHolder notNil ifTrue:[
-        msg := something printString.
+        msg := someText printString.
         msg ~= imageInfoHolder value ifTrue:[
             imageInfoHolder value:msg.
         ].
@@ -3072,6 +3072,7 @@
     ].
 
     "Modified: / 16-02-2017 / 17:10:00 / cg"
+    "Modified (comment): / 26-08-2017 / 12:54:00 / cg"
 !
 
 updateImageInfoFor:aPoint
@@ -3098,6 +3099,8 @@
     
     self updateImageInfo:
         (String streamContents:[:s |
+            |redString greenString blueString|
+            
             s print:aPoint.
             s print:' (r:'; print:r.
             s print:' g:'; print:g.
@@ -3108,18 +3111,33 @@
                 m notNil ifTrue:[
                     s print:' m:'; print:m.
                 ].    
+            ].
+            
+            redString := (r hexPrintString:2).
+            greenString := (g hexPrintString:2).
+            blueString := (b hexPrintString:2).
+            ((image photometric == #rgb) or:[(image photometric == #rgba)]) ifTrue:[
+                (image bitsPerSample at:1) == 16 ifTrue:[
+                    redString := (r hexPrintString:4)
+                ].
+                (image bitsPerSample at:2) == 16 ifTrue:[
+                    greenString := (g hexPrintString:4)
+                ].
+                (image bitsPerSample at:2) == 16 ifTrue:[
+                    blueString := (b hexPrintString:4)
+                ].
             ].    
-            s print:(' #%1.%2.%3' bindWith:(r hexPrintString:2) with:(g hexPrintString:2) with:(b hexPrintString:2)).
+            s print:(' #%1.%2.%3' bindWith:redString with:greenString with:blueString).
             a notNil ifTrue:[
                 s print:'.'; print:(a hexPrintString:2)
             ].    
             image photometric == #palette ifTrue:[
-                s print:' pixel (index):'; print:pixel.
+                s print:' pixel index:'; print:pixel.
             ].
             s print:')'.
         ])
 
-    "Modified: / 21-02-2017 / 16:40:52 / cg"
+    "Modified: / 26-08-2017 / 13:20:51 / cg"
 ! !
 
 !ImageEditView methodsFor:'initialization & release'!