ImageEditView.st
author Claus Gittinger <cg@exept.de>
Mon, 03 Nov 1997 16:19:36 +0100
changeset 606 fefb91a25597
parent 599 66c4da764a9e
child 624 d98fe4700fc2
permissions -rw-r--r--
catch invalid format errors
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     1
"
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
26
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
     3
	      All Rights Reserved
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     4
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    11
"
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    12
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    13
ImageView subclass:#ImageEditView
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    14
	instanceVariableNames:'magnification colors magnifiedImage colorPanel pathName enhance
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    15
		antiAlias'
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    16
	classVariableNames:''
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    17
	poolDictionaries:''
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    18
	category:'Views-Misc'
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    19
!
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    20
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    21
!ImageEditView class methodsFor:'documentation'!
64
claus
parents: 61
diff changeset
    22
claus
parents: 61
diff changeset
    23
copyright
claus
parents: 61
diff changeset
    24
"
claus
parents: 61
diff changeset
    25
 COPYRIGHT (c) 1993 by Claus Gittinger
claus
parents: 61
diff changeset
    26
	      All Rights Reserved
claus
parents: 61
diff changeset
    27
claus
parents: 61
diff changeset
    28
 This software is furnished under a license and may be used
claus
parents: 61
diff changeset
    29
 only in accordance with the terms of that license and with the
claus
parents: 61
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
claus
parents: 61
diff changeset
    31
 be provided or otherwise made available to, or used by, any
claus
parents: 61
diff changeset
    32
 other person.  No title to or ownership of the software is
claus
parents: 61
diff changeset
    33
 hereby transferred.
claus
parents: 61
diff changeset
    34
"
claus
parents: 61
diff changeset
    35
!
claus
parents: 61
diff changeset
    36
claus
parents: 61
diff changeset
    37
documentation
claus
parents: 61
diff changeset
    38
"
claus
parents: 61
diff changeset
    39
    This View will eventually be able to edit bitmap images.
claus
parents: 61
diff changeset
    40
    For now, it is not.
296
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    41
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    42
    [author:]
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    43
        Claus Gittinger
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    44
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    45
    [see also:]
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
    46
        Image Form
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    47
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    48
    [start with:]
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    49
        ImageEditView openOn:'bitmaps/gifImages/garfield.gif'
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    50
        ImageEditView openOnImage:(Image fromFile:'bitmaps/gifImages/garfield.gif')
64
claus
parents: 61
diff changeset
    51
"
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    52
! !
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
    53
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    54
!ImageEditView class methodsFor:'startup'!
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    55
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    56
openOn:aFileName
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    57
    "startup an image editor on an image read from a file"
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    58
599
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    59
    |editView fn dir|
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    60
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    61
    editView := super openOn:aFileName.
599
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    62
    dir := (fn := aFileName asFilename) directory.
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    63
    dir exists ifTrue:[
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    64
        editView pathName:(fn pathName).
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    65
    ].
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    66
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    67
    ^ editView
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    68
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    69
    "
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    70
     ImageEditView openOn:'bitmaps/gifImages/garfield.gif'
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    71
     ImageEditView openOn:'bitmaps/xpmBitmaps/BOOK.xpm'
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    72
    "
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    73
599
66c4da764a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
    74
    "Modified: / 31.10.1997 / 16:19:23 / cg"
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    75
! !
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
    76
7
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
    77
!ImageEditView methodsFor:'accessing'!
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
    78
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
    79
image:anImage
295
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    80
    |oldMag|
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    81
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    82
    oldMag := magnification.
7
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
    83
    magnification := 1@1.
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
    84
    magnifiedImage := nil.
295
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    85
    super image:anImage.
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    86
    self magnification:oldMag
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    87
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
    88
    "Modified: 20.2.1997 / 18:29:13 / cg"
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    89
!
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    90
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    91
magnification:aMagnificationPoint
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
    92
    |nPixel savedImage oldBounds newBounds rects|
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    93
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    94
    magnification ~= aMagnificationPoint ifTrue:[
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
    95
        "show wait cursor; although magnification is fast, dithering may take a while"
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
    96
        self withWaitCursorDo:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
    97
            magnifiedImage isNil ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
    98
                oldBounds := image bounds.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
    99
            ] ifFalse:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   100
                oldBounds := magnifiedImage bounds
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   101
            ].
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   102
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   103
            (device visualType == #PseudoColor) ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   104
                "release kept colors"
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   105
                colors := IdentitySet new.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   106
            ].
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   107
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   108
            magnification := aMagnificationPoint asPoint.
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   109
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   110
            "use a magnified image, if its size wont be too big"
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   111
            magnifiedImage := nil.
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   112
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   113
            "avoid slow scroll"
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   114
            savedImage := image.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   115
            image := nil.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   116
            self scrollToTopLeft.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   117
            image := savedImage.
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   118
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   119
            magnification ~= (1@1) ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   120
                nPixel := image width * image height * magnification x * magnification y.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   121
                nPixel <= (2000 * 2000) ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   122
                    Transcript showCR:'magnifying ..'; endEntry.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   123
                    antiAlias ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   124
                        magnifiedImage := image hardAntiAliasedMagnifiedBy:magnification
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   125
                    ] ifFalse:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   126
                        magnifiedImage := image magnifiedBy:magnification
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   127
                    ]
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   128
                ].
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   129
            ].
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   130
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   131
            self contentsChanged.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   132
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   133
            magnifiedImage isNil ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   134
                newBounds := image bounds.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   135
            ] ifFalse:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   136
                newBounds := magnifiedImage bounds
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   137
            ].
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   138
            (rects := oldBounds areasOutside:newBounds) notNil ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   139
                rects do:[:rect |
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   140
                    self clearRectangle:rect+(1@1).
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   141
                ]
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   142
            ]
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   143
        ].
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   144
        self invalidate.
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   145
    ]
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   146
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   147
    "Modified: 4.6.1997 / 13:38:16 / cg"
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   148
!
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   149
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   150
pathName:aPathName
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   151
    "set the pathName of the edited image.
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   152
     This is used as a default in the save-dialog"
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   153
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   154
    pathName := aPathName
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   155
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   156
    "Created: 10.4.1997 / 17:31:54 / cg"
7
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
   157
! !
19b36b78ee01 *** empty log message ***
claus
parents: 5
diff changeset
   158
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   159
!ImageEditView methodsFor:'drawing'!
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   160
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   161
redrawX:x y:y width:w height:h
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   162
    |area ih iw dotW dotH minX maxX minY maxY color last lastY runW x0 oldClip|
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   163
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   164
    image isNil ifTrue:[^ self].
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   165
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   166
    (magnification = (1@1)) ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   167
        super redrawX:x y:y width:w height:h.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   168
        ^ self
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   169
    ].
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   170
        
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   171
    magnifiedImage notNil ifTrue:[
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   172
        self function:#copy.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   173
        self paint:Black.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   174
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   175
        magnifiedImage device ~~ device ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   176
            "/ this may take some time (allocating colors & dithering
205
96f80d06fe5a oops - care for d1 images colors
Claus Gittinger <cg@exept.de>
parents: 204
diff changeset
   177
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   178
            self 
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   179
                displayRectangleX:margin y:margin 
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   180
                width:magnifiedImage width height:magnifiedImage height.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   181
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   182
            self withWaitCursorDo:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   183
                magnifiedImage := magnifiedImage on:device.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   184
            ]
204
e419b26888e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   185
        ].
e419b26888e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   186
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   187
        self withWaitCursorDo:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   188
            magnifiedImage depth == 1 ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   189
                self paint:(magnifiedImage colorFromValue:1)
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   190
                        on:(magnifiedImage colorFromValue:0).
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   191
            ] ifFalse:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   192
                self paint:Black on:White.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   193
            ].
295
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   194
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   195
            (magnifiedImage depth ~~ 1
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   196
            and:[magnifiedImage mask notNil]) ifTrue:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   197
                self clearRectangleX:x y:y width:w height:h.
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   198
                self displayForm:magnifiedImage x:margin y:margin 
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   199
            ] ifFalse:[
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   200
                self displayOpaqueForm:magnifiedImage x:margin y:margin 
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   201
            ].
430
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   202
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   203
            "/ right of image ?
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   204
            (x + w - 1) > magnifiedImage width ifTrue:[
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   205
                self clearRectangleX:(magnifiedImage width)
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   206
                                   y:y
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   207
                               width:(x + w - 1 - magnifiedImage width)
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   208
                              height:h  
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   209
            ].
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   210
            "/ below of image ?
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   211
            (y + h - 1) > magnifiedImage height ifTrue:[
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   212
                self clearRectangleX:margin
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   213
                                   y:(magnifiedImage height)
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   214
                               width:w
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   215
                              height:(y + h - 1 - magnifiedImage height)  
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   216
            ].
295
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   217
        ].
6388ebe84be2 fixed display of magnified image with mask.
Claus Gittinger <cg@exept.de>
parents: 294
diff changeset
   218
203
0ef4bbc2524f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   219
        ^ self
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   220
    ].
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   221
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   222
    ih := image height.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   223
    iw := image width.
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   224
    dotW := magnification x.
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   225
    dotH := magnification y.
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   226
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   227
    minX := x // dotW.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   228
    minY := y // dotW.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   229
    maxX := (x + w) // dotW + 1.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   230
    maxX > iw ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   231
        maxX := iw
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   232
    ].
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   233
    maxY := (y + h) // dotH + 1.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   234
    maxY > ih ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   235
        maxY := ih
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   236
    ].
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   237
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   238
    lastY := -1.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   239
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   240
    x0 := minX.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   241
    runW := 0.
204
e419b26888e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   242
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   243
    image colorsFromX:minX y:minY toX:maxX-1 y:maxY-1 do:[:x :y :color |
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   244
        y ~~ lastY ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   245
            runW ~~ 0 ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   246
                self fillRectangleX:(x0 * dotW + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   247
                                  y:(lastY * dotH + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   248
                              width:runW height:dotH.
203
0ef4bbc2524f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   249
                runW := 0.
0ef4bbc2524f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   250
            ].
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   251
            x0 := x.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   252
            lastY := y.
204
e419b26888e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   253
        ].
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   254
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   255
        color ~~ last ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   256
            runW ~~ 0 ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   257
                self fillRectangleX:(x0 * dotW + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   258
                                  y:(y * dotH + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   259
                              width:runW height:dotH.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   260
                runW := 0.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   261
            ].
204
e419b26888e1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 203
diff changeset
   262
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   263
            "/ keep colors - otherwise they might get collected & changed
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   264
            colors notNil ifTrue:[colors add:color].
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   265
            self paint:color.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   266
            last := color.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   267
            runW := 0.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   268
            x0 := x.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   269
        ].
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   270
        runW := runW + dotW
191
87e4b26cd344 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   271
    ].
87e4b26cd344 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   272
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   273
    runW ~~ 0 ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   274
        self fillRectangleX:(x0 * dotW + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   275
                          y:(lastY * dotH + margin)
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   276
                      width:runW height:dotH.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   277
        runW := 0.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   278
    ].
191
87e4b26cd344 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   279
430
574a94732ece checkin from browser
Claus Gittinger <cg@exept.de>
parents: 429
diff changeset
   280
    "Modified: 23.6.1997 / 21:24:40 / cg"
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   281
! !
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   282
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   283
!ImageEditView methodsFor:'event handling'!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   284
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   285
buttonMotion:state x:x y:y
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   286
    self showColorAtX:x y:y.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   287
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   288
167
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   289
buttonMultiPress:button x:x y:y
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   290
    button == 1 ifTrue:[
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   291
        |clr|
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   292
        clr := self getColorAtX:x y:y.
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   293
        clr inspect.
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   294
    ].
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   295
    super buttonMultiPress:button x:x y:y
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   296
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   297
    "Created: 8.5.1996 / 00:18:06 / stefan"
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   298
!
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   299
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   300
buttonPress:button x:x y:y
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   301
    button == 1 ifTrue:[
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   302
	self showColorAtX:x y:y.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   303
	^ self
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   304
    ].
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   305
    super buttonPress:button x:x y:y
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   306
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   307
167
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   308
getColorAtX:x y:y
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   309
    |pi|
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   310
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   311
    pi := (x @ y) - margin.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   312
    pi := pi // magnification.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   313
    ((0@0 corner:image extent) containsPoint:pi) ifTrue:[
167
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   314
        ^ image at:pi.
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   315
    ].
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   316
    ^ nil
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   317
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   318
    "Created: 8.5.1996 / 00:15:55 / stefan"
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   319
!
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   320
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   321
showColorAtX:x y:y
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   322
    |clr|
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   323
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   324
    clr := self getColorAtX:x y:y.
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   325
    clr notNil ifTrue:[
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   326
        colorPanel notNil ifTrue:[
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   327
            colorPanel setColor:clr.
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   328
        ] ifFalse:[
184
13a2f3677c68 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 167
diff changeset
   329
            Transcript showCR:clr displayString
167
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   330
        ]
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   331
    ]
