ImageEditor.st
changeset 3472 f6c63e715a5b
parent 3471 95c973cafdc1
child 3475 7eafbd0cad40
equal deleted inserted replaced
3471:95c973cafdc1 3472:f6c63e715a5b
  7745     box := EnterBox new.
  7745     box := EnterBox new.
  7746     box title:(resources string:'Images new size:').
  7746     box title:(resources string:'Images new size:').
  7747     box okText:(resources string:'OK').
  7747     box okText:(resources string:'OK').
  7748     box abortText:(resources string:'Cancel').
  7748     box abortText:(resources string:'Cancel').
  7749     box initialText:image extent printString.
  7749     box initialText:image extent printString.
  7750     box addCheckBox:(resources string:'Antialiased') on:antiAliased.
  7750     box verticalPanel add:(CheckBox label:(resources string:'Antialias/Smooth') model:antiAliased).
  7751     box showAtPointer.
  7751     box showAtPointer.
  7752 
  7752     
  7753     (box accepted 
  7753     (box accepted 
  7754     and: [(newSize := self pointFromString:(box contents)) notNil])
  7754     and: [(newSize := self pointFromString:(box contents)) notNil])
  7755     ifTrue:[
  7755     ifTrue:[
  7756         newSize isPoint ifFalse:[
  7756         newSize isPoint ifFalse:[
  7757             self warn:'Please enter the new size as ''x @ y''.'.
  7757             self warn:'Please enter the new size as ''x @ y''.'.
  7758             ^ self.    
  7758             ^ self.    
  7759         ].
  7759         ].
  7760         antiAliased value ifTrue:[
  7760         antiAliased value ifTrue:[
  7761             imageEditView magnifyAntiAliasedImageTo:newSize.
  7761             ((newSize x < image width) or:[(newSize y < image height)]) ifTrue:[
       
  7762                 imageEditView magnifySmoothingTo:newSize.    
       
  7763             ] ifFalse:[    
       
  7764                 imageEditView magnifyAntiAliasedImageTo:newSize.
       
  7765             ].
  7762         ] ifFalse:[
  7766         ] ifFalse:[
  7763             imageEditView magnifyImageTo:newSize.
  7767             imageEditView magnifyImageTo:newSize.
  7764         ].
  7768         ].
  7765     ].
  7769     ].
  7766 
  7770 
  7767     self updateInfoLabel
  7771     self updateInfoLabel
       
  7772 
       
  7773     "Modified: / 30-08-2017 / 15:46:02 / cg"
  7768 !
  7774 !
  7769 
  7775 
  7770 doMagnifyImageBy
  7776 doMagnifyImageBy
  7771     "magnifies the current image (by a scale)"
  7777     "magnifies the current image (by a scale)"
  7772 
  7778