allow grabbing from depth>8 screens.
authorClaus Gittinger <cg@exept.de>
Fri, 04 Sep 1998 14:05:02 +0200
changeset 982 2dda94c7ff25
parent 981 5b3b9588e57d
child 983 286a039ea7d1
allow grabbing from depth>8 screens.
ImageEditor.st
--- a/ImageEditor.st	Fri Sep 04 14:01:30 1998 +0200
+++ b/ImageEditor.st	Fri Sep 04 14:05:02 1998 +0200
@@ -2110,21 +2110,26 @@
 grabScreenImage
     "let user choose an area and grab that are for editing"
 
-    |image img|
+    |image d8image img|
 
     image := Image fromUser.
 
     image depth > 8 ifTrue:[
         Object errorSignal handle:[:ex |
+            ex signal == Object haltSignal ifTrue:[ex reject].
+            ex signal == Signal noHandlerSignal ifTrue:[ex reject].
+
             self warn:'Could not convert to depth8 image (too many colors)'.
-            ^ self
+            d8image := nil.
         ] do:[
-            image := Depth8Image fromImage:image.
+            d8image := Depth8Image new.
+            d8image fromImage:image.
+        ].
+        d8image notNil ifTrue:[
+            image := d8image
         ]
     ].
-    (imageEditView image: image) notNil
-    ifTrue:
-    [
+    (imageEditView image:image) notNil ifTrue:[
         self listOfColors contents:(image colorMap).
         self findColorMapMode.
         self updateLabelsAndHistory.