167
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   332
0d6d90115420 Doubleclick on pixel opens colorInspector.
Stefan Vogel <sv@exept.de>
parents: 161
diff changeset
   333
    "Modified: 8.5.1996 / 00:20:45 / stefan"
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   334
! !
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   335
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   336
!ImageEditView methodsFor:'image conversion'!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   337
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   338
convertToColor24
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   339
    (Depth24Image fromImage:image) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   340
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   341
    "Modified: 3.6.1997 / 18:34:34 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   342
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   343
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   344
convertToColor4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   345
    (Depth4Image fromImage:image) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   346
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   347
    "Modified: 3.6.1997 / 18:34:45 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   348
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   349
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   350
convertToColor8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   351
    (Depth8Image fromImage:image) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   352
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   353
    "Created: 3.6.1997 / 18:34:08 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   354
    "Modified: 3.6.1997 / 18:34:51 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   355
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   356
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   357
convertToGray2
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   358
    (image asFloydSteinbergDitheredGrayImageDepth:2) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   359
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   360
    "Created: 3.6.1997 / 18:34:02 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   361
    "Modified: 3.6.1997 / 18:39:23 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   362
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   363
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   364
convertToGray4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   365
    (image asFloydSteinbergDitheredGrayImageDepth:4) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   366
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   367
    "Created: 3.6.1997 / 18:34:04 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   368
    "Modified: 3.6.1997 / 18:39:20 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   369
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   370
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   371
convertToGray8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   372
    (image asFloydSteinbergDitheredGrayImageDepth:8) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   373
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   374
    "Created: 3.6.1997 / 18:34:05 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   375
    "Modified: 3.6.1997 / 18:39:16 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   376
!
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   377
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   378
convertToMono
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   379
    (image asFloydSteinbergDitheredGrayImageDepth:1) inspect
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   380
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   381
    "Created: 3.6.1997 / 18:33:42 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   382
    "Modified: 3.6.1997 / 18:39:26 / cg"
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   383
! !
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   384
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   385
!ImageEditView methodsFor:'image processing'!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   386
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   387
blurr
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   388
    self performImageOperation:#blurr withArguments:nil
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   389
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   390
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   391
flipHorizontal
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   392
    self performImageOperation:#flipHorizontal withArguments:nil
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   393
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   394
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   395
flipVertical
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   396
    self performImageOperation:#flipVertical withArguments:nil
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   397
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   398
426
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   399
negative
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   400
    self performImageOperation:#negative withArguments:nil
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   401
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   402
    "Modified: 20.6.1997 / 13:14:45 / cg"
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   403
!
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   404
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   405
performImageOperation:operation withArguments:args
429
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   406
    |oldMag newImage|
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   407
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   408
    windowGroup withCursor:Cursor wait do:[
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   409
        oldMag := magnification.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   410
        magnifiedImage := nil.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   411
        magnification := 1@1.
429
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   412
        newImage := image perform:operation withArguments:args.
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   413
        newImage isNil ifTrue:[
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   414
            self information:'conversion failed - revert to original'.
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   415
            ^ self
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   416
        ].
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   417
        image := newImage.
413
3d0910d706c9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 406
diff changeset
   418
        self clear.
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   419
        (oldMag isNil or:[oldMag = magnification]) ifTrue:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   420
            self invalidate
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   421
        ] ifFalse:[
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   422
            self magnification:oldMag.
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   423
        ]
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   424
    ]
210
1a3b06d71a03 faster redraw; care for margins
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
   425
429
f98e6af57214 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
   426
    "Modified: 23.6.1997 / 09:49:26 / cg"
