#OTHER by stefan
authorStefan Vogel <sv@exept.de>
Mon, 08 Aug 2016 17:09:31 +0200
changeset 7493 59db55fd753a
parent 7492 34cfdad00603
child 7494 70c399ea367b
#OTHER by stefan class: Form added: #displayOn: #imageForm changed: #clearMaskedPixels: Bugfix for #clearMaskedPixels: (not used until now)
Form.st
--- a/Form.st	Mon Aug 08 14:06:35 2016 +0200
+++ b/Form.st	Mon Aug 08 17:09:31 2016 +0200
@@ -470,6 +470,12 @@
     "Created: / 07-06-2016 / 12:01:53 / cg"
 ! !
 
+!Form class methodsFor:'accessing private classes'!
+
+imageForm
+    ^ ImageForm
+! !
+
 !Form class methodsFor:'cleanup'!
 
 lowSpaceCleanup
@@ -1326,9 +1332,9 @@
 
     "black is 0 in mask - masked bits are 0"
     gc
-	foreground:Color allColor background:Color noColor;
-	function:#and;
-	copyPlaneFrom:maskForm x:0 y:0 toX:0 y:0 width:width height:height.
+        foreground:Color allColor background:Color noColor;
+        function:#and;
+        copyPlaneFrom:maskForm graphicsContext x:0 y:0 toX:0 y:0 width:width height:height.
 
     maskedPixelsAre0 := true.
 !
@@ -1632,6 +1638,15 @@
 
 !Form methodsFor:'printing & storing'!
 
+displayOn:aStreamOrGC
+    super displayOn:aStreamOrGC.
+    aStreamOrGC isStream ifTrue:[
+        aStreamOrGC nextPutAll:' (depth='.
+        depth printOn:aStreamOrGC.
+        aStreamOrGC nextPut:$).
+    ].
+!
+
 storeOn:aStream
     "append an ascii representation of the receiver to aStream,
      from which a copy of the receiver can be reconstructed"
@@ -1939,6 +1954,12 @@
 "
 ! !
 
+!Form::ImageForm methodsFor:'converting'!
+
+asImageForm
+    ^ self
+! !
+
 !Form::ImageForm methodsFor:'private'!
 
 getBits