322
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   427
!
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   428
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   429
resizeImage
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   430
    |b newSize newImage wNew hNew bits|
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   431
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   432
    b := EnterBox new.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   433
    b title:'new size (x @ y) contents will be located at top-left'.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   434
    b okText:'apply'.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   435
    b abortText:'abort'.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   436
    b action:[:string | newSize := Object readFromString:string onError:nil].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   437
    b initialText:(image extent printString).
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   438
    b showAtPointer.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   439
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   440
    newSize notNil ifTrue:[
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   441
        wNew := image width min:newSize x.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   442
        hNew := image height min:newSize y.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   443
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   444
        newImage := Image width:(newSize x) height:(newSize y) depth:(image depth).
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   445
        newImage photometric:image photometric.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   446
        newImage colorMap:image colorMap copy.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   447
        newImage bits:(ByteArray new:(newImage bytesPerRow * newSize y)).
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   448
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   449
        newImage copyFrom:image x:0 y:0 toX:0 y:0 width:wNew height:hNew.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   450
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   451
        newImage inspect
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   452
    ].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   453
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   454
    "Created: 31.7.1997 / 11:41:14 / cg"
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   455
    "Modified: 31.7.1997 / 13:45:47 / cg"
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   456
!
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   457
322
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   458
rotateCCW
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   459
    self performImageOperation:#rotated: withArguments:#(270)
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   460
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   461
    "Created: 17.3.1997 / 11:56:42 / cg"
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   462
!
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   463
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   464
rotateCW
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   465
    self performImageOperation:#rotated: withArguments:#(90)
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   466
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   467
    "Created: 17.3.1997 / 11:56:36 / cg"
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   468
! !
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   469
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   470
!ImageEditView methodsFor:'initialization'!
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   471
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   472
initialize
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   473
    super initialize.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   474
    magnification := 1@1.
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   475
    antiAlias := false.
296
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
   476
    colors := nil.
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
   477
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
   478
    self menuHolder:self; menuPerformer:self; menuMessage:#imageMenu.
f1007170201e see also
Claus Gittinger <cg@exept.de>
parents: 295
diff changeset
   479
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   480
    "Modified: 2.6.1997 / 15:49:00 / cg"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   481
! !
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   482
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   483
!ImageEditView methodsFor:'menu'!
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   484
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   485
imageMenu
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   486
    |m convertMenu labels selectors|
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   487
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   488
    image mask notNil ifTrue:[
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   489
        labels := #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   490
                        'save as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   491
                        'save mask as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   492
                       ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   493
        selectors := #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   494
                        saveAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   495
                        saveMaskAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   496
                      ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   497
        magnifiedImage notNil ifTrue:[
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   498
            labels := labels , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   499
                        '-'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   500
                        'save magnified as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   501
                        'save magnified mask as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   502
                       ).
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   503
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   504
            selectors := selectors , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   505
                        nil
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   506
                        saveMagnifiedAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   507
                        saveMagnifiedMaskAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   508
                      ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   509
        ]
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   510
    ] ifFalse:[
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   511
        labels := #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   512
                        'save as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   513
                       ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   514
        selectors := #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   515
                        saveAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   516
                      ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   517
        magnifiedImage notNil ifTrue:[
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   518
            labels := labels , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   519
                        '-'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   520
                        'save magnified as ...'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   521
                       ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   522
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   523
            selectors := selectors , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   524
                        nil
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   525
                        saveMagnifiedAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   526
                      ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   527
        ]
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   528
    ].
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   529
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   530
    labels := labels , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   531
                            '-'
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   532
                            'print'
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   533
                            'print magnified'
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   534
                            '-'
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   535
                            'magnification'
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   536
                            'magnify & antiAlias'
26
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   537
"/                            'colors'
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   538
                            'effects'
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   539
                            'convert to'
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   540
                        ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   541
    selectors := selectors , #(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   542
                        nil
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   543
                        doPrint
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   544
                        doPrintMagnified
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   545
                        nil
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   546
                        changeMagnification
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   547
                        changeMagnificationAndAntiAlias
26
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   548
"/                        showColors
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   549
                        effects
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   550
                        convert
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   551
                        ).
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   552
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   553
    m := PopUpMenu
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   554
               labels:(resources array:labels)
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   555
            selectors:selectors
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   556
             receiver:self
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   557
                  for:self.
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   558
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   559
    magnification = 1 ifTrue:[
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   560
        m disable:#doPrintMagnified
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   561
    ].
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   562
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   563
    m subMenuAt:#effects put:(
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   564
        PopUpMenu labels:(resources array:#(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   565
                            'flip - vertical'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   566
                            'flip - horizontal'
322
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   567
                            '-'
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   568
                            'rotate - clockwise'
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   569
                            'rotate - counter clockwise'
426
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   570
                            '-'
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   571
                            'negative'
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   572
                            '-'
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   573
                            'resize'
11
793044d4bc90 *** empty log message ***
claus
parents: 9
diff changeset
   574
"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   575
                            'blurr'
11
793044d4bc90 *** empty log message ***
claus
parents: 9
diff changeset
   576
"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   577
                           ))
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   578
               selectors:#(
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   579
                            flipVertical
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   580
                            flipHorizontal
322
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   581
                            nil
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   582
                            rotateCW
5b3b7c1dbcfc added rotate-effects.
Claus Gittinger <cg@exept.de>
parents: 297
diff changeset
   583
                            rotateCCW
426
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   584
                            nil
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   585
                            negative
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   586
                            nil
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   587
                            resizeImage
11
793044d4bc90 *** empty log message ***
claus
parents: 9
diff changeset
   588
"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   589
                            blurr
11
793044d4bc90 *** empty log message ***
claus
parents: 9
diff changeset
   590
"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   591
                           )
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   592
                receiver:self
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   593
                     for:self
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   594
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   595
    ).
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   596
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   597
    m subMenuAt:#convert put:(
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   598
        convertMenu :=
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   599
        PopUpMenu labels:(resources array:#(
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   600
                            'monochrome (dither)'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   601
                            '-'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   602
                            'gray 2-plane (dither)'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   603
                            'gray 4-plane (dither) '
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   604
                            'gray 8-plane '
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   605
                            '-'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   606
"/                            'color 4-plane (dither)'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   607
"/                            'color 8-plane (dither)'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   608
                            'color 24-plane'
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   609
                           ))
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   610
               selectors:#(
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   611
                            convertToMono
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   612
                            nil
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   613
                            convertToGray2
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   614
                            convertToGray4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   615
                            convertToGray8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   616
                            nil
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   617
"/                            convertToColor4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   618
"/                            convertToColor8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   619
                            convertToColor24
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   620
                           )
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   621
                receiver:self
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   622
                     for:self
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   623
    ).
426
2e3dfa527a07 added #negative
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   624
406
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   625
    image depth == 1 ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   626
        convertMenu disable:#convertToMono
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   627
    ].
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   628
    image depth == 2 ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   629
        (image photometric ~~ #palette
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   630
        and:[image photometric ~~ #rgb]) ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   631
            convertMenu disable:#convertToGray2
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   632
        ]
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   633
    ].
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   634
    image depth == 4 ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   635
        (image photometric ~~ #palette
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   636
        and:[image photometric ~~ #rgb]) ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   637
            convertMenu disable:#convertToGray4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   638
        ] ifFalse:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   639
            convertMenu disable:#convertToColor4
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   640
        ]
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   641
    ].
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   642
    image depth == 8 ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   643
        (image photometric ~~ #palette
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   644
        and:[image photometric ~~ #rgb]) ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   645
            convertMenu disable:#convertToGray8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   646
        ] ifFalse:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   647
            convertMenu disable:#convertToColor8
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   648
        ]
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   649
    ].
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   650
    image depth == 24 ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   651
        image photometric == #rgb ifTrue:[
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   652
            convertMenu disable:#convertToColor24
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   653
        ]
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   654
    ].
b7a8c848a000 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 405
diff changeset
   655
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   656
    ^ m
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   657
26
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   658
    "
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   659
     ImageEditView openOn:'bitmaps/SBrowser.xbm'
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   660
     ImageEditView openOn:'bitmaps/garfield.gif'
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   661
    "
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   662
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   663
    "Created: 20.2.1997 / 18:47:17 / cg"
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   664
    "Modified: 31.7.1997 / 11:41:26 / cg"
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   665
! !
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   666
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   667
!ImageEditView methodsFor:'menu actions'!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   668
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   669
changeMagnification
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   670
    |b newMag|
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   671
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   672
    b := EnterBox new.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   673
    b title:'magnification (magX @ magY)'.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   674
    b okText:'apply'.
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   675
    b abortText:'abort'.
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   676
    b action:[:string | newMag := (Object readFromString:string onError:nil)].
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   677
    b initialText:(magnification printString).
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   678
    b showAtPointer.
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   679
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   680
    newMag notNil ifTrue:[
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   681
        antiAlias ifTrue:[
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   682
            magnification := nil.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   683
        ].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   684
        antiAlias := false.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   685
        self magnification:newMag.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   686
    ].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   687
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   688
    "Modified: 31.7.1997 / 11:43:12 / cg"
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   689
!
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   690
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   691
changeMagnificationAndAntiAlias
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   692
    |b newMag|
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   693
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   694
    b := EnterBox new.
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   695
    b title:'magnification (magX @ magY)'.
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   696
    b okText:'apply'.
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   697
    b abortText:'abort'.
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   698
    b action:[:string | newMag := (Object readFromString:string onError:nil)].
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   699
    b initialText:(magnification printString).
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   700
    b showAtPointer.
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   701
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   702
    newMag notNil ifTrue:[
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   703
        antiAlias ifFalse:[
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   704
            magnification := nil.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   705
        ].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   706
        antiAlias := true.
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   707
        self magnification:newMag
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   708
    ].
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   709
404
322e32d8f099 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
   710
    "Created: 2.6.1997 / 15:51:01 / cg"
477
37f12d35c359 added #resize.
Claus Gittinger <cg@exept.de>
parents: 430
diff changeset
   711
    "Modified: 31.7.1997 / 11:43:47 / cg"
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   712
!
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   713
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   714
doPrint
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   715
    self doPrint:image
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   716
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   717
    "Modified: 2.6.1997 / 18:32:11 / cg"
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   718
!
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   719
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   720
doPrint:anImage
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   721
    |stream psgc|
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   722
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   723
    Printer supportsPostscript ifFalse:[
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   724
        self warn:'need a postscript printer'.
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   725
        ^ self
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   726
    ].
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   727
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   728
    stream := Printer newNative.
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   729
    stream isNil ifTrue:[
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   730
        self warn:'cannot open printer stream'.
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   731
        ^ nil
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   732
    ].
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   733
398
7b7255a4db0d show a wait cursor while printing
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   734
    self withWaitCursorDo:[
7b7255a4db0d show a wait cursor while printing
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   735
        psgc := PSGraphicsContext on:stream. "/  extent:(1.0 @ 1.0).
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   736
        psgc displayForm:anImage x:0 y:0.
398
7b7255a4db0d show a wait cursor while printing
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   737
        psgc close.
7b7255a4db0d show a wait cursor while printing
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   738
    ]
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   739
398
7b7255a4db0d show a wait cursor while printing
Claus Gittinger <cg@exept.de>
parents: 362
diff changeset
   740
    "Modified: 28.5.1997 / 10:54:11 / cg"
405
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   741
    "Created: 2.6.1997 / 18:32:03 / cg"
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   742
!
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   743
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   744
doPrintMagnified
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   745
    self doPrint:(magnifiedImage ? image)
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   746
b87623ce20bb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 404
diff changeset
   747
    "Modified: 2.6.1997 / 18:31:54 / cg"
362
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   748
!
c8d268d3f431 added 'print' item to menu
Claus Gittinger <cg@exept.de>
parents: 353
diff changeset
   749
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   750
doSaveImageAs:anImage title:aTitle
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   751
    "save contents into a file 
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   752
     - ask user for filename using a fileSelectionBox."
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   753
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   754
    |fileName imgFileName defaultName rdr i txt suffix|
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   755
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   756
    defaultName := pathName ? ''.
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   757
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   758
    pathName isNil ifTrue:[
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   759
        suffix := 'tiff'.
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   760
        (imgFileName := image fileName) notNil ifTrue:[
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   761
            suffix := imgFileName asFilename suffix.
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   762
            defaultName := imgFileName asFilename baseName
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   763
        ]
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   764
    ] ifFalse:[
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   765
        suffix := pathName asFilename suffix.
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   766
        "/ a supported suffix ?
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   767
        ((rdr := Image imageReaderClassForSuffix:suffix) isNil 
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   768
        or:[(rdr canRepresent:anImage) not]) ifTrue:[
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   769
            suffix := 'tiff'.
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   770
            defaultName := (pathName asFilename withSuffix:suffix) pathName
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   771
        ].
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   772
    ].
251
a6e8eb4d7922 save the magnified image.
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   773
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   774
    Image cannotRepresentImageSignal handle:[:ex |
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   775
        self warn:('cannot represent this image in that format.\\(%1)' bindWith:ex errorString) withCRs.
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   776
        fileName := nil.
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   777
        ex restart
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   778
    ] do:[
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   779
        fileName := Dialog
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   780
                        requestFileName:(resources string:aTitle)
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   781
                        default:defaultName
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   782
                        ok:(resources string:'save')
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   783
                        abort:(resources string:'abort')
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   784
                        pattern:('*.' , suffix).
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   785
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   786
        fileName notNil ifTrue:[
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   787
            anImage saveOn:fileName.
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   788
        ].
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   789
    ].
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   790
    pathName := fileName.
251
a6e8eb4d7922 save the magnified image.
Claus Gittinger <cg@exept.de>
parents: 210
diff changeset
   791
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   792
    "Created: / 20.2.1997 / 18:52:08 / cg"
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   793
    "Modified: / 3.11.1997 / 15:02:27 / cg"
297
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   794
!
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   795
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   796
saveAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   797
    "save contents into a file 
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   798
     - ask user for filename using a fileSelectionBox."
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   799
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   800
    self doSaveImageAs:image title:'save image in:'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   801
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   802
    "Modified: 20.2.1997 / 18:52:37 / cg"
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   803
!
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   804
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   805
saveMagnifiedAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   806
    "save contents into a file 
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   807
     - ask user for filename using a fileSelectionBox."
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   808
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   809
    self doSaveImageAs:magnifiedImage title:'save magnified image in:'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   810
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   811
    "Created: 20.2.1997 / 18:52:53 / cg"
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   812
!
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   813
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   814
saveMagnifiedMaskAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   815
    "save contents into a file 
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   816
     - ask user for filename using a fileSelectionBox."
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   817
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   818
    self doSaveImageAs:(magnifiedImage mask) title:'save magnified mask in:'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   819
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   820
    "Created: 20.2.1997 / 18:53:31 / cg"
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   821
    "Modified: 20.2.1997 / 18:56:48 / cg"
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   822
!
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   823
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   824
saveMaskAs
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   825
    "save contents into a file 
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   826
     - ask user for filename using a fileSelectionBox."
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   827
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   828
    self doSaveImageAs:(image mask) title:'save mask in:'
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   829
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   830
    "Created: 20.2.1997 / 18:51:06 / cg"
d733af1b0ffe better saving functions;
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   831
    "Modified: 20.2.1997 / 18:56:54 / cg"
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   832
!
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   833
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   834
showColors
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   835
    colorPanel isNil ifTrue:[
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   836
        colorPanel := ColorPanel new
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   837
    ].
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   838
    colorPanel shown ifFalse:[
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   839
        colorPanel open
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   840
    ]
353
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   841
0442fc169b82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 322
diff changeset
   842
    "Modified: 10.4.1997 / 17:22:35 / cg"
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   843
! !
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   844
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   845
!ImageEditView methodsFor:'queries'!
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   846
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   847
heightOfContents
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   848
    "return the images height"
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   849
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   850
    image isNil ifTrue:[^ 0].
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   851
    ^ (image height * magnification y) rounded
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   852
!
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   853
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   854
widthOfContents
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   855
    "return the images width"
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   856
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   857
    image isNil ifTrue:[^ 0].
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   858
    ^ (image width * magnification x) rounded
5
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   859
! !
be72e6ba4822 *** empty log message ***
claus
parents: 1
diff changeset
   860
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   861
!ImageEditView methodsFor:'release'!
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   862
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   863
destroy
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   864
    colors := nil.
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   865
    magnifiedImage := nil.
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   866
    colorPanel notNil ifTrue:[
26
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   867
	colorPanel destroy.
ff148983c183 *** empty log message ***
claus
parents: 11
diff changeset
   868
	colorPanel := nil.
1
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   869
    ].
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   870
    super destroy.
c6ca7bfedf31 Initial revision
claus
parents:
diff changeset
   871
! !
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   872
255
1dfa8deddaef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 251
diff changeset
   873
!ImageEditView class methodsFor:'documentation'!
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   874
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   875
version
606
fefb91a25597 catch invalid format errors
Claus Gittinger <cg@exept.de>
parents: 599
diff changeset
   876
    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.47 1997-11-03 15:19:36 cg Exp $'
161
5b6e284959a4 examples
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   877
